Skip to content

Commit df168f0

Browse files
committed
move files
1 parent a5b6763 commit df168f0

8 files changed

Lines changed: 635 additions & 646 deletions

File tree

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: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
1-
# Generating SQL Dialects and Keywords
1+
# SQL Keywords
22

3-
Dialects enable CodeMirror to provide SQL syntax highlighting.
3+
This directory contains the SQL keywords for the different dialects. Keywords are stored here so they can be lazily loaded.
44

5-
Keywords allow CodeMirror to offer SQL autocompletion and display hover tooltips.
5+
## Structure
66

7-
| Database | How to Run Spec Script |
8-
| -------- | --------------------------------------- |
9-
| DuckDB | `python src/data/duckdb/spec_duckdb.py` |
7+
Refer to `SqlKeywordInfo` type
108

11-
> 💡 **Tip:** Update the script path to match your target SQL dialect.
12-
> Running the script will automatically generate the keywords and types for the corresponding `*.ts` dialect file.
13-
14-
> 🚀 **Quick Start:**
15-
> To open and run the script interactively in marimo, use:
16-
> `uvx marimo edit <path-to-script>`
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)