Skip to content

Commit

Permalink
fix: use numeric_dollar where available
Browse files Browse the repository at this point in the history
  • Loading branch information
Mause committed Dec 5, 2023
1 parent 719b6f5 commit 34855bf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 3 additions & 1 deletion duckdb_engine/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@
from sqlalchemy.engine.default import DefaultDialect
from sqlalchemy.engine.url import URL
from sqlalchemy.ext.compiler import compiles
from packaging.version import Version

from .config import apply_config, get_core_config
from .datatypes import ISCHEMA_NAMES, register_extension_types

__version__ = "0.9.2"
sqlalchemy_version = Version(sqlalchemy.__version__)

if TYPE_CHECKING:
from sqlalchemy.base import Connection
Expand All @@ -39,7 +41,7 @@


class DBAPI:
paramstyle = duckdb.paramstyle
paramstyle = "numeric_dollar" if sqlalchemy_version >= "2.0.0" else "qmark"
apilevel = duckdb.apilevel
threadsafety = duckdb.threadsafety

Expand Down
1 change: 0 additions & 1 deletion duckdb_engine/tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,5 @@ def test_361(engine: Engine) -> None:
select(date_part)
.select_from(test)
.group_by(date_part)
.compile(dialect=engine.dialect, compile_kwargs={"literal_binds": True})
)
conn.execute(stmt).fetchall()

0 comments on commit 34855bf

Please sign in to comment.