Skip to content

Commit 330f8be

Browse files
committed
Improve docs for connect_to_table()
1 parent 7486453 commit 330f8be

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

pointblank/validate.py

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2123,20 +2123,28 @@ def connect_to_table(connection_string: str) -> Any:
21232123
----------
21242124
connection_string
21252125
A database connection string with a required table specification using the `::table_name`
2126-
suffix. Supported formats include:
2127-
2128-
- DuckDB: `"duckdb:///path/to/database.ddb::table_name"`
2129-
- SQLite: `"sqlite:///path/to/database.db::table_name"`
2130-
- PostgreSQL: `"postgresql://user:password@localhost:5432/database::table_name"`
2131-
- MySQL: `"mysql://user:password@localhost:3306/database::table_name"`
2132-
- BigQuery: `"bigquery://project/dataset::table_name"`
2133-
- Snowflake: `"snowflake://user:password@account/database/schema::table_name"`
2126+
suffix. Supported formats are outlined in the *Supported Connection String Formats* section.
21342127

21352128
Returns
21362129
-------
21372130
Any
21382131
An Ibis table object for the specified database table.
21392132

2133+
Supported Connection String Formats
2134+
-----------------------------------
2135+
The `connection_string` parameter must include a valid connection string with a table name
2136+
specified using the `::` syntax. For example:
2137+
2138+
- DuckDB: `"duckdb:///path/to/database.ddb::table_name"`
2139+
- SQLite: `"sqlite:///path/to/database.db::table_name"`
2140+
- PostgreSQL: `"postgresql://user:password@localhost:5432/database::table_name"`
2141+
- MySQL: `"mysql://user:password@localhost:3306/database::table_name"`
2142+
- BigQuery: `"bigquery://project/dataset::table_name"`
2143+
- Snowflake: `"snowflake://user:password@account/database/schema::table_name"`
2144+
2145+
If the connection string does not include a table name, the function will attempt to connect to
2146+
the database and list available tables, providing guidance on how to specify a table.
2147+
21402148
Examples
21412149
--------
21422150
Connect to a DuckDB table:

0 commit comments

Comments
 (0)