DuckDBConnection
relationalai.config.connections.duckdb
Configure a DuckDB connection.
Use this when you want to run PyRel against DuckDB (either a file-backed
database or ":memory:"). The underlying DuckDBPyConnection
is created by DuckDBConnection.get_session and cached on the instance.
Examples
from relationalai.config import Config, DuckDBConnection
cfg = Config( connections={"local": DuckDBConnection(path=":memory:")}, default_connection="local")conn = cfg.get_session(DuckDBConnection)Attributes
.path
DuckDBConnection.path: strPath to the DuckDB database file, or ":memory:" for an in-memory database.
.read_only
DuckDBConnection.read_only: (bool, optional)Whether to open the database in read-only mode.
.config
DuckDBConnection.config: (dict[str, Any], optional)Extra DuckDB connection options passed through to duckdb.connect.
Inheritance Hierarchy
Used By
config ├── config │ └── Config │ └── get_session └── connections └── ConnectionConfig