From c0f2a993ee826fa91cab2add7321c52e437bb5a8 Mon Sep 17 00:00:00 2001 From: Elliana May Date: Sun, 21 Aug 2022 16:03:13 +0800 Subject: [PATCH] docs: document preload_extensions config parameter --- README.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/README.md b/README.md index cc7ea815..63417b74 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,20 @@ Basic SQLAlchemy driver for [DuckDB](https://duckdb.org/) + +* [duckdb_engine](#duckdb_engine) + * [Installation](#installation) + * [Usage](#usage) + * [Configuration](#configuration) + * [How to register a pandas DataFrame](#how-to-register-a-pandas-dataframe) + * [Things to keep in mind](#things-to-keep-in-mind) + * [Auto-incrementing ID columns](#auto-incrementing-id-columns) + * [Pandas read_sql() chunksize](#pandas-read_sql-chunksize) + * [Unsigned integer support](#unsigned-integer-support) + * [Preloading extensions (experimental)](#preloading-extensions-experimental) + * [The name](#the-name) + + ## Installation ```sh $ pip install duckdb-engine @@ -110,6 +124,24 @@ The `pandas.read_sql()` method can read tables from `duckdb_engine` into DataFra Unsigned integers are supported by DuckDB, and are available in [`duckdb_engine.datatypes`](duckdb_engine/datatypes.py). +## Preloading extensions (experimental) + +Until the DuckDB python client allows you to natively preload extensions, I've added experimental support via a `connect_args` parameter + +```python +from sqlalchemy import create_engine + +create_engine( + 'duckdb:///:memory:', + connect_args={ + 'preload_extensions': ['https'], + 'config': { + 's3_region': 'ap-southeast-1' + } + } +) +``` + ## The name 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