@op-engineering/op-sqlite 11.2.10 → 11.2.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cpp/bridge.cpp +8 -4
- package/cpp/libsql/bridge.cpp +34 -35
- package/cpp/utils.cpp +0 -8
- package/cpp/utils.h +0 -5
- package/lib/commonjs/index.js +72 -52
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/index.js +71 -51
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/index.d.ts +171 -32
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +259 -97
package/lib/module/index.js
CHANGED
|
@@ -1,32 +1,4 @@
|
|
|
1
1
|
import { NativeModules, Platform } from 'react-native';
|
|
2
|
-
if (global.__OPSQLiteProxy == null) {
|
|
3
|
-
if (NativeModules.OPSQLite == null) {
|
|
4
|
-
throw new Error('Base module not found. Maybe try rebuilding the app.');
|
|
5
|
-
}
|
|
6
|
-
if (NativeModules.OPSQLite.install == null) {
|
|
7
|
-
throw new Error('Failed to install op-sqlite: React Native is not running on-device. OPSQLite can only be used when synchronous method invocations (JSI) are possible. If you are using a remote debugger (e.g. Chrome), switch to an on-device debugger (e.g. Flipper) instead.');
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
// Call the synchronous blocking install() function
|
|
11
|
-
const result = NativeModules.OPSQLite.install();
|
|
12
|
-
if (result !== true) {
|
|
13
|
-
throw new Error(`Failed to install op-sqlite: The native OPSQLite Module could not be installed! Looks like something went wrong when installing JSI bindings, check the native logs for more info`);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
// Check again if the constructor now exists. If not, throw an error.
|
|
17
|
-
if (global.__OPSQLiteProxy == null) {
|
|
18
|
-
throw new Error('Failed to install op-sqlite, the native initializer function does not exist. Are you trying to use OPSQLite from different JS Runtimes?');
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
const proxy = global.__OPSQLiteProxy;
|
|
22
|
-
export const OPSQLite = proxy;
|
|
23
|
-
export const {
|
|
24
|
-
IOS_DOCUMENT_PATH,
|
|
25
|
-
IOS_LIBRARY_PATH,
|
|
26
|
-
ANDROID_DATABASE_PATH,
|
|
27
|
-
ANDROID_FILES_PATH,
|
|
28
|
-
ANDROID_EXTERNAL_FILES_PATH
|
|
29
|
-
} = !!NativeModules.OPSQLite.getConstants ? NativeModules.OPSQLite.getConstants() : NativeModules.OPSQLite;
|
|
30
2
|
|
|
31
3
|
/**
|
|
32
4
|
* Object returned by SQL Query executions {
|
|
@@ -62,7 +34,31 @@ export const {
|
|
|
62
34
|
* Similar to BatchQueryResult
|
|
63
35
|
*/
|
|
64
36
|
|
|
65
|
-
|
|
37
|
+
if (global.__OPSQLiteProxy == null) {
|
|
38
|
+
if (NativeModules.OPSQLite == null) {
|
|
39
|
+
throw new Error('Base module not found. Did you do a pod install/clear the gradle cache?');
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Call the synchronous blocking install() function
|
|
43
|
+
const installed = NativeModules.OPSQLite.install();
|
|
44
|
+
if (!installed) {
|
|
45
|
+
throw new Error(`Failed to install op-sqlite: The native OPSQLite Module could not be installed! Looks like something went wrong when installing JSI bindings, check the native logs for more info`);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Check again if the constructor now exists. If not, throw an error.
|
|
49
|
+
if (global.__OPSQLiteProxy == null) {
|
|
50
|
+
throw new Error('OPSqlite native object is not available. Something is wrong. Check the native logs for more information.');
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
const proxy = global.__OPSQLiteProxy;
|
|
54
|
+
export const OPSQLite = proxy;
|
|
55
|
+
export const {
|
|
56
|
+
IOS_DOCUMENT_PATH,
|
|
57
|
+
IOS_LIBRARY_PATH,
|
|
58
|
+
ANDROID_DATABASE_PATH,
|
|
59
|
+
ANDROID_FILES_PATH,
|
|
60
|
+
ANDROID_EXTERNAL_FILES_PATH
|
|
61
|
+
} = !!NativeModules.OPSQLite.getConstants ? NativeModules.OPSQLite.getConstants() : NativeModules.OPSQLite;
|
|
66
62
|
function enhanceDB(db, options) {
|
|
67
63
|
const lock = {
|
|
68
64
|
queue: [],
|
|
@@ -85,7 +81,8 @@ function enhanceDB(db, options) {
|
|
|
85
81
|
}
|
|
86
82
|
};
|
|
87
83
|
|
|
88
|
-
// spreading the object
|
|
84
|
+
// spreading the object does not work with HostObjects (db)
|
|
85
|
+
// We need to manually assign the fields
|
|
89
86
|
let enhancedDb = {
|
|
90
87
|
delete: db.delete,
|
|
91
88
|
attach: db.attach,
|
|
@@ -100,11 +97,7 @@ function enhanceDB(db, options) {
|
|
|
100
97
|
getDbPath: db.getDbPath,
|
|
101
98
|
reactiveExecute: db.reactiveExecute,
|
|
102
99
|
sync: db.sync,
|
|
103
|
-
|
|
104
|
-
close: () => {
|
|
105
|
-
db.close();
|
|
106
|
-
delete locks[options.url];
|
|
107
|
-
},
|
|
100
|
+
close: db.close,
|
|
108
101
|
executeWithHostObjects: async (query, params) => {
|
|
109
102
|
const sanitizedParams = params?.map(p => {
|
|
110
103
|
if (ArrayBuffer.isView(p)) {
|
|
@@ -185,22 +178,22 @@ function enhanceDB(db, options) {
|
|
|
185
178
|
let isFinalized = false;
|
|
186
179
|
const execute = async (query, params) => {
|
|
187
180
|
if (isFinalized) {
|
|
188
|
-
throw Error(`OP-Sqlite Error: Database: ${options.url}. Cannot execute query on finalized transaction`);
|
|
181
|
+
throw Error(`OP-Sqlite Error: Database: ${options.name || options.url}. Cannot execute query on finalized transaction`);
|
|
189
182
|
}
|
|
190
183
|
return await enhancedDb.execute(query, params);
|
|
191
184
|
};
|
|
192
185
|
const commit = async () => {
|
|
193
186
|
if (isFinalized) {
|
|
194
|
-
throw Error(`OP-Sqlite Error: Database: ${options.url}. Cannot execute query on finalized transaction`);
|
|
187
|
+
throw Error(`OP-Sqlite Error: Database: ${options.name || options.url}. Cannot execute query on finalized transaction`);
|
|
195
188
|
}
|
|
196
189
|
const result = await enhancedDb.execute('COMMIT;');
|
|
197
|
-
await
|
|
190
|
+
await db.flushPendingReactiveQueries();
|
|
198
191
|
isFinalized = true;
|
|
199
192
|
return result;
|
|
200
193
|
};
|
|
201
194
|
const rollback = async () => {
|
|
202
195
|
if (isFinalized) {
|
|
203
|
-
throw Error(`OP-Sqlite Error: Database: ${options.url}. Cannot execute query on finalized transaction`);
|
|
196
|
+
throw Error(`OP-Sqlite Error: Database: ${options.name || options.url}. Cannot execute query on finalized transaction`);
|
|
204
197
|
}
|
|
205
198
|
const result = await enhancedDb.execute('ROLLBACK;');
|
|
206
199
|
isFinalized = true;
|
|
@@ -218,7 +211,6 @@ function enhanceDB(db, options) {
|
|
|
218
211
|
await commit();
|
|
219
212
|
}
|
|
220
213
|
} catch (executionError) {
|
|
221
|
-
// console.warn('transaction error', executionError);
|
|
222
214
|
if (!isFinalized) {
|
|
223
215
|
try {
|
|
224
216
|
await rollback();
|
|
@@ -247,37 +239,65 @@ function enhanceDB(db, options) {
|
|
|
247
239
|
return enhancedDb;
|
|
248
240
|
}
|
|
249
241
|
|
|
250
|
-
/**
|
|
242
|
+
/**
|
|
243
|
+
* Open a replicating connection via libsql to a turso db
|
|
251
244
|
* libsql needs to be enabled on your package.json
|
|
252
245
|
*/
|
|
253
|
-
export const openSync =
|
|
246
|
+
export const openSync = params => {
|
|
254
247
|
if (!isLibsql()) {
|
|
255
248
|
throw new Error('This function is only available for libsql');
|
|
256
249
|
}
|
|
257
|
-
const db = OPSQLite.openSync(
|
|
258
|
-
const enhancedDb = enhanceDB(db,
|
|
250
|
+
const db = OPSQLite.openSync(params);
|
|
251
|
+
const enhancedDb = enhanceDB(db, params);
|
|
259
252
|
return enhancedDb;
|
|
260
253
|
};
|
|
261
254
|
|
|
262
|
-
/**
|
|
255
|
+
/**
|
|
256
|
+
* Open a remote connection via libsql to a turso db
|
|
263
257
|
* libsql needs to be enabled on your package.json
|
|
264
258
|
*/
|
|
265
|
-
export const openRemote =
|
|
259
|
+
export const openRemote = params => {
|
|
266
260
|
if (!isLibsql()) {
|
|
267
261
|
throw new Error('This function is only available for libsql');
|
|
268
262
|
}
|
|
269
|
-
const db = OPSQLite.openRemote(
|
|
270
|
-
const enhancedDb = enhanceDB(db,
|
|
263
|
+
const db = OPSQLite.openRemote(params);
|
|
264
|
+
const enhancedDb = enhanceDB(db, params);
|
|
271
265
|
return enhancedDb;
|
|
272
266
|
};
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* Open a connection to a local sqlite or sqlcipher database
|
|
270
|
+
* If you want libsql remote or sync connections, use openSync or openRemote
|
|
271
|
+
*/
|
|
272
|
+
export const open = params => {
|
|
273
|
+
if (params.location?.startsWith('file://')) {
|
|
274
|
+
console.warn("[op-sqlite] You are passing a path with 'file://' prefix, it's automatically removed");
|
|
275
|
+
params.location = params.location.substring(7);
|
|
276
|
+
}
|
|
277
|
+
const db = OPSQLite.open(params);
|
|
278
|
+
const enhancedDb = enhanceDB(db, params);
|
|
276
279
|
return enhancedDb;
|
|
277
280
|
};
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* Moves the database from the assets folder to the default path (check the docs) or to a custom path
|
|
284
|
+
* It DOES NOT OVERWRITE the database if it already exists in the destination path
|
|
285
|
+
* if you want to overwrite the database, you need to pass the overwrite flag as true
|
|
286
|
+
* @param args object with the parameters for the operaiton
|
|
287
|
+
* @returns promise, rejects if failed to move the database, resolves if the operation was successful
|
|
288
|
+
*/
|
|
278
289
|
export const moveAssetsDatabase = async args => {
|
|
279
290
|
return NativeModules.OPSQLite.moveAssetsDatabase(args);
|
|
280
291
|
};
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* Used to load a dylib file that contains a sqlite 3 extension/plugin
|
|
295
|
+
* It returns the raw path to the actual file which then needs to be passed to the loadExtension function
|
|
296
|
+
* Check the docs for more information
|
|
297
|
+
* @param bundle the iOS bundle identifier of the .framework
|
|
298
|
+
* @param name the file name of the dylib file
|
|
299
|
+
* @returns
|
|
300
|
+
*/
|
|
281
301
|
export const getDylibPath = (bundle, name) => {
|
|
282
302
|
return NativeModules.OPSQLite.getDylibPath(bundle, name);
|
|
283
303
|
};
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NativeModules","Platform","global","__OPSQLiteProxy","OPSQLite","Error","
|
|
1
|
+
{"version":3,"names":["NativeModules","Platform","global","__OPSQLiteProxy","OPSQLite","Error","installed","install","proxy","IOS_DOCUMENT_PATH","IOS_LIBRARY_PATH","ANDROID_DATABASE_PATH","ANDROID_FILES_PATH","ANDROID_EXTERNAL_FILES_PATH","getConstants","enhanceDB","db","options","lock","queue","inProgress","startNextTransaction","length","tx","shift","setImmediate","start","enhancedDb","delete","attach","detach","executeBatch","loadFile","updateHook","commitHook","rollbackHook","loadExtension","executeRaw","getDbPath","reactiveExecute","sync","close","executeWithHostObjects","query","params","sanitizedParams","map","p","ArrayBuffer","isView","buffer","executeSync","intermediateResult","rows","i","rawRows","row","rawRow","j","columnNames","columnName","value","push","res","execute","prepareStatement","stmt","bind","transaction","fn","isFinalized","name","url","commit","result","flushPendingReactiveQueries","rollback","run","executionError","rollbackError","Promise","resolve","reject","then","catch","openSync","isLibsql","openRemote","open","location","startsWith","console","warn","substring","moveAssetsDatabase","args","getDylibPath","bundle","isSQLCipher","isIOSEmbeeded","OS","isIOSEmbedded"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":"AAAA,SAASA,aAAa,EAAEC,QAAQ,QAAQ,cAAc;;AAUtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAeA;AACA;AACA;AACA;;AAWA;AACA;AACA;AACA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;;AAKA;AACA;AACA;AACA;;AAmPA,IAAIC,MAAM,CAACC,eAAe,IAAI,IAAI,EAAE;EAClC,IAAIH,aAAa,CAACI,QAAQ,IAAI,IAAI,EAAE;IAClC,MAAM,I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;AACjC,CAAC","ignoreList":[]}
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
function nativeCallSyncHook(): unknown;
|
|
3
|
-
var __OPSQLiteProxy: object | undefined;
|
|
4
|
-
}
|
|
5
|
-
export declare const OPSQLite: OPSQLiteProxy;
|
|
6
|
-
export declare const IOS_DOCUMENT_PATH: any, IOS_LIBRARY_PATH: any, ANDROID_DATABASE_PATH: any, ANDROID_FILES_PATH: any, ANDROID_EXTERNAL_FILES_PATH: any;
|
|
7
|
-
type Scalar = string | number | boolean | null | ArrayBuffer | ArrayBufferView;
|
|
1
|
+
export type Scalar = string | number | boolean | null | ArrayBuffer | ArrayBufferView;
|
|
8
2
|
/**
|
|
9
3
|
* Object returned by SQL Query executions {
|
|
10
4
|
* insertId: Represent the auto-generated row id if applicable
|
|
@@ -60,31 +54,127 @@ export type BatchQueryResult = {
|
|
|
60
54
|
* Result of loading a file and executing every line as a SQL command
|
|
61
55
|
* Similar to BatchQueryResult
|
|
62
56
|
*/
|
|
63
|
-
export
|
|
57
|
+
export type FileLoadResult = BatchQueryResult & {
|
|
64
58
|
commands?: number;
|
|
65
|
-
}
|
|
66
|
-
export
|
|
59
|
+
};
|
|
60
|
+
export type Transaction = {
|
|
67
61
|
commit: () => Promise<QueryResult>;
|
|
68
62
|
execute: (query: string, params?: Scalar[]) => Promise<QueryResult>;
|
|
69
63
|
rollback: () => Promise<QueryResult>;
|
|
70
|
-
}
|
|
71
|
-
export
|
|
72
|
-
start: () => void;
|
|
73
|
-
}
|
|
74
|
-
export type PreparedStatementObj = {
|
|
64
|
+
};
|
|
65
|
+
export type PreparedStatement = {
|
|
75
66
|
bind: (params: any[]) => Promise<void>;
|
|
76
67
|
execute: () => Promise<QueryResult>;
|
|
77
68
|
};
|
|
69
|
+
type InternalDB = {
|
|
70
|
+
close: () => void;
|
|
71
|
+
delete: (location?: string) => void;
|
|
72
|
+
attach: (mainDbName: string, dbNameToAttach: string, alias: string, location?: string) => void;
|
|
73
|
+
detach: (mainDbName: string, alias: string) => void;
|
|
74
|
+
transaction: (fn: (tx: Transaction) => Promise<void>) => Promise<void>;
|
|
75
|
+
executeSync: (query: string, params?: Scalar[]) => QueryResult;
|
|
76
|
+
execute: (query: string, params?: Scalar[]) => Promise<QueryResult>;
|
|
77
|
+
executeWithHostObjects: (query: string, params?: Scalar[]) => Promise<QueryResult>;
|
|
78
|
+
executeBatch: (commands: SQLBatchTuple[]) => Promise<BatchQueryResult>;
|
|
79
|
+
loadFile: (location: string) => Promise<FileLoadResult>;
|
|
80
|
+
updateHook: (callback?: ((params: {
|
|
81
|
+
table: string;
|
|
82
|
+
operation: UpdateHookOperation;
|
|
83
|
+
row?: any;
|
|
84
|
+
rowId: number;
|
|
85
|
+
}) => void) | null) => void;
|
|
86
|
+
commitHook: (callback?: (() => void) | null) => void;
|
|
87
|
+
rollbackHook: (callback?: (() => void) | null) => void;
|
|
88
|
+
prepareStatement: (query: string) => PreparedStatement;
|
|
89
|
+
loadExtension: (path: string, entryPoint?: string) => void;
|
|
90
|
+
executeRaw: (query: string, params?: Scalar[]) => Promise<any[]>;
|
|
91
|
+
getDbPath: (location?: string) => string;
|
|
92
|
+
reactiveExecute: (params: {
|
|
93
|
+
query: string;
|
|
94
|
+
arguments: any[];
|
|
95
|
+
fireOn: {
|
|
96
|
+
table: string;
|
|
97
|
+
ids?: number[];
|
|
98
|
+
}[];
|
|
99
|
+
callback: (response: any) => void;
|
|
100
|
+
}) => () => void;
|
|
101
|
+
sync: () => void;
|
|
102
|
+
flushPendingReactiveQueries: () => Promise<void>;
|
|
103
|
+
};
|
|
78
104
|
export type DB = {
|
|
79
105
|
close: () => void;
|
|
80
106
|
delete: (location?: string) => void;
|
|
81
107
|
attach: (mainDbName: string, dbNameToAttach: string, alias: string, location?: string) => void;
|
|
82
108
|
detach: (mainDbName: string, alias: string) => void;
|
|
109
|
+
/**
|
|
110
|
+
* Wraps all the executions into a transaction. If an error is thrown it will rollback all of the changes
|
|
111
|
+
*
|
|
112
|
+
* You need to use this if you are using reactive queries for the queries to fire after the transaction is done
|
|
113
|
+
*/
|
|
83
114
|
transaction: (fn: (tx: Transaction) => Promise<void>) => Promise<void>;
|
|
115
|
+
/**
|
|
116
|
+
* Sync version of the execute function
|
|
117
|
+
* It will block the JS thread and therefore your UI and should be used with caution
|
|
118
|
+
*
|
|
119
|
+
* When writing your queries, you can use the ? character as a placeholder for parameters
|
|
120
|
+
* The parameters will be automatically escaped and sanitized
|
|
121
|
+
*
|
|
122
|
+
* Example:
|
|
123
|
+
* db.executeSync('SELECT * FROM table WHERE id = ?', [1]);
|
|
124
|
+
*
|
|
125
|
+
* If you are writing a query that doesn't require parameters, you can omit the second argument
|
|
126
|
+
*
|
|
127
|
+
* If you are writing to the database YOU SHOULD BE USING TRANSACTIONS!
|
|
128
|
+
* Transactions protect you from partial writes and ensure that your data is always in a consistent state
|
|
129
|
+
*
|
|
130
|
+
* @param query
|
|
131
|
+
* @param params
|
|
132
|
+
* @returns QueryResult
|
|
133
|
+
*/
|
|
84
134
|
executeSync: (query: string, params?: Scalar[]) => QueryResult;
|
|
135
|
+
/**
|
|
136
|
+
* Basic query execution function, it is async don't forget to await it
|
|
137
|
+
*
|
|
138
|
+
* When writing your queries, you can use the ? character as a placeholder for parameters
|
|
139
|
+
* The parameters will be automatically escaped and sanitized
|
|
140
|
+
*
|
|
141
|
+
* Example:
|
|
142
|
+
* await db.execute('SELECT * FROM table WHERE id = ?', [1]);
|
|
143
|
+
*
|
|
144
|
+
* If you are writing a query that doesn't require parameters, you can omit the second argument
|
|
145
|
+
*
|
|
146
|
+
* If you are writing to the database YOU SHOULD BE USING TRANSACTIONS!
|
|
147
|
+
* Transactions protect you from partial writes and ensure that your data is always in a consistent state
|
|
148
|
+
*
|
|
149
|
+
* If you need a large amount of queries ran as fast as possible you should be using `executeBatch`, `executeRaw`, `loadFile` or `executeWithHostObjects`
|
|
150
|
+
*
|
|
151
|
+
* @param query string of your SQL query
|
|
152
|
+
* @param params a list of parameters to bind to the query, if any
|
|
153
|
+
* @returns Promise<QueryResult> with the result of the query
|
|
154
|
+
*/
|
|
85
155
|
execute: (query: string, params?: Scalar[]) => Promise<QueryResult>;
|
|
156
|
+
/**
|
|
157
|
+
* Similar to the execute function but returns the response in HostObjects
|
|
158
|
+
* Read more about HostObjects in the documentation and their pitfalls
|
|
159
|
+
*
|
|
160
|
+
* Will be a lot faster than the normal execute functions when returning data but you will pay when accessing the fields
|
|
161
|
+
* as the conversion is done the moment you access any field
|
|
162
|
+
* @param query
|
|
163
|
+
* @param params
|
|
164
|
+
* @returns
|
|
165
|
+
*/
|
|
86
166
|
executeWithHostObjects: (query: string, params?: Scalar[]) => Promise<QueryResult>;
|
|
167
|
+
/**
|
|
168
|
+
* Executes all the queries in the params inside a single transaction
|
|
169
|
+
*
|
|
170
|
+
* It's faster than executing single queries as data is sent to the native side only once
|
|
171
|
+
* @param commands
|
|
172
|
+
* @returns Promise<BatchQueryResult>
|
|
173
|
+
*/
|
|
87
174
|
executeBatch: (commands: SQLBatchTuple[]) => Promise<BatchQueryResult>;
|
|
175
|
+
/**
|
|
176
|
+
* Loads a SQLite Dump from disk. It will be the fastest way to execute a large set of queries as no JS is involved
|
|
177
|
+
*/
|
|
88
178
|
loadFile: (location: string) => Promise<FileLoadResult>;
|
|
89
179
|
updateHook: (callback?: ((params: {
|
|
90
180
|
table: string;
|
|
@@ -94,10 +184,33 @@ export type DB = {
|
|
|
94
184
|
}) => void) | null) => void;
|
|
95
185
|
commitHook: (callback?: (() => void) | null) => void;
|
|
96
186
|
rollbackHook: (callback?: (() => void) | null) => void;
|
|
97
|
-
|
|
187
|
+
/**
|
|
188
|
+
* Constructs a prepared statement from the query string
|
|
189
|
+
* The statement can be re-bound with parameters and executed
|
|
190
|
+
* The performance gain is significant when the same query is executed multiple times, NOT when the query is executed (once)
|
|
191
|
+
* The cost lies in the preparation of the statement as it is compiled and optimized by the sqlite engine, the params can then rebound
|
|
192
|
+
* but the query itself is already optimized
|
|
193
|
+
*
|
|
194
|
+
* @param query string of your SQL query
|
|
195
|
+
* @returns Prepared statement object
|
|
196
|
+
*/
|
|
197
|
+
prepareStatement: (query: string) => PreparedStatement;
|
|
198
|
+
/**
|
|
199
|
+
* Loads a runtime loadable sqlite extension. Libsql and iOS embedded version do not support loading extensions
|
|
200
|
+
*/
|
|
98
201
|
loadExtension: (path: string, entryPoint?: string) => void;
|
|
202
|
+
/**
|
|
203
|
+
* Same as `execute` except the results are not returned in objects but rather in arrays with just the values and not the keys
|
|
204
|
+
* It will be faster since a lot of repeated work is skipped and only the values you care about are returned
|
|
205
|
+
*/
|
|
99
206
|
executeRaw: (query: string, params?: Scalar[]) => Promise<any[]>;
|
|
207
|
+
/**
|
|
208
|
+
* Get's the absolute path to the db file. Useful for debugging on local builds and for attaching the DB from users devices
|
|
209
|
+
*/
|
|
100
210
|
getDbPath: (location?: string) => string;
|
|
211
|
+
/**
|
|
212
|
+
* Reactive execution of queries when data is written to the database. Check the docs for how to use them.
|
|
213
|
+
*/
|
|
101
214
|
reactiveExecute: (params: {
|
|
102
215
|
query: string;
|
|
103
216
|
arguments: any[];
|
|
@@ -115,56 +228,82 @@ export type DB = {
|
|
|
115
228
|
* The database is hosted in turso
|
|
116
229
|
**/
|
|
117
230
|
sync: () => void;
|
|
118
|
-
flushPendingReactiveQueries: () => Promise<void>;
|
|
119
231
|
};
|
|
120
|
-
type
|
|
232
|
+
export type DBParams = {
|
|
233
|
+
url?: string;
|
|
234
|
+
authToken?: string;
|
|
235
|
+
name?: string;
|
|
236
|
+
location?: string;
|
|
237
|
+
syncInterval?: number;
|
|
238
|
+
};
|
|
239
|
+
export type OPSQLiteProxy = {
|
|
121
240
|
open: (options: {
|
|
122
241
|
name: string;
|
|
123
242
|
location?: string;
|
|
124
243
|
encryptionKey?: string;
|
|
125
|
-
}) =>
|
|
244
|
+
}) => InternalDB;
|
|
126
245
|
openRemote: (options: {
|
|
127
246
|
url: string;
|
|
128
247
|
authToken: string;
|
|
129
|
-
}) =>
|
|
130
|
-
openSync: (options:
|
|
131
|
-
url: string;
|
|
132
|
-
authToken: string;
|
|
133
|
-
name: string;
|
|
134
|
-
location?: string;
|
|
135
|
-
syncInterval?: number;
|
|
136
|
-
}) => DB;
|
|
248
|
+
}) => InternalDB;
|
|
249
|
+
openSync: (options: DBParams) => InternalDB;
|
|
137
250
|
isSQLCipher: () => boolean;
|
|
138
251
|
isLibsql: () => boolean;
|
|
139
252
|
isIOSEmbedded: () => boolean;
|
|
140
253
|
};
|
|
141
|
-
|
|
254
|
+
declare global {
|
|
255
|
+
var __OPSQLiteProxy: object | undefined;
|
|
256
|
+
}
|
|
257
|
+
export declare const OPSQLite: OPSQLiteProxy;
|
|
258
|
+
export declare const IOS_DOCUMENT_PATH: any, IOS_LIBRARY_PATH: any, ANDROID_DATABASE_PATH: any, ANDROID_FILES_PATH: any, ANDROID_EXTERNAL_FILES_PATH: any;
|
|
259
|
+
/**
|
|
260
|
+
* Open a replicating connection via libsql to a turso db
|
|
142
261
|
* libsql needs to be enabled on your package.json
|
|
143
262
|
*/
|
|
144
|
-
export declare const openSync: (
|
|
263
|
+
export declare const openSync: (params: {
|
|
145
264
|
url: string;
|
|
146
265
|
authToken: string;
|
|
147
266
|
name: string;
|
|
148
267
|
location?: string;
|
|
149
268
|
syncInterval?: number;
|
|
150
269
|
}) => DB;
|
|
151
|
-
/**
|
|
270
|
+
/**
|
|
271
|
+
* Open a remote connection via libsql to a turso db
|
|
152
272
|
* libsql needs to be enabled on your package.json
|
|
153
273
|
*/
|
|
154
|
-
export declare const openRemote: (
|
|
274
|
+
export declare const openRemote: (params: {
|
|
155
275
|
url: string;
|
|
156
276
|
authToken: string;
|
|
157
277
|
}) => DB;
|
|
158
|
-
|
|
278
|
+
/**
|
|
279
|
+
* Open a connection to a local sqlite or sqlcipher database
|
|
280
|
+
* If you want libsql remote or sync connections, use openSync or openRemote
|
|
281
|
+
*/
|
|
282
|
+
export declare const open: (params: {
|
|
159
283
|
name: string;
|
|
160
284
|
location?: string;
|
|
161
285
|
encryptionKey?: string;
|
|
162
286
|
}) => DB;
|
|
287
|
+
/**
|
|
288
|
+
* Moves the database from the assets folder to the default path (check the docs) or to a custom path
|
|
289
|
+
* It DOES NOT OVERWRITE the database if it already exists in the destination path
|
|
290
|
+
* if you want to overwrite the database, you need to pass the overwrite flag as true
|
|
291
|
+
* @param args object with the parameters for the operaiton
|
|
292
|
+
* @returns promise, rejects if failed to move the database, resolves if the operation was successful
|
|
293
|
+
*/
|
|
163
294
|
export declare const moveAssetsDatabase: (args: {
|
|
164
295
|
filename: string;
|
|
165
296
|
path?: string;
|
|
166
297
|
overwrite?: boolean;
|
|
167
298
|
}) => Promise<boolean>;
|
|
299
|
+
/**
|
|
300
|
+
* Used to load a dylib file that contains a sqlite 3 extension/plugin
|
|
301
|
+
* It returns the raw path to the actual file which then needs to be passed to the loadExtension function
|
|
302
|
+
* Check the docs for more information
|
|
303
|
+
* @param bundle the iOS bundle identifier of the .framework
|
|
304
|
+
* @param name the file name of the dylib file
|
|
305
|
+
* @returns
|
|
306
|
+
*/
|
|
168
307
|
export declare const getDylibPath: (bundle: string, name: string) => string;
|
|
169
308
|
export declare const isSQLCipher: () => boolean;
|
|
170
309
|
export declare const isLibsql: () => boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,MAAM,GACd,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,WAAW,GACX,eAAe,CAAC;AAEpB;;;;;;;;;GASG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC;IACZ,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