Skip to content

Commit 33aff1f

Browse files
committed
insertquery and snippet for nodes
1 parent fb5eeef commit 33aff1f

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

src/ls/driver.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,4 +174,13 @@ export default class IRISDriver extends AbstractDriver<IRISdb, DriverOptions> im
174174
public getStaticCompletions: IConnectionDriver['getStaticCompletions'] = async () => {
175175
return keywordsCompletion;
176176
}
177+
178+
public async getInsertQuery({item, columns}): Promise<string> {
179+
let insertQuery = `INSERT INTO ${item.schema}.${item.label} (${columns.map((col) => col.label).join(', ')}) VALUES (`;
180+
columns.forEach((col, index) => {
181+
insertQuery = insertQuery.concat(`'\${${index + 1}:${col.label}:${col.dataType}}', `);
182+
});
183+
return insertQuery;
184+
}
185+
177186
}

src/ls/queries.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ SELECT
8787
? `
8888
${ValueColumn[type]} AS label,
8989
SCHEMA_NAME AS "schema",
90+
SCHEMA_NAME || '.' || ${ValueColumn[type]} AS "snippet",
9091
'${type}' AS "type",
9192
${type == ContextValue.VIEW ? `'TRUE'` : 'NULL'} AS isView,
9293
'0:' || ${ValueColumn[type]} AS sortText

test/docker-compose.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,14 @@ services:
44
image: daimor/intersystems-cache:2016.2
55
ports:
66
- 57772:57772
7+
volumes:
8+
- ~/cache.key:/usr/cachesys/mgr/cache.key
79
cache18:
810
image: daimor/intersystems-cache:2018.1
911
ports:
1012
- 57773:57772
13+
volumes:
14+
- ~/cache.key:/usr/cachesys/mgr/cache.key
1115
iris:
1216
build: iris
1317
init: true

0 commit comments

Comments
 (0)