Skip to content

Commit fc0417e

Browse files
authored
fix(duckdb): correct configuration setup hook (#19)
DuckDB configurations were incorrectly setup. This change corrects the key value pair mapping.
1 parent 7eb2f0a commit fc0417e

File tree

4 files changed

+32
-38
lines changed

4 files changed

+32
-38
lines changed

base.py

Lines changed: 0 additions & 9 deletions
This file was deleted.

sqlspec/adapters/duckdb/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ def _configure_connection(self, connection: "DuckDBPyConnection") -> None:
103103
Args:
104104
connection: The DuckDB connection to configure.
105105
"""
106-
for config in cast("list[str]", self.config):
107-
connection.execute(config)
106+
for key, value in cast("dict[str,Any]", self.config).items():
107+
connection.execute(f"SET {key}='{value}'")
108108

109109
def _configure_extensions(self, connection: "DuckDBPyConnection") -> None:
110110
"""Configure extensions for the connection.

sqlspec/extensions/litestar/plugin.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ def on_app_init(self, app_config: "AppConfig") -> "AppConfig":
3535
3636
Args:
3737
app_config: The :class:`AppConfig <.config.app.AppConfig>` instance.
38+
39+
Returns:
40+
The updated :class:`AppConfig <.config.app.AppConfig>` instance.
3841
"""
3942

4043
from sqlspec.base import ConfigManager

uv.lock

Lines changed: 27 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)