@@ -869,14 +869,17 @@ void Statement::JS_new (v8::FunctionCallbackInfo <v8 :: Value> const & info)
869
869
tail += 2 ;
870
870
for (char c; (c = *tail); ++tail) {
871
871
if (c == ' *' && tail[1 ] == ' /' ) {
872
- tail += 1 ;
872
+ tail += 2 ;
873
873
break ;
874
874
}
875
875
}
876
876
} else if (c == ' -' && tail[1 ] == ' -' ) {
877
877
tail += 2 ;
878
878
for (char c; (c = *tail); ++tail) {
879
- if (c == ' \n ' ) break ;
879
+ if (c == ' \n ' ) {
880
+ ++tail;
881
+ break ;
882
+ }
880
883
}
881
884
} else {
882
885
sqlite3_finalize (handle);
@@ -895,9 +898,9 @@ void Statement::JS_new (v8::FunctionCallbackInfo <v8 :: Value> const & info)
895
898
896
899
info.GetReturnValue ().Set (info.This ());
897
900
}
898
- #line 153 "./src/objects/statement.lzz"
901
+ #line 156 "./src/objects/statement.lzz"
899
902
void Statement::JS_run (v8::FunctionCallbackInfo <v8 :: Value> const & info)
900
- #line 153 "./src/objects/statement.lzz"
903
+ #line 156 "./src/objects/statement.lzz"
901
904
{
902
905
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 ) ;
903
906
sqlite3* db_handle = db->GetHandle ();
@@ -920,9 +923,9 @@ void Statement::JS_run (v8::FunctionCallbackInfo <v8 :: Value> const & info)
920
923
}
921
924
db -> GetState ( ) -> busy = false ; db -> ThrowDatabaseError ( ) ; if ( ! bound ) { sqlite3_clear_bindings ( handle ) ; } return ;
922
925
}
923
- #line 176 "./src/objects/statement.lzz"
926
+ #line 179 "./src/objects/statement.lzz"
924
927
void Statement::JS_get (v8::FunctionCallbackInfo <v8 :: Value> const & info)
925
- #line 176 "./src/objects/statement.lzz"
928
+ #line 179 "./src/objects/statement.lzz"
926
929
{
927
930
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 ) ;
928
931
int status = sqlite3_step (handle);
@@ -937,9 +940,9 @@ void Statement::JS_get (v8::FunctionCallbackInfo <v8 :: Value> const & info)
937
940
sqlite3_reset (handle);
938
941
db -> GetState ( ) -> busy = false ; db -> ThrowDatabaseError ( ) ; if ( ! bound ) { sqlite3_clear_bindings ( handle ) ; } return ;
939
942
}
940
- #line 191 "./src/objects/statement.lzz"
943
+ #line 194 "./src/objects/statement.lzz"
941
944
void Statement::JS_all (v8::FunctionCallbackInfo <v8 :: Value> const & info)
942
- #line 191 "./src/objects/statement.lzz"
945
+ #line 194 "./src/objects/statement.lzz"
943
946
{
944
947
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 ) ;
945
948
v8 :: Local < v8 :: Context > ctx = isolate -> GetCurrentContext ( ) ;
@@ -960,9 +963,9 @@ void Statement::JS_all (v8::FunctionCallbackInfo <v8 :: Value> const & info)
960
963
if (js_error) db->GetState ()->was_js_error = true ;
961
964
db -> GetState ( ) -> busy = false ; db -> ThrowDatabaseError ( ) ; if ( ! bound ) { sqlite3_clear_bindings ( handle ) ; } return ;
962
965
}
963
- #line 212 "./src/objects/statement.lzz"
966
+ #line 215 "./src/objects/statement.lzz"
964
967
void Statement::JS_iterate (v8::FunctionCallbackInfo <v8 :: Value> const & info)
965
- #line 212 "./src/objects/statement.lzz"
968
+ #line 215 "./src/objects/statement.lzz"
966
969
{
967
970
Addon * addon = static_cast < Addon * > ( info . Data ( ) . As < v8 :: External > ( ) -> Value ( ) ) ;
968
971
v8 :: Isolate * isolate = info . GetIsolate ( ) ;
@@ -972,9 +975,9 @@ void Statement::JS_iterate (v8::FunctionCallbackInfo <v8 :: Value> const & info)
972
975
addon->privileged_info = NULL ;
973
976
if (!maybeIterator.IsEmpty ()) info.GetReturnValue ().Set (maybeIterator.ToLocalChecked ());
974
977
}
975
- #line 222 "./src/objects/statement.lzz"
978
+ #line 225 "./src/objects/statement.lzz"
976
979
void Statement::JS_bind (v8::FunctionCallbackInfo <v8 :: Value> const & info)
977
- #line 222 "./src/objects/statement.lzz"
980
+ #line 225 "./src/objects/statement.lzz"
978
981
{
979
982
Statement* stmt = node :: ObjectWrap :: Unwrap <Statement>(info.This ());
980
983
if (stmt->bound ) return ThrowTypeError (" The bind() method can only be invoked once per statement object" );
@@ -985,9 +988,9 @@ void Statement::JS_bind (v8::FunctionCallbackInfo <v8 :: Value> const & info)
985
988
stmt->bound = true ;
986
989
info.GetReturnValue ().Set (info.This ());
987
990
}
988
- #line 233 "./src/objects/statement.lzz"
991
+ #line 236 "./src/objects/statement.lzz"
989
992
void Statement::JS_pluck (v8::FunctionCallbackInfo <v8 :: Value> const & info)
990
- #line 233 "./src/objects/statement.lzz"
993
+ #line 236 "./src/objects/statement.lzz"
991
994
{
992
995
Statement* stmt = node :: ObjectWrap :: Unwrap <Statement>(info.This ());
993
996
if (!stmt->returns_data ) return ThrowTypeError (" The pluck() method is only for statements that return data" );
@@ -998,9 +1001,9 @@ void Statement::JS_pluck (v8::FunctionCallbackInfo <v8 :: Value> const & info)
998
1001
stmt->mode = use ? Data::PLUCK : stmt->mode == Data::PLUCK ? Data::FLAT : stmt->mode ;
999
1002
info.GetReturnValue ().Set (info.This ());
1000
1003
}
1001
- #line 244 "./src/objects/statement.lzz"
1004
+ #line 247 "./src/objects/statement.lzz"
1002
1005
void Statement::JS_expand (v8::FunctionCallbackInfo <v8 :: Value> const & info)
1003
- #line 244 "./src/objects/statement.lzz"
1006
+ #line 247 "./src/objects/statement.lzz"
1004
1007
{
1005
1008
Statement* stmt = node :: ObjectWrap :: Unwrap <Statement>(info.This ());
1006
1009
if (!stmt->returns_data ) return ThrowTypeError (" The expand() method is only for statements that return data" );
@@ -1011,9 +1014,9 @@ void Statement::JS_expand (v8::FunctionCallbackInfo <v8 :: Value> const & info)
1011
1014
stmt->mode = use ? Data::EXPAND : stmt->mode == Data::EXPAND ? Data::FLAT : stmt->mode ;
1012
1015
info.GetReturnValue ().Set (info.This ());
1013
1016
}
1014
- #line 255 "./src/objects/statement.lzz"
1017
+ #line 258 "./src/objects/statement.lzz"
1015
1018
void Statement::JS_raw (v8::FunctionCallbackInfo <v8 :: Value> const & info)
1016
- #line 255 "./src/objects/statement.lzz"
1019
+ #line 258 "./src/objects/statement.lzz"
1017
1020
{
1018
1021
Statement* stmt = node :: ObjectWrap :: Unwrap <Statement>(info.This ());
1019
1022
if (!stmt->returns_data ) return ThrowTypeError (" The raw() method is only for statements that return data" );
@@ -1024,9 +1027,9 @@ void Statement::JS_raw (v8::FunctionCallbackInfo <v8 :: Value> const & info)
1024
1027
stmt->mode = use ? Data::RAW : stmt->mode == Data::RAW ? Data::FLAT : stmt->mode ;
1025
1028
info.GetReturnValue ().Set (info.This ());
1026
1029
}
1027
- #line 266 "./src/objects/statement.lzz"
1030
+ #line 269 "./src/objects/statement.lzz"
1028
1031
void Statement::JS_safeIntegers (v8::FunctionCallbackInfo <v8 :: Value> const & info)
1029
- #line 266 "./src/objects/statement.lzz"
1032
+ #line 269 "./src/objects/statement.lzz"
1030
1033
{
1031
1034
Statement* stmt = node :: ObjectWrap :: Unwrap <Statement>(info.This ());
1032
1035
if ( stmt -> db -> GetState ( ) -> busy ) return ThrowTypeError ( " This database connection is busy executing a query" ) ;
@@ -1035,9 +1038,9 @@ void Statement::JS_safeIntegers (v8::FunctionCallbackInfo <v8 :: Value> const &
1035
1038
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 ( ) ; }
1036
1039
info.GetReturnValue ().Set (info.This ());
1037
1040
}
1038
- #line 275 "./src/objects/statement.lzz"
1041
+ #line 278 "./src/objects/statement.lzz"
1039
1042
void Statement::JS_columns (v8::FunctionCallbackInfo <v8 :: Value> const & info)
1040
- #line 275 "./src/objects/statement.lzz"
1043
+ #line 278 "./src/objects/statement.lzz"
1041
1044
{
1042
1045
Statement* stmt = node :: ObjectWrap :: Unwrap <Statement>(info.This ());
1043
1046
if (!stmt->returns_data ) return ThrowTypeError (" The columns() method is only for statements that return data" );
@@ -1080,9 +1083,9 @@ void Statement::JS_columns (v8::FunctionCallbackInfo <v8 :: Value> const & info)
1080
1083
1081
1084
info.GetReturnValue ().Set (columns);
1082
1085
}
1083
- #line 318 "./src/objects/statement.lzz"
1086
+ #line 321 "./src/objects/statement.lzz"
1084
1087
void Statement::JS_busy (v8::Local <v8 :: String> _, v8::PropertyCallbackInfo <v8 :: Value> const & info)
1085
- #line 318 "./src/objects/statement.lzz"
1088
+ #line 321 "./src/objects/statement.lzz"
1086
1089
{
1087
1090
Statement* stmt = node :: ObjectWrap :: Unwrap <Statement>(info.This ());
1088
1091
info.GetReturnValue ().Set (stmt->alive && stmt->locked );
0 commit comments