File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -112,6 +112,9 @@ class SQLDialect:
112112MSSQL = SQLDialect (paramstyle = ParamStyle .numeric , limit = Limit .top_n )
113113"""A dialect for MS SQL Server"""
114114
115+ SQLite = SQLDialect (paramstyle = ParamStyle .qmark , limit = Limit .limit )
116+ """A dialect for SQLite."""
117+
115118ClickHouse = SQLDialect (paramstyle = ParamStyle .clickhouse , limit = Limit .limit )
116119
117120# def __repr__(self) -> str:
Original file line number Diff line number Diff line change 77 Limit ,
88 ParamStyle ,
99 SQLDialect ,
10+ SQLite ,
1011)
1112
1213DefaultDialect = DefaultDialect # give sphinx a nudge # noqa: PLW0127
2223"""A dialect for MS SQL Server"""
2324
2425ClickHouse = SQLDialect (paramstyle = ParamStyle .clickhouse , limit = Limit .limit )
26+
27+ SQLite = SQLite # noqa: PLW0127
Original file line number Diff line number Diff line change 22import sqlite3
33from unittest .mock import Mock
44
5+ import csql .dialect
56from csql import Parameters , Q , Query
67from csql .contrib .persist import Key , TempTableCacher
78
@@ -43,7 +44,9 @@ def test_persist_reparameterize():
4344 c = TempTableCacher (con )
4445 p = Parameters (val = 123 )
4546
46- q1 = Q (f""" select { p ["val" ]} as val """ ).persist (c )
47+ q1 = Q (f""" select { p ["val" ]} as val """ , dialect = csql .dialect .SQLite ).persist (
48+ c
49+ )
4750 q2 = Q (f""" select val*2 as v2 from { q1 } """ )
4851
4952 res2 = con .execute (* q2 .db ).fetchall ()
You can’t perform that action at this time.
0 commit comments