Skip to content

SQLAlchemy Backend Base Classes

BaseAlchemyBackend (BaseSQLBackend)

Backend class for backends that compile to SQLAlchemy expressions.


current_database: str property readonly

The name of the current database this client is connected to.

version property readonly

Return the version of the backend engine.

For database servers, return the server version.

For others such as SQLite and pandas return the version of the underlying library or application.


str The backend version


create_table(self, name, expr=None, schema=None, database=None, force=False)

Create a table.


name Table name to create expr DataFrame or table expression to use as the data source schema An ibis schema database A database force Check whether a table exists before creating it

drop_table(self, table_name, database=None, force=False)

Drop a table.


table_name Table to drop database Database to drop table from force Check for existence before dropping

insert(self, table_name, obj, database=None, overwrite=False)

Insert data into a table.


table_name The name of the table to which data needs will be inserted obj The source data or expression to insert database Name of the attached database that the table is located in. overwrite If True then replace existing contents of table


NotImplementedError If inserting data from a different database ValueError If the type of obj isn't supported

list_databases(self, like=None)

List databases in the current server.

list_schemas(self, like=None)

DEPRECATED: list_schemas is deprecated as of v2.0; use list_databases

list_tables(self, like=None, database=None)

Return the list of table names in the current database.

For some backends, the tables may be files in a directory, or other equivalent entities in a SQL database.


like : str, optional A pattern in Python's regex format. database : str, optional The database to list tables of, if not the current one.


list[str] The list of the table names that match the pattern like.

load_data(self, table_name, data, database=None, if_exists='fail')

Load data from a dataframe to the backend.


table_name Name of the table in which to load data data Pandas DataFrame database Database in which the table exists if_exists What to do when data in name already exists


NotImplementedError Loading data to a table from a different database is not yet implemented

schema(self, name)

Get an ibis schema from the current database for the table name.


name Table name


Schema The ibis schema of name

table(self, name, database=None, schema=None)

Create a table expression from a table in the database.


name Table name database The database the table resides in schema The schema inside database where the table resides.

!!! warning "`schema` refers to database organization"

    The `schema` parameter does **not** refer to the column names
    and types of `table`.

Table Table expression

Last update: March 1, 2022