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
Section titled “Examples”>>> from relationalai.config import Config, DuckDBConnection>>> cfg = Config(connections={"local": DuckDBConnection(path=":memory:")}, default_connection="local")>>> conn = cfg.get_session(DuckDBConnection)Attributes
Section titled “Attributes”DuckDBConnection.path: strPath to the DuckDB database file, or ":memory:" for an in-memory database.
.read_only
Section titled “.read_only”DuckDBConnection.read_only: (bool, optional)Whether to open the database in read-only mode.
.config
Section titled “.config”DuckDBConnection.config: (dict[str, Any], optional)Extra DuckDB connection options passed through to duckdb.connect.
Inheritance Hierarchy
Section titled “Inheritance Hierarchy”Used By
Section titled “Used By”config ├── config │ └── Config │ └── get_session └── connections └── ConnectionConfig