File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -88,6 +88,25 @@ describe('chDB Connection Tests', function () {
8888 expect ( result3 . trim ( ) ) . to . include ( 'Alice' ) ;
8989 console . log ( "✓ Connection persistence test passed" ) ;
9090 } ) ;
91+
92+ it ( 'should persist data after session cleanup and reopen' , function ( ) {
93+ session . cleanup ( ) ;
94+
95+ // Create a new session with the same path
96+ session = new Session ( "./test-connection-tmp" ) ;
97+ session . query ( "USE test_conn_db" )
98+
99+ // Query the data to see if it persists
100+ const result = session . query ( "SELECT * FROM test_table ORDER BY id" , "CSV" ) ;
101+ console . log ( "Query result after session reopen:" , result . trim ( ) ) ;
102+
103+ expect ( result ) . to . be . a ( 'string' ) ;
104+ expect ( result ) . to . include ( 'Alice' ) ;
105+ expect ( result ) . to . include ( 'Bob' ) ;
106+ expect ( result ) . to . include ( '1' ) ;
107+ expect ( result ) . to . include ( '2' ) ;
108+ console . log ( "✓ Data persisted after session cleanup and reopen" ) ;
109+ } ) ;
91110 } ) ;
92111
93112} ) ;
You can’t perform that action at this time.
0 commit comments