read_sql
read_sql is a method used to execute a SQL query on a database and read the result directly into a table.
Syntax
Parameters
| Parameter | Type | Description |
|---|---|---|
| conn | any | The database connection. Can be either a connection string for the given driver or a Connection object. |
| query | str | The SQL query to execute on the database. |
| driver optional | str | The driver to use. Supported drivers are |
Returns
A new table.
Examples
The following example uses read_sql to execute a SQL query on a Postgres DB via the connectorx driver. The result of the query is a new in-memory table.
