Skip to content

Commit 93f2bd3

Browse files
authored
Update README.md
1 parent 2c722db commit 93f2bd3

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,30 @@
1616

1717
<br>
1818

19-
#### Example
20-
##### Query _(query, format)_
19+
### Example
20+
#### Query _(query, format)_
2121
```javascript
2222
const chdb = require('chdb-node');
2323
var result = chdb.Execute('SELECT version()', 'CSV');
2424
console.log(result) // 23.6.1.1
2525
```
2626

27-
##### Session _(query, *format, *path)_
27+
#### Session _(query, *format, *path)_
2828
```javascript
2929
const chdb = require('chdb-node');
3030
chdb.Session("CREATE FUNCTION IF NOT EXISTS hello AS () -> 'chDB'")
3131
var result = = chdb.Session("SELECT hello();")
3232
console.log(result) // chDB
3333
```
3434

35-
Sessions persist table data to disk. You can specify the `path` and `format`:
35+
Sessions persist table data to disk. You can specify `path` to implement auto-cleanup strategies:
3636
```javascript
37-
chdb.Session("CREATE FUNCTION IF NOT EXISTS hello AS () -> 'chDB'", "CSV", "/tmp/")
37+
const temperment = require('temperment');
38+
const tmp = temperment.directory();
39+
chdb.Session("CREATE FUNCTION IF NOT EXISTS hello AS () -> 'chDB'", "CSV", tmp)
40+
var result = = chdb.Session("SELECT hello();")
41+
console.log(result) // chDB
42+
tmp.cleanup.sync();
3843
```
3944

4045
⚠️ _Session folders are persistent and NOT automatically cleaned_

0 commit comments

Comments
 (0)