Skip to content

Commit 5b01a10

Browse files
authored
Update README.md
1 parent e17b83b commit 5b01a10

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,39 +19,39 @@
1919

2020
#### Query Constructor
2121
```javascript
22-
const chdb = require('chdb-node');
22+
const chdb = require("chdb-node");
2323
var result;
2424

2525
// Query (ephemeral)
26-
const db = new chdb.db('CSV') // format
26+
const db = new chdb.db("CSV") // format
2727
result = db.query("SELECT version()");
2828
console.log(result)
2929

3030
// Query Session (persistent)
31-
const dbdisk = new chdb.db('CSV', '/tmp/mysession') // format, storage path
31+
const dbdisk = new chdb.db("CSV", "/tmp/mysession") // format, storage path
3232
dbdisk.session("CREATE FUNCTION IF NOT EXISTS hello AS () -> 'chDB'");
3333
result = dbdisk.session("SELECT hello()", "TabSeparated"); // optional format override
3434
console.log(result)
3535
```
3636

3737
#### Query _(query, format)_
3838
```javascript
39-
const chdb = require('chdb-node').chdb;
40-
var result = chdb.Execute('SELECT version()', 'CSV');
39+
const chdb = require("chdb-node").chdb;
40+
var result = chdb.Execute("SELECT version()", "CSV");
4141
console.log(result) // 23.6.1.1
4242
```
4343

4444
#### Session _(query, *format, *path)_
4545
```javascript
46-
const chdb = require('chdb-node').chdb;
46+
const chdb = require("chdb-node").chdb;
4747
chdb.Session("CREATE FUNCTION IF NOT EXISTS hello AS () -> 'chDB'")
4848
var result = = chdb.Session("SELECT hello();")
4949
console.log(result) // chDB
5050
```
5151

5252
> ⚠️ Sessions persist table data to disk. You can specify `path` to implement auto-cleanup strategies:
5353
```javascript
54-
const temperment = require('temperment');
54+
const temperment = require("temperment");
5555
const tmp = temperment.directory();
5656
chdb.Session("CREATE FUNCTION IF NOT EXISTS hello AS () -> 'chDB'", "CSV", tmp)
5757
var result = = chdb.Session("SELECT hello();")

0 commit comments

Comments
 (0)