@@ -35,7 +35,7 @@ bool invalidated = false;
35
35
void clearState () {
36
36
invalidated = true ;
37
37
// Will terminate all operations and database connections
38
- sqliteCloseAll ();
38
+ sqlite_close_all ();
39
39
// We then join all the threads before the context gets invalidated
40
40
pool.restartPool ();
41
41
@@ -81,7 +81,7 @@ void install(jsi::Runtime &rt,
81
81
}
82
82
}
83
83
84
- BridgeResult result = sqliteOpenDb (dbName, path);
84
+ BridgeResult result = sqlite_open (dbName, path);
85
85
86
86
if (result.type == SQLiteError) {
87
87
throw std::runtime_error (result.message );
@@ -115,7 +115,7 @@ void install(jsi::Runtime &rt,
115
115
std::string databaseToAttach = args[1 ].asString (rt).utf8 (rt);
116
116
std::string alias = args[2 ].asString (rt).utf8 (rt);
117
117
BridgeResult result =
118
- sqliteAttachDb (dbName, tempDocPath, databaseToAttach, alias);
118
+ sqlite_attach (dbName, tempDocPath, databaseToAttach, alias);
119
119
120
120
if (result.type == SQLiteError) {
121
121
throw std::runtime_error (result.message );
@@ -137,7 +137,7 @@ void install(jsi::Runtime &rt,
137
137
138
138
std::string dbName = args[0 ].asString (rt).utf8 (rt);
139
139
std::string alias = args[1 ].asString (rt).utf8 (rt);
140
- BridgeResult result = sqliteDetachDb (dbName, alias);
140
+ BridgeResult result = sqlite_detach (dbName, alias);
141
141
142
142
if (result.type == SQLiteError) {
143
143
throw jsi::JSError (rt, result.message .c_str ());
@@ -158,7 +158,7 @@ void install(jsi::Runtime &rt,
158
158
159
159
std::string dbName = args[0 ].asString (rt).utf8 (rt);
160
160
161
- BridgeResult result = sqliteCloseDb (dbName);
161
+ BridgeResult result = sqlite_close (dbName);
162
162
163
163
if (result.type == SQLiteError) {
164
164
throw jsi::JSError (rt, result.message .c_str ());
@@ -190,7 +190,7 @@ void install(jsi::Runtime &rt,
190
190
tempDocPath = tempDocPath + " /" + args[1 ].asString (rt).utf8 (rt);
191
191
}
192
192
193
- BridgeResult result = sqliteRemoveDb (dbName, tempDocPath);
193
+ BridgeResult result = sqlite_remove (dbName, tempDocPath);
194
194
195
195
if (result.type == SQLiteError) {
196
196
throw std::runtime_error (result.message );
@@ -213,7 +213,7 @@ void install(jsi::Runtime &rt,
213
213
std::shared_ptr<std::vector<SmartHostObject>> metadata =
214
214
std::make_shared<std::vector<SmartHostObject>>();
215
215
216
- auto status = sqliteExecute (dbName, query, ¶ms, &results, metadata);
216
+ auto status = sqlite_execute (dbName, query, ¶ms, &results, metadata);
217
217
218
218
if (status.type == SQLiteError) {
219
219
throw std::runtime_error (status.message );
@@ -249,7 +249,7 @@ void install(jsi::Runtime &rt,
249
249
std::make_shared<std::vector<SmartHostObject>>();
250
250
251
251
auto status =
252
- sqliteExecute (dbName, query, ¶ms, &results, metadata);
252
+ sqlite_execute (dbName, query, ¶ms, &results, metadata);
253
253
254
254
if (invalidated) {
255
255
return ;
@@ -432,7 +432,7 @@ void install(jsi::Runtime &rt,
432
432
auto callback = std::make_shared<jsi::Value>(rt, args[1 ]);
433
433
434
434
if (callback->isUndefined () || callback->isNull ()) {
435
- unregisterUpdateHook (dbName);
435
+ sqlite_deregister_update_hook (dbName);
436
436
return {};
437
437
}
438
438
@@ -449,7 +449,7 @@ void install(jsi::Runtime &rt,
449
449
if (operation != " DELETE" ) {
450
450
std::string query = " SELECT * FROM " + tableName +
451
451
" where rowid = " + std::to_string (rowId) + " ;" ;
452
- sqliteExecute (dbName, query, ¶ms, &results, metadata);
452
+ sqlite_execute (dbName, query, ¶ms, &results, metadata);
453
453
}
454
454
455
455
invoker->invokeAsync (
@@ -474,7 +474,7 @@ void install(jsi::Runtime &rt,
474
474
});
475
475
};
476
476
477
- registerUpdateHook (dbName, std::move (hook));
477
+ sqlite_register_update_hook (dbName, std::move (hook));
478
478
479
479
return {};
480
480
});
@@ -490,7 +490,7 @@ void install(jsi::Runtime &rt,
490
490
auto dbName = args[0 ].asString (rt).utf8 (rt);
491
491
auto callback = std::make_shared<jsi::Value>(rt, args[1 ]);
492
492
if (callback->isUndefined () || callback->isNull ()) {
493
- unregisterCommitHook (dbName);
493
+ sqlite_deregister_commit_hook (dbName);
494
494
return {};
495
495
}
496
496
commitHooks[dbName] = callback;
@@ -500,7 +500,7 @@ void install(jsi::Runtime &rt,
500
500
[&rt, callback] { callback->asObject (rt).asFunction (rt).call (rt); });
501
501
};
502
502
503
- registerCommitHook (dbName, std::move (hook));
503
+ sqlite_register_commit_hook (dbName, std::move (hook));
504
504
505
505
return {};
506
506
});
@@ -517,7 +517,7 @@ void install(jsi::Runtime &rt,
517
517
auto callback = std::make_shared<jsi::Value>(rt, args[1 ]);
518
518
519
519
if (callback->isUndefined () || callback->isNull ()) {
520
- unregisterRollbackHook (dbName);
520
+ sqlite_deregister_rollback_hook (dbName);
521
521
return {};
522
522
}
523
523
rollbackHooks[dbName] = callback;
@@ -527,7 +527,7 @@ void install(jsi::Runtime &rt,
527
527
[&rt, callback] { callback->asObject (rt).asFunction (rt).call (rt); });
528
528
};
529
529
530
- registerRollbackHook (dbName, std::move (hook));
530
+ sqlite_register_rollback_hook (dbName, std::move (hook));
531
531
return {};
532
532
});
533
533
0 commit comments