# API Reference


## Main


[open()](open.md#mikeplus.open)  
Open an existing MIKE+ model database.

[create()](create.md#mikeplus.create)  
Create a new MIKE+ model database.

[to_sql()](to_sql.md#mikeplus.to_sql)  
Convert a Python value to its SQL string representation.


## Database


[Database](Database.md#mikeplus.Database)  
Represents a MIKE+ model database.

[DatabaseError](DatabaseError.md#mikeplus.DatabaseError)  
Raised when a MIKE+ database operation fails.

[tables.TableCollection](tables.TableCollection.md#mikeplus.tables.TableCollection)  
Collection of auto-generated table classes for MIKE+ database tables.


## Queries


Returned by the `select`, `insert`, `update` and `delete` methods of a table.


[queries.BaseQuery](queries.BaseQuery.md#mikeplus.queries.BaseQuery)  
Base class for all query types.

[queries.SelectQuery](queries.SelectQuery.md#mikeplus.queries.SelectQuery)  
Query class for SELECT operations.

[queries.InsertQuery](queries.InsertQuery.md#mikeplus.queries.InsertQuery)  
Query class for INSERT operations.

[queries.UpdateQuery](queries.UpdateQuery.md#mikeplus.queries.UpdateQuery)  
Query class for UPDATE operations.

[queries.DeleteQuery](queries.DeleteQuery.md#mikeplus.queries.DeleteQuery)  
Query class for DELETE operations.


## Scenarios


Returned by `Database.scenarios` and `Database.alternative_groups`.


[scenarios.ScenarioCollection](scenarios.ScenarioCollection.md#mikeplus.scenarios.ScenarioCollection)  
Collection-like access to scenarios in the database.

[scenarios.Scenario](scenarios.Scenario.md#mikeplus.scenarios.Scenario)  
Represents a scenario in the MIKE+ model.

[scenarios.AlternativeGroupCollection](scenarios.AlternativeGroupCollection.md#mikeplus.scenarios.AlternativeGroupCollection)  
Collection-like access to alternative groups.

[scenarios.AlternativeGroup](scenarios.AlternativeGroup.md#mikeplus.scenarios.AlternativeGroup)  
Represents an alternative group with collection-like access to alternatives.

[scenarios.Alternative](scenarios.Alternative.md#mikeplus.scenarios.Alternative)  
Represents an alternative in the MIKE+ model.


## Table base classes


Shared by every table in `Database.tables`.


[tables.BaseTable](tables.BaseTable.md#mikeplus.tables.BaseTable)  
Base class representing a database table.

[tables.BaseGeometryTable](tables.BaseGeometryTable.md#mikeplus.tables.BaseGeometryTable)  
Base class representing a database table with geometry.

[tables.BaseNodeTable](tables.BaseNodeTable.md#mikeplus.tables.BaseNodeTable)  
Base class representing a database table with node-based geometry.

[tables.BaseColumns](tables.BaseColumns.md#mikeplus.tables.BaseColumns)  
Base class for column enumeration-like access.

[tables.BaseTableCollection](tables.BaseTableCollection.md#mikeplus.tables.BaseTableCollection)  
A dict-like collection of tables in a model database.


## Tools


[tools.ImportTool](tools.ImportTool.md#mikeplus.tools.ImportTool)  
The Import Tool from MIKE+.

[tools.InterpolationTool](tools.InterpolationTool.md#mikeplus.tools.InterpolationTool)  
The Interpolation and Assignment tool from MIKE+.

[tools.TopoRepairTool](tools.TopoRepairTool.md#mikeplus.tools.TopoRepairTool)  
Topology repair tool for MIKE+.

[tools.ConnectionRepairTool](tools.ConnectionRepairTool.md#mikeplus.tools.ConnectionRepairTool)  
The Connection Repair Tool from MIKE+.

[tools.CreateValvesFromPointsTool](tools.CreateValvesFromPointsTool.md#mikeplus.tools.CreateValvesFromPointsTool)  
The Create Valves from Point Locations tool from MIKE+ (water distribution only).

[tools.DemandConnectionTool](tools.DemandConnectionTool.md#mikeplus.tools.DemandConnectionTool)  
The connection tool from MIKE+ for demand allocations.

[tools.DemandAggregationTool](tools.DemandAggregationTool.md#mikeplus.tools.DemandAggregationTool)  
The demand Aggregation tool from MIKE+ water distribution.

[tools.CathSlopeLengthProcess](tools.CathSlopeLengthProcess.md#mikeplus.tools.CathSlopeLengthProcess)  
The Catchment Slope Length Process tool from MIKE+.


## Utilities


[utilities.get_nearest_river_at()](utilities.get_nearest_river_at.md#mikeplus.utilities.get_nearest_river_at)  
Get the name of the river nearest to a point.

[utilities.get_nearest_river_chainage_at()](utilities.get_nearest_river_chainage_at.md#mikeplus.utilities.get_nearest_river_chainage_at)  
Get the river and chainage nearest to a point.
