Skip to content

Commit 43dbf19

Browse files
committed
Add DialectCSVQ implementation for CSVQ databases
1 parent 13b6e39 commit 43dbf19

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

dialect_csvq.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Copyright the DMorph contributors.
2+
// SPDX-License-Identifier: MPL-2.0
3+
4+
package dmorph
5+
6+
// DialectCSVQ returns a Dialect configured for CSVQ databases.
7+
func DialectCSVQ() BaseDialect {
8+
return BaseDialect{
9+
CreateTemplate: `
10+
CREATE TABLE IF NOT EXISTS %s (
11+
id,
12+
create_ts
13+
)`,
14+
AppliedTemplate: `
15+
SELECT id
16+
FROM %s
17+
ORDER BY create_ts ASC`,
18+
RegisterTemplate: `
19+
INSERT INTO %s (id)
20+
VALUES(:id)`,
21+
}
22+
}

0 commit comments

Comments
 (0)