sqlalchemy
library and a database URL.
psycopg2-binary
adapter:
mysqlclient
adapter:
mysqlclient
adapter may have additional system-level dependencies. Please consult the official installation guide for more details.
You will also need a database. The following example uses a Postgres database running in a Docker container.
Parameter | Type | Default | Description |
---|---|---|---|
db_url | str | None | The URL for connecting to the database. |
db_engine | Engine | None | The database engine used for connections and operations. |
user | str | None | The username for database authentication. |
password | str | None | The password for database authentication. |
host | str | None | The hostname or IP address of the database server. |
port | int | None | The port number on which the database server is listening. |
schema | str | None | The specific schema within the database to use. |
dialect | str | None | The SQL dialect used by the database. |
tables | Dict[str, Any] | None | A dictionary mapping table names to their respective metadata or structure. |
enable_list_tables | bool | True | Enables the functionality to list all tables in the database. |
enable_describe_table | bool | True | Enables the functionality to describe the schema of a specific table. |
enable_run_sql_query | bool | True | Enables the functionality to execute SQL queries directly. |
all | bool | False | Enables all functionality when set to True. |
Function | Description |
---|---|
list_tables | Lists all tables in the database. |
describe_table | Describes the schema of a specific table. |
run_sql_query | Executes SQL queries directly. |