Skip to content

Commit 361da53

Browse files
committed
Add auto-complete for config types
1 parent 60edd89 commit 361da53

File tree

2 files changed

+143
-0
lines changed

2 files changed

+143
-0
lines changed

package.json

+6
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@
5454
"title": "Open table at cursor in DevDb"
5555
}
5656
],
57+
"jsonValidation": [
58+
{
59+
"fileMatch": ".devdbrc",
60+
"url": "./schemas/devdbrc.json"
61+
}
62+
],
5763
"viewsContainers": {
5864
"panel": [
5965
{

schemas/devdbrc.json

+137
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"title": "DevDb Configuration",
4+
"description": "Configuration file for DevDb VS Code extension",
5+
"type": "array",
6+
"items": {
7+
"type": "object",
8+
"oneOf": [
9+
{
10+
"title": "SQLite Configuration",
11+
"required": ["type", "path"],
12+
"properties": {
13+
"type": {
14+
"type": "string",
15+
"enum": ["sqlite"],
16+
"description": "Database type - SQLite"
17+
},
18+
"path": {
19+
"type": "string",
20+
"description": "Path to SQLite database file"
21+
}
22+
}
23+
},
24+
{
25+
"title": "MySQL/MariaDB Configuration",
26+
"required": ["type", "username", "password", "database"],
27+
"properties": {
28+
"name": {
29+
"type": "string",
30+
"description": "Optional name for this connection"
31+
},
32+
"type": {
33+
"type": "string",
34+
"enum": ["mysql", "mariadb"],
35+
"description": "Database type - MySQL or MariaDB"
36+
},
37+
"host": {
38+
"type": "string",
39+
"description": "Database host",
40+
"default": "localhost"
41+
},
42+
"port": {
43+
"type": "number",
44+
"description": "Database port",
45+
"default": 3306
46+
},
47+
"username": {
48+
"type": "string",
49+
"description": "Database username"
50+
},
51+
"password": {
52+
"type": "string",
53+
"description": "Database password"
54+
},
55+
"database": {
56+
"type": "string",
57+
"description": "Database name"
58+
}
59+
}
60+
},
61+
{
62+
"title": "PostgreSQL Configuration",
63+
"required": ["type", "username", "password", "database"],
64+
"properties": {
65+
"name": {
66+
"type": "string",
67+
"description": "Optional name for this connection"
68+
},
69+
"type": {
70+
"type": "string",
71+
"enum": ["postgres"],
72+
"description": "Database type - PostgreSQL"
73+
},
74+
"host": {
75+
"type": "string",
76+
"description": "Database host",
77+
"default": "localhost"
78+
},
79+
"port": {
80+
"type": "number",
81+
"description": "Database port",
82+
"default": 5432
83+
},
84+
"username": {
85+
"type": "string",
86+
"description": "Database username"
87+
},
88+
"password": {
89+
"type": "string",
90+
"description": "Database password"
91+
},
92+
"database": {
93+
"type": "string",
94+
"description": "Database name"
95+
}
96+
}
97+
},
98+
{
99+
"title": "Microsoft SQL Server Configuration",
100+
"required": ["type", "username", "password", "database"],
101+
"properties": {
102+
"name": {
103+
"type": "string",
104+
"description": "Optional name for this connection"
105+
},
106+
"type": {
107+
"type": "string",
108+
"enum": ["mssql"],
109+
"description": "Database type - Microsoft SQL Server"
110+
},
111+
"host": {
112+
"type": "string",
113+
"description": "Database host",
114+
"default": "localhost"
115+
},
116+
"port": {
117+
"type": "number",
118+
"description": "Database port",
119+
"default": 1433
120+
},
121+
"username": {
122+
"type": "string",
123+
"description": "Database username"
124+
},
125+
"password": {
126+
"type": "string",
127+
"description": "Database password"
128+
},
129+
"database": {
130+
"type": "string",
131+
"description": "Database name"
132+
}
133+
}
134+
}
135+
]
136+
}
137+
}

0 commit comments

Comments
 (0)