Skip to content

Commit 297a55a

Browse files
authored
add duckdb spec and python file, with keywords (#10)
* add python generator file and spec * fix typos * move files * readme comment * typos ignore
1 parent 99a76df commit 297a55a

10 files changed

Lines changed: 1035 additions & 245 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ scripts/**.js
55
dist
66
.DS_Store
77
!.vscode
8+
__marimo__

_typos.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[default]
2+
# Use typos:ignore-next-line to ignore the next line in the codebase
3+
extend-ignore-re = ["(#|//)\\s*typos:ignore-next-line\\n.*"]
4+
5+
[files]
6+
extend-exclude = ["src/data/duckdb-keywords.json"]

demo/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ function initializeEditor() {
129129
enableTables: true, // Show table information
130130
enableColumns: true, // Show column information
131131
keywords: async () => {
132-
const keywords = await import("../src/data/common-keywords.json");
133-
return keywords.default.keywords;
132+
const keywords = await import("../src/data/duckdb-keywords.json");
133+
return keywords.default;
134134
},
135135
},
136136
}),

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
},
4545
"files": [
4646
"dist",
47-
"src/data"
47+
"src/data/*.json"
4848
],
4949
"exports": {
5050
"./package.json": "./package.json",
@@ -54,7 +54,8 @@
5454
"default": "./dist/index.js"
5555
}
5656
},
57-
"./data/common-keywords.json": "./src/data/common-keywords.json"
57+
"./data/common-keywords.json": "./src/data/common-keywords.json",
58+
"./data/duckdb-keywords.json": "./src/data/duckdb-keywords.json"
5859
},
5960
"types": "./dist/index.d.ts",
6061
"type": "module",
@@ -67,4 +68,4 @@
6768
"@codemirror/lint": "^6.8.5",
6869
"node-sql-parser": "^5.3.10"
6970
}
70-
}
71+
}

src/data/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# SQL Keywords
2+
3+
This directory contains the SQL keywords for the different dialects. Keywords are stored here so they can be lazily loaded.
4+
5+
## Structure
6+
7+
By default, we use the `SqlKeywordInfo` type to define the keywords.
8+
9+
```json
10+
{
11+
"keyword": {
12+
"description": "Description of the keyword",
13+
"syntax": "Syntax of the keyword",
14+
"example": "Example of the keyword",
15+
"metadata": {
16+
"tag1": "value1",
17+
"tag2": "value2"
18+
}
19+
}
20+
}
21+
```

src/data/common-keywords.json

Lines changed: 238 additions & 240 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)