File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change 1- import { db , chdb } from "." ;
1+ import { query , Session } from "." ;
22
3- const conn = new db ( "CSV" , "/tmp" ) ;
3+ // Create a new session instance
4+ const session = new Session ( "/tmp" ) ;
45var result ;
56
6- // Test query
7- result = conn . query ( "SELECT version(), chdb()" ) ;
7+ // Test standalone query
8+ result = query ( "SELECT version(), 'Hello chDB', chdb()" , "CSV ") ;
89console . log ( result ) ;
910
10- // Test session
11- conn . session ( "CREATE FUNCTION IF NOT EXISTS hello AS () -> 'chDB'" ) ;
12- result = conn . session ( "SELECT hello()" , "CSV" ) ;
11+ // Test session query
12+ session . query ( "CREATE FUNCTION IF NOT EXISTS hello AS () -> 'chDB'" , "CSV ") ;
13+ result = session . query ( "SELECT hello()" , "CSV" ) ;
1314console . log ( result ) ;
15+
16+ // Clean up the session
17+ session . cleanup ( ) ;
You can’t perform that action at this time.
0 commit comments