Skip to content

Commit e0308ab

Browse files
committed
Pass database from configuration to sql-lint
1 parent dd4b825 commit e0308ab

3 files changed

Lines changed: 7 additions & 0 deletions

File tree

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,11 @@
150150
"default": "localhost",
151151
"markdownDescription": "Database host address."
152152
},
153+
"inlineSQL.dbDatabase": {
154+
"type": "string",
155+
"default": "postgres",
156+
"markdownDescription": "Database name."
157+
},
153158
"inlineSQL.dbPort": {
154159
"type": "number",
155160
"default": 5432,

src/configuration.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export type Configuration = {
1212
dbDriver: DRIVER;
1313
dbHost: string;
1414
dbPort: number;
15+
dbDatabase: string;
1516
dbUser: string;
1617
dbPassword: string;
1718
lintSQLFiles: boolean;

src/extension.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ async function checkRange(
2323
sql: sqlStr,
2424
driver: configuration.get<string>('dbDriver'),
2525
host: configuration.get<string>('dbHost'),
26+
database: configuration.get<string>('dbDatabase'),
2627
port: configuration.get<number>('dbPort'),
2728
user: configuration.get<string>('dbUser'),
2829
password: configuration.get<string>('dbPassword'),

0 commit comments

Comments
 (0)