File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 21
21
#### Query Constructor
22
22
``` javascript
23
23
const chdb = require (' chdb-node' );
24
- const db = new chdb.db (' CSV' , ' /tmp/mysession' ) // format, storage path
25
24
var result;
26
25
27
26
// Query (ephemeral)
27
+ const db = new chdb.db (' CSV' ) // format
28
28
result = db .query (" SELECT version()" , " TabSeparated" );
29
29
console .log (result)
30
30
31
31
// Query Session (persistent)
32
- db .session (" CREATE FUNCTION IF NOT EXISTS hello AS () -> 'chDB'" );
33
- result = db .session (" SELECT hello()" , " TabSeparated" );
32
+ const dbdisk = new chdb.db (' CSV' , ' /tmp/mysession' ) // format, storage path
33
+ dbdisk .session (" CREATE FUNCTION IF NOT EXISTS hello AS () -> 'chDB'" );
34
+ result = dbdisk .session (" SELECT hello()" , " TabSeparated" );
34
35
console .log (result)
35
36
```
36
37
You can’t perform that action at this time.
0 commit comments