@@ -859,6 +859,7 @@ void Statement::JS_new (v8::FunctionCallbackInfo <v8 :: Value> const & info)
859
859
if (handle == NULL ) {
860
860
return ThrowRangeError (" The supplied SQL string contains no statements" );
861
861
}
862
+
862
863
for (char c; (c = *tail); ) {
863
864
if (IS_SKIPPED (c)) {
864
865
++tail;
@@ -894,9 +895,9 @@ void Statement::JS_new (v8::FunctionCallbackInfo <v8 :: Value> const & info)
894
895
895
896
info.GetReturnValue ().Set (info.This ());
896
897
}
897
- #line 152 "./src/objects/statement.lzz"
898
+ #line 153 "./src/objects/statement.lzz"
898
899
void Statement::JS_run (v8::FunctionCallbackInfo <v8 :: Value> const & info)
899
- #line 152 "./src/objects/statement.lzz"
900
+ #line 153 "./src/objects/statement.lzz"
900
901
{
901
902
Statement * stmt = node :: ObjectWrap :: Unwrap < Statement > ( info . This ( ) ) ; ( ( void ) 0 ) ; sqlite3_stmt * handle = stmt -> handle ; Database * db = stmt -> db ; if ( ! db -> GetState ( ) -> open ) return ThrowTypeError ( "The database connection is not open" ) ; if ( db -> GetState ( ) -> busy ) return ThrowTypeError ( "This database connection is busy executing a query" ) ; if ( stmt -> locked ) return ThrowTypeError ( "This statement is busy executing a query" ) ; if ( ! db -> GetState ( ) -> unsafe_mode ) { if ( db -> GetState ( ) -> iterators ) return ThrowTypeError ( "This database connection is busy executing a query" ) ; } ( ( void ) 0 ) ; const bool bound = stmt -> bound ; if ( ! bound ) { Binder binder ( handle ) ; if ( ! binder . Bind ( info , info . Length ( ) , stmt ) ) { sqlite3_clear_bindings ( handle ) ; return ; } ( ( void ) 0 ) ; } else if ( info . Length ( ) > 0 ) { return ThrowTypeError ( "This statement already has bound parameters" ) ; } ( ( void ) 0 ) ; db -> GetState ( ) -> busy = true ; v8 :: Isolate * isolate = info . GetIsolate ( ) ; if ( db -> Log ( isolate , handle ) ) { db -> GetState ( ) -> busy = false ; db -> ThrowDatabaseError ( ) ; if ( ! bound ) { sqlite3_clear_bindings ( handle ) ; } return ; } ( ( void ) 0 ) ;
902
903
sqlite3* db_handle = db->GetHandle ();
@@ -919,9 +920,9 @@ void Statement::JS_run (v8::FunctionCallbackInfo <v8 :: Value> const & info)
919
920
}
920
921
db -> GetState ( ) -> busy = false ; db -> ThrowDatabaseError ( ) ; if ( ! bound ) { sqlite3_clear_bindings ( handle ) ; } return ;
921
922
}
922
- #line 175 "./src/objects/statement.lzz"
923
+ #line 176 "./src/objects/statement.lzz"
923
924
void Statement::JS_get (v8::FunctionCallbackInfo <v8 :: Value> const & info)
924
- #line 175 "./src/objects/statement.lzz"
925
+ #line 176 "./src/objects/statement.lzz"
925
926
{
926
927
Statement * stmt = node :: ObjectWrap :: Unwrap < Statement > ( info . This ( ) ) ; if ( ! stmt -> returns_data ) return ThrowTypeError ( "This statement does not return data. Use run() instead" ) ; sqlite3_stmt * handle = stmt -> handle ; Database * db = stmt -> db ; if ( ! db -> GetState ( ) -> open ) return ThrowTypeError ( "The database connection is not open" ) ; if ( db -> GetState ( ) -> busy ) return ThrowTypeError ( "This database connection is busy executing a query" ) ; if ( stmt -> locked ) return ThrowTypeError ( "This statement is busy executing a query" ) ; const bool bound = stmt -> bound ; if ( ! bound ) { Binder binder ( handle ) ; if ( ! binder . Bind ( info , info . Length ( ) , stmt ) ) { sqlite3_clear_bindings ( handle ) ; return ; } ( ( void ) 0 ) ; } else if ( info . Length ( ) > 0 ) { return ThrowTypeError ( "This statement already has bound parameters" ) ; } ( ( void ) 0 ) ; db -> GetState ( ) -> busy = true ; v8 :: Isolate * isolate = info . GetIsolate ( ) ; if ( db -> Log ( isolate , handle ) ) { db -> GetState ( ) -> busy = false ; db -> ThrowDatabaseError ( ) ; if ( ! bound ) { sqlite3_clear_bindings ( handle ) ; } return ; } ( ( void ) 0 ) ;
927
928
int status = sqlite3_step (handle);
@@ -936,9 +937,9 @@ void Statement::JS_get (v8::FunctionCallbackInfo <v8 :: Value> const & info)
936
937
sqlite3_reset (handle);
937
938
db -> GetState ( ) -> busy = false ; db -> ThrowDatabaseError ( ) ; if ( ! bound ) { sqlite3_clear_bindings ( handle ) ; } return ;
938
939
}
939
- #line 190 "./src/objects/statement.lzz"
940
+ #line 191 "./src/objects/statement.lzz"
940
941
void Statement::JS_all (v8::FunctionCallbackInfo <v8 :: Value> const & info)
941
- #line 190 "./src/objects/statement.lzz"
942
+ #line 191 "./src/objects/statement.lzz"
942
943
{
943
944
Statement * stmt = node :: ObjectWrap :: Unwrap < Statement > ( info . This ( ) ) ; if ( ! stmt -> returns_data ) return ThrowTypeError ( "This statement does not return data. Use run() instead" ) ; sqlite3_stmt * handle = stmt -> handle ; Database * db = stmt -> db ; if ( ! db -> GetState ( ) -> open ) return ThrowTypeError ( "The database connection is not open" ) ; if ( db -> GetState ( ) -> busy ) return ThrowTypeError ( "This database connection is busy executing a query" ) ; if ( stmt -> locked ) return ThrowTypeError ( "This statement is busy executing a query" ) ; const bool bound = stmt -> bound ; if ( ! bound ) { Binder binder ( handle ) ; if ( ! binder . Bind ( info , info . Length ( ) , stmt ) ) { sqlite3_clear_bindings ( handle ) ; return ; } ( ( void ) 0 ) ; } else if ( info . Length ( ) > 0 ) { return ThrowTypeError ( "This statement already has bound parameters" ) ; } ( ( void ) 0 ) ; db -> GetState ( ) -> busy = true ; v8 :: Isolate * isolate = info . GetIsolate ( ) ; if ( db -> Log ( isolate , handle ) ) { db -> GetState ( ) -> busy = false ; db -> ThrowDatabaseError ( ) ; if ( ! bound ) { sqlite3_clear_bindings ( handle ) ; } return ; } ( ( void ) 0 ) ;
944
945
v8 :: Local < v8 :: Context > ctx = isolate -> GetCurrentContext ( ) ;
@@ -959,9 +960,9 @@ void Statement::JS_all (v8::FunctionCallbackInfo <v8 :: Value> const & info)
959
960
if (js_error) db->GetState ()->was_js_error = true ;
960
961
db -> GetState ( ) -> busy = false ; db -> ThrowDatabaseError ( ) ; if ( ! bound ) { sqlite3_clear_bindings ( handle ) ; } return ;
961
962
}
962
- #line 211 "./src/objects/statement.lzz"
963
+ #line 212 "./src/objects/statement.lzz"
963
964
void Statement::JS_iterate (v8::FunctionCallbackInfo <v8 :: Value> const & info)
964
- #line 211 "./src/objects/statement.lzz"
965
+ #line 212 "./src/objects/statement.lzz"
965
966
{
966
967
Addon * addon = static_cast < Addon * > ( info . Data ( ) . As < v8 :: External > ( ) -> Value ( ) ) ;
967
968
v8 :: Isolate * isolate = info . GetIsolate ( ) ;
@@ -971,9 +972,9 @@ void Statement::JS_iterate (v8::FunctionCallbackInfo <v8 :: Value> const & info)
971
972
addon->privileged_info = NULL ;
972
973
if (!maybeIterator.IsEmpty ()) info.GetReturnValue ().Set (maybeIterator.ToLocalChecked ());
973
974
}
974
- #line 221 "./src/objects/statement.lzz"
975
+ #line 222 "./src/objects/statement.lzz"
975
976
void Statement::JS_bind (v8::FunctionCallbackInfo <v8 :: Value> const & info)
976
- #line 221 "./src/objects/statement.lzz"
977
+ #line 222 "./src/objects/statement.lzz"
977
978
{
978
979
Statement* stmt = node :: ObjectWrap :: Unwrap <Statement>(info.This ());
979
980
if (stmt->bound ) return ThrowTypeError (" The bind() method can only be invoked once per statement object" );
@@ -984,9 +985,9 @@ void Statement::JS_bind (v8::FunctionCallbackInfo <v8 :: Value> const & info)
984
985
stmt->bound = true ;
985
986
info.GetReturnValue ().Set (info.This ());
986
987
}
987
- #line 232 "./src/objects/statement.lzz"
988
+ #line 233 "./src/objects/statement.lzz"
988
989
void Statement::JS_pluck (v8::FunctionCallbackInfo <v8 :: Value> const & info)
989
- #line 232 "./src/objects/statement.lzz"
990
+ #line 233 "./src/objects/statement.lzz"
990
991
{
991
992
Statement* stmt = node :: ObjectWrap :: Unwrap <Statement>(info.This ());
992
993
if (!stmt->returns_data ) return ThrowTypeError (" The pluck() method is only for statements that return data" );
@@ -997,9 +998,9 @@ void Statement::JS_pluck (v8::FunctionCallbackInfo <v8 :: Value> const & info)
997
998
stmt->mode = use ? Data::PLUCK : stmt->mode == Data::PLUCK ? Data::FLAT : stmt->mode ;
998
999
info.GetReturnValue ().Set (info.This ());
999
1000
}
1000
- #line 243 "./src/objects/statement.lzz"
1001
+ #line 244 "./src/objects/statement.lzz"
1001
1002
void Statement::JS_expand (v8::FunctionCallbackInfo <v8 :: Value> const & info)
1002
- #line 243 "./src/objects/statement.lzz"
1003
+ #line 244 "./src/objects/statement.lzz"
1003
1004
{
1004
1005
Statement* stmt = node :: ObjectWrap :: Unwrap <Statement>(info.This ());
1005
1006
if (!stmt->returns_data ) return ThrowTypeError (" The expand() method is only for statements that return data" );
@@ -1010,9 +1011,9 @@ void Statement::JS_expand (v8::FunctionCallbackInfo <v8 :: Value> const & info)
1010
1011
stmt->mode = use ? Data::EXPAND : stmt->mode == Data::EXPAND ? Data::FLAT : stmt->mode ;
1011
1012
info.GetReturnValue ().Set (info.This ());
1012
1013
}
1013
- #line 254 "./src/objects/statement.lzz"
1014
+ #line 255 "./src/objects/statement.lzz"
1014
1015
void Statement::JS_raw (v8::FunctionCallbackInfo <v8 :: Value> const & info)
1015
- #line 254 "./src/objects/statement.lzz"
1016
+ #line 255 "./src/objects/statement.lzz"
1016
1017
{
1017
1018
Statement* stmt = node :: ObjectWrap :: Unwrap <Statement>(info.This ());
1018
1019
if (!stmt->returns_data ) return ThrowTypeError (" The raw() method is only for statements that return data" );
@@ -1023,9 +1024,9 @@ void Statement::JS_raw (v8::FunctionCallbackInfo <v8 :: Value> const & info)
1023
1024
stmt->mode = use ? Data::RAW : stmt->mode == Data::RAW ? Data::FLAT : stmt->mode ;
1024
1025
info.GetReturnValue ().Set (info.This ());
1025
1026
}
1026
- #line 265 "./src/objects/statement.lzz"
1027
+ #line 266 "./src/objects/statement.lzz"
1027
1028
void Statement::JS_safeIntegers (v8::FunctionCallbackInfo <v8 :: Value> const & info)
1028
- #line 265 "./src/objects/statement.lzz"
1029
+ #line 266 "./src/objects/statement.lzz"
1029
1030
{
1030
1031
Statement* stmt = node :: ObjectWrap :: Unwrap <Statement>(info.This ());
1031
1032
if ( stmt -> db -> GetState ( ) -> busy ) return ThrowTypeError ( " This database connection is busy executing a query" ) ;
@@ -1034,9 +1035,9 @@ void Statement::JS_safeIntegers (v8::FunctionCallbackInfo <v8 :: Value> const &
1034
1035
else { if ( info . Length ( ) <= ( 0 ) || ! info [ 0 ] -> IsBoolean ( ) ) return ThrowTypeError ( " Expected " " first" " argument to be " " a boolean" ) ; stmt -> safe_ints = ( info [ 0 ] . As < v8 :: Boolean > ( ) ) -> Value ( ) ; }
1035
1036
info.GetReturnValue ().Set (info.This ());
1036
1037
}
1037
- #line 274 "./src/objects/statement.lzz"
1038
+ #line 275 "./src/objects/statement.lzz"
1038
1039
void Statement::JS_columns (v8::FunctionCallbackInfo <v8 :: Value> const & info)
1039
- #line 274 "./src/objects/statement.lzz"
1040
+ #line 275 "./src/objects/statement.lzz"
1040
1041
{
1041
1042
Statement* stmt = node :: ObjectWrap :: Unwrap <Statement>(info.This ());
1042
1043
if (!stmt->returns_data ) return ThrowTypeError (" The columns() method is only for statements that return data" );
@@ -1079,9 +1080,9 @@ void Statement::JS_columns (v8::FunctionCallbackInfo <v8 :: Value> const & info)
1079
1080
1080
1081
info.GetReturnValue ().Set (columns);
1081
1082
}
1082
- #line 317 "./src/objects/statement.lzz"
1083
+ #line 318 "./src/objects/statement.lzz"
1083
1084
void Statement::JS_busy (v8::Local <v8 :: String> _, v8::PropertyCallbackInfo <v8 :: Value> const & info)
1084
- #line 317 "./src/objects/statement.lzz"
1085
+ #line 318 "./src/objects/statement.lzz"
1085
1086
{
1086
1087
Statement* stmt = node :: ObjectWrap :: Unwrap <Statement>(info.This ());
1087
1088
info.GetReturnValue ().Set (stmt->alive && stmt->locked );
0 commit comments