Execute a SQL command and return a string representing the results.
__init__(engine: Engine, schema: Optional[str] = None, metadata: Optional[MetaData] = None, ignore_tables: Optional[List[str]] = None, include_tables: Optional[List[str]] = None, sample_rows_in_table_info: int = 3, indexes_in_table_info: bool = False, custom_table_info: Optional[dict] = None, view_support: bool = False, max_string_length: int = 300)[source]¶
Create engine from database URI.
classmethod from_cnosdb(url: str = '127.0.0.1:8902', user: str = 'root', password: str = '', tenant: str = 'cnosdb', database: str = 'public') → SQLDatabase[source]¶
Class method to create an SQLDatabase instance from a CnosDB connection.
This method requires the ‘cnos-connector’ package. If not installed, it
can be added using pip install cnos-connector.
Parameters
url (str) – The HTTP connection host name and port number of the CnosDB
service, excluding “http://” or “https://”, with a default value
of “127.0.0.1:8902”.
user (str) – The username used to connect to the CnosDB service, with a
default value of “root”.
password (str) – The password of the user connecting to the CnosDB service,
with a default value of “”.
tenant (str) – The name of the tenant used to connect to the CnosDB service,
with a default value of “cnosdb”.
database (str) – The name of the database in the CnosDB tenant.
Returns
An instance of SQLDatabase configured with the provided
CnosDB connection details.
Return type
SQLDatabase