## tables.BaseTable


Base class representing a database table.


Usage

``` python
tables.BaseTable(net_table)
```


## Attributes

| Name | Description |
|----|----|
| [columns](#columns) | Get the columns for the table. |
| [description](#description) | Get the table description. |
| [display_name](#display_name) | Get the display name for the table. |
| [name](#name) | Get the table name. |

------------------------------------------------------------------------


#### columns


Get the columns for the table.


`columns: BaseColumns`


------------------------------------------------------------------------


#### description


Get the table description.


`description: str`


------------------------------------------------------------------------


#### display_name


Get the display name for the table.


`display_name: str`


------------------------------------------------------------------------


#### name


Get the table name.


`name: str`


## Methods

| Name | Description |
|----|----|
| [__init__()](#__init__) | Initialize a new table wrapper. |
| [__repr__()](#__repr__) | Get string representation. |
| [add_user_defined_column()](#add_user_defined_column) | Add a user defined column to table. |
| [delete()](#delete) | Create a `DELETE` query for this table. |
| [get_muids()](#get_muids) | Get a list of MUIDs for the table. |
| [insert()](#insert) | Insert a row with given values. |
| [select()](#select) | Create a `SELECT` query for this table. |
| [to_dataframe()](#to_dataframe) | Convert the table data to a pandas DataFrame. |
| [update()](#update) | Create an `UPDATE` query for this table. |

------------------------------------------------------------------------


#### \_\_init\_\_()


Initialize a new table wrapper.


Usage

``` python
__init__(net_table)
```


##### Parameters


`net_table: Any`  
The underlying .NET IMuTable object


------------------------------------------------------------------------


#### \_\_repr\_\_()


Get string representation.


Usage

``` python
__repr__()
```


##### Returns


`str`  
Class name and table display name.


------------------------------------------------------------------------


#### add_user_defined_column()


Add a user defined column to table.


Usage

``` python
add_user_defined_column(column_name, column_data_type, column_header=None)
```


Equivalent to `table.columns.add_user_defined`, so it is safe to call repeatedly.


##### Parameters


`column_name: str`  
Name of the column in the database. Case-insensitive.

`column_data_type: str`  
Data type of the column. One of 'integer', 'double', 'string', 'datetime', in any casing.

`column_header: str | None = None`  
Name of the column as displayed in the MIKE+ GUI. None uses the column_name.


##### Returns


`str`  
MUID of the column's record in `m_UserDefinedColumn`.


##### Raises


`ValueError`  
If the column already exists with a different data type, or is a standard MIKE+ column.


------------------------------------------------------------------------


#### delete()


Create a `DELETE` query for this table.


Usage

``` python
delete()
```


##### Returns


`DeleteQuery`  
A new DeleteQuery object


------------------------------------------------------------------------


#### get_muids()


Get a list of MUIDs for the table.


Usage

``` python
get_muids(order_by=None, descending=False)
```


##### Parameters


`order_by: str or None = None`  
Column to order the MUIDs by

`descending: bool = ``False`  
Whether to order in descending order


##### Returns


`list of str`  
A list of MUIDs


------------------------------------------------------------------------


#### insert()


Insert a row with given values.


Usage

``` python
insert(values, execute=True)
```


##### Parameters


`values: dict[str, Any]`  
Column-value pairs to insert.

`execute: bool = ``True`  
If True, executes immediately (default). If False, returns an InsertQuery.


##### Returns


`str or InsertQuery`  
When execute=True, returns the MUID of the inserted row. When execute=False, returns an InsertQuery instance.


##### Notes

User-defined columns cannot be set via command-based insert in the .NET application. Handling of user-defined columns is performed in InsertQuery when the query is executed.

------------------------------------------------------------------------


#### select()


Create a `SELECT` query for this table.


Usage

``` python
select(columns=None)
```


##### Parameters


`columns: str or list of str = None`  
The column or columns to select


##### Returns


`SelectQuery`  
A new SelectQuery object


------------------------------------------------------------------------


#### to_dataframe()


Convert the table data to a pandas DataFrame.


Usage

``` python
to_dataframe()
```


##### Returns


`pandas.DataFrame`  
A pandas DataFrame containing all table data


------------------------------------------------------------------------


#### update()


Create an `UPDATE` query for this table.


Usage

``` python
update(values)
```


##### Parameters


`values: dict of str to Any`  
Column-value pairs to set in the UPDATE


##### Returns


`UpdateQuery`  
A new UpdateQuery object
