Skip to content

Commit

Permalink
insertquery and snippet for nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
daimor committed Jul 27, 2020
1 parent fb5eeef commit 33aff1f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/ls/driver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,4 +174,13 @@ export default class IRISDriver extends AbstractDriver<IRISdb, DriverOptions> im
public getStaticCompletions: IConnectionDriver['getStaticCompletions'] = async () => {
return keywordsCompletion;
}

public async getInsertQuery({item, columns}): Promise<string> {
let insertQuery = `INSERT INTO ${item.schema}.${item.label} (${columns.map((col) => col.label).join(', ')}) VALUES (`;
columns.forEach((col, index) => {
insertQuery = insertQuery.concat(`'\${${index + 1}:${col.label}:${col.dataType}}', `);
});
return insertQuery;
}

}
1 change: 1 addition & 0 deletions src/ls/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ SELECT
? `
${ValueColumn[type]} AS label,
SCHEMA_NAME AS "schema",
SCHEMA_NAME || '.' || ${ValueColumn[type]} AS "snippet",
'${type}' AS "type",
${type == ContextValue.VIEW ? `'TRUE'` : 'NULL'} AS isView,
'0:' || ${ValueColumn[type]} AS sortText
Expand Down
4 changes: 4 additions & 0 deletions test/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@ services:
image: daimor/intersystems-cache:2016.2
ports:
- 57772:57772
volumes:
- ~/cache.key:/usr/cachesys/mgr/cache.key
cache18:
image: daimor/intersystems-cache:2018.1
ports:
- 57773:57772
volumes:
- ~/cache.key:/usr/cachesys/mgr/cache.key
iris:
build: iris
init: true
Expand Down

0 comments on commit 33aff1f

Please sign in to comment.