|
5 | 5 | Basic SQLAlchemy driver for [DuckDB](https://duckdb.org/) |
6 | 6 |
|
7 | 7 | <!--ts--> |
8 | | -* [duckdb_engine](#duckdb_engine) |
9 | | - * [Installation](#installation) |
10 | | - * [Usage](#usage) |
11 | | - * [Usage in IPython/Jupyter](#usage-in-ipythonjupyter) |
12 | | - * [Configuration](#configuration) |
13 | | - * [How to register a pandas DataFrame](#how-to-register-a-pandas-dataframe) |
14 | | - * [Things to keep in mind](#things-to-keep-in-mind) |
15 | | - * [Auto-incrementing ID columns](#auto-incrementing-id-columns) |
16 | | - * [Pandas read_sql() chunksize](#pandas-read_sql-chunksize) |
17 | | - * [Unsigned integer support](#unsigned-integer-support) |
18 | | - * [Alembic Integration](#alembic-integration) |
19 | | - * [Preloading extensions (experimental)](#preloading-extensions-experimental) |
20 | | - * [The name](#the-name) |
| 8 | +- [duckdb\_engine](#duckdb_engine) |
| 9 | + - [Installation](#installation) |
| 10 | + - [Usage](#usage) |
| 11 | + - [Usage in IPython/Jupyter](#usage-in-ipythonjupyter) |
| 12 | + - [Configuration](#configuration) |
| 13 | + - [How to register a pandas DataFrame](#how-to-register-a-pandas-dataframe) |
| 14 | + - [Things to keep in mind](#things-to-keep-in-mind) |
| 15 | + - [Auto-incrementing ID columns](#auto-incrementing-id-columns) |
| 16 | + - [Pandas `read_sql()` chunksize](#pandas-read_sql-chunksize) |
| 17 | + - [Unsigned integer support](#unsigned-integer-support) |
| 18 | + - [Alembic Integration](#alembic-integration) |
| 19 | + - [Preloading extensions (experimental)](#preloading-extensions-experimental) |
| 20 | + - [Registering Filesystems](#registering-filesystems) |
| 21 | + - [The name](#the-name) |
21 | 22 |
|
22 | 23 | <!-- Created by https://github.com/ekalinin/github-markdown-toc --> |
23 | 24 | <!-- Added by: me, at: Wed 20 Sep 2023 12:44:27 AWST --> |
@@ -180,6 +181,24 @@ create_engine( |
180 | 181 | ) |
181 | 182 | ``` |
182 | 183 |
|
| 184 | +## Registering Filesystems |
| 185 | + |
| 186 | +> DuckDB allows registering filesystems from [fsspec](https://filesystem-spec.readthedocs.io/), see [documentation](https://duckdb.org/docs/guides/python/filesystems.html) for more information. |
| 187 | +
|
| 188 | +Support is provided under `connect_args` parameter |
| 189 | + |
| 190 | +```python |
| 191 | +from sqlalchemy import create_engine |
| 192 | +from fsspec import filesystem |
| 193 | + |
| 194 | +create_engine( |
| 195 | + 'duckdb:///:memory:', |
| 196 | + connect_args={ |
| 197 | + 'register_filesystems': [filesystem('gcs')], |
| 198 | + } |
| 199 | +) |
| 200 | +``` |
| 201 | + |
183 | 202 | ## The name |
184 | 203 |
|
185 | 204 | Yes, I'm aware this package should be named `duckdb-driver` or something, I wasn't thinking when I named it and it's too hard to change the name now |
0 commit comments