react-native-nitro-sqlite 9.2.2 → 9.4.0
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/android/CMakeLists.txt +1 -1
- package/cpp/NitroSQLiteException.hpp +1 -2
- package/cpp/{specs → hybridObjects}/HybridNitroSQLite.cpp +64 -16
- package/cpp/{specs → hybridObjects}/HybridNitroSQLite.hpp +6 -6
- package/cpp/hybridObjects/HybridNitroSQLiteQueryResult.cpp +93 -0
- package/cpp/hybridObjects/HybridNitroSQLiteQueryResult.hpp +47 -0
- package/cpp/operations.cpp +16 -12
- package/cpp/operations.hpp +3 -1
- package/cpp/sqliteExecuteBatch.cpp +2 -2
- package/cpp/sqliteExecuteBatch.hpp +2 -2
- package/cpp/types.hpp +4 -14
- package/ios/NitroSQLite.xcodeproj/project.pbxproj +2 -2
- package/lib/commonjs/index.js +0 -25
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/operations/execute.js +19 -32
- package/lib/commonjs/operations/execute.js.map +1 -1
- package/lib/commonjs/operations/executeBatch.js +2 -19
- package/lib/commonjs/operations/executeBatch.js.map +1 -1
- package/lib/commonjs/specs/{NativeQueryResult.nitro.js → NitroSQLiteQueryResult.nitro.js} +1 -1
- package/lib/commonjs/specs/NitroSQLiteQueryResult.nitro.js.map +1 -0
- package/lib/commonjs/types.js +1 -8
- package/lib/commonjs/types.js.map +1 -1
- package/lib/module/index.js +0 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/operations/execute.js +19 -33
- package/lib/module/operations/execute.js.map +1 -1
- package/lib/module/operations/executeBatch.js +2 -19
- package/lib/module/operations/executeBatch.js.map +1 -1
- package/lib/module/specs/NitroSQLiteQueryResult.nitro.js +4 -0
- package/lib/module/specs/NitroSQLiteQueryResult.nitro.js.map +1 -0
- package/lib/module/types.js +0 -12
- package/lib/module/types.js.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +0 -1
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/operations/execute.d.ts +1 -1
- package/lib/typescript/commonjs/operations/execute.d.ts.map +1 -1
- package/lib/typescript/commonjs/operations/executeBatch.d.ts +1 -1
- package/lib/typescript/commonjs/operations/executeBatch.d.ts.map +1 -1
- package/lib/typescript/commonjs/operations/transaction.d.ts.map +1 -1
- package/lib/typescript/commonjs/specs/NitroSQLite.nitro.d.ts +6 -6
- package/lib/typescript/commonjs/specs/NitroSQLite.nitro.d.ts.map +1 -1
- package/lib/typescript/{module/specs/NativeQueryResult.nitro.d.ts → commonjs/specs/NitroSQLiteQueryResult.nitro.d.ts} +7 -13
- package/lib/typescript/commonjs/specs/NitroSQLiteQueryResult.nitro.d.ts.map +1 -0
- package/lib/typescript/commonjs/typeORM.d.ts +1 -1
- package/lib/typescript/commonjs/typeORM.d.ts.map +1 -1
- package/lib/typescript/commonjs/types.d.ts +21 -37
- package/lib/typescript/commonjs/types.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +0 -1
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/operations/execute.d.ts +1 -1
- package/lib/typescript/module/operations/execute.d.ts.map +1 -1
- package/lib/typescript/module/operations/executeBatch.d.ts +1 -1
- package/lib/typescript/module/operations/executeBatch.d.ts.map +1 -1
- package/lib/typescript/module/operations/transaction.d.ts.map +1 -1
- package/lib/typescript/module/specs/NitroSQLite.nitro.d.ts +6 -6
- package/lib/typescript/module/specs/NitroSQLite.nitro.d.ts.map +1 -1
- package/lib/typescript/{commonjs/specs/NativeQueryResult.nitro.d.ts → module/specs/NitroSQLiteQueryResult.nitro.d.ts} +7 -13
- package/lib/typescript/module/specs/NitroSQLiteQueryResult.nitro.d.ts.map +1 -0
- package/lib/typescript/module/typeORM.d.ts +1 -1
- package/lib/typescript/module/typeORM.d.ts.map +1 -1
- package/lib/typescript/module/types.d.ts +21 -37
- package/lib/typescript/module/types.d.ts.map +1 -1
- package/nitrogen/generated/android/RNNitroSQLite+autolinking.cmake +9 -6
- package/nitrogen/generated/android/RNNitroSQLite+autolinking.gradle +1 -1
- package/nitrogen/generated/android/RNNitroSQLiteOnLoad.cpp +2 -4
- package/nitrogen/generated/android/RNNitroSQLiteOnLoad.hpp +1 -1
- package/nitrogen/generated/android/c++/JHybridNitroSQLiteOnLoadSpec.cpp +14 -1
- package/nitrogen/generated/android/c++/JHybridNitroSQLiteOnLoadSpec.hpp +4 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rnnitrosqlite/HybridNitroSQLiteOnLoadSpec.kt +8 -3
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rnnitrosqlite/RNNitroSQLiteOnLoad.kt +1 -1
- package/nitrogen/generated/ios/RNNitroSQLite+autolinking.rb +2 -2
- package/nitrogen/generated/ios/RNNitroSQLite-Swift-Cxx-Bridge.cpp +1 -1
- package/nitrogen/generated/ios/RNNitroSQLite-Swift-Cxx-Bridge.hpp +1 -1
- package/nitrogen/generated/ios/RNNitroSQLite-Swift-Cxx-Umbrella.hpp +1 -1
- package/nitrogen/generated/ios/RNNitroSQLiteAutolinking.mm +1 -1
- package/nitrogen/generated/ios/RNNitroSQLiteAutolinking.swift +5 -1
- package/nitrogen/generated/shared/c++/BatchQueryCommand.hpp +92 -0
- package/nitrogen/generated/shared/c++/BatchQueryResult.hpp +25 -11
- package/nitrogen/generated/shared/c++/ColumnType.hpp +5 -7
- package/nitrogen/generated/shared/c++/FileLoadResult.hpp +28 -14
- package/nitrogen/generated/shared/c++/HybridNitroSQLiteOnLoadSpec.cpp +1 -1
- package/nitrogen/generated/shared/c++/HybridNitroSQLiteOnLoadSpec.hpp +1 -1
- package/nitrogen/generated/shared/c++/HybridNitroSQLiteQueryResultSpec.cpp +24 -0
- package/nitrogen/generated/shared/c++/HybridNitroSQLiteQueryResultSpec.hpp +73 -0
- package/nitrogen/generated/shared/c++/HybridNitroSQLiteSpec.cpp +1 -1
- package/nitrogen/generated/shared/c++/HybridNitroSQLiteSpec.hpp +12 -16
- package/nitrogen/generated/shared/c++/NitroSQLiteQueryColumnMetadata.hpp +93 -0
- package/package.json +5 -5
- package/src/index.ts +0 -6
- package/src/operations/execute.ts +23 -58
- package/src/operations/executeBatch.ts +3 -41
- package/src/operations/session.ts +1 -1
- package/src/operations/transaction.ts +1 -1
- package/src/specs/NitroSQLite.nitro.ts +9 -12
- package/src/specs/{NativeQueryResult.nitro.ts → NitroSQLiteQueryResult.nitro.ts} +15 -17
- package/src/typeORM.ts +1 -1
- package/src/types.ts +28 -45
- package/cpp/specs/HybridNativeQueryResult.cpp +0 -21
- package/cpp/specs/HybridNativeQueryResult.hpp +0 -27
- package/lib/commonjs/nullHandling.js +0 -33
- package/lib/commonjs/nullHandling.js.map +0 -1
- package/lib/commonjs/specs/NativeQueryResult.nitro.js.map +0 -1
- package/lib/module/nullHandling.js +0 -25
- package/lib/module/nullHandling.js.map +0 -1
- package/lib/module/specs/NativeQueryResult.nitro.js +0 -4
- package/lib/module/specs/NativeQueryResult.nitro.js.map +0 -1
- package/lib/typescript/commonjs/nullHandling.d.ts +0 -8
- package/lib/typescript/commonjs/nullHandling.d.ts.map +0 -1
- package/lib/typescript/commonjs/specs/NativeQueryResult.nitro.d.ts.map +0 -1
- package/lib/typescript/module/nullHandling.d.ts +0 -8
- package/lib/typescript/module/nullHandling.d.ts.map +0 -1
- package/lib/typescript/module/specs/NativeQueryResult.nitro.d.ts.map +0 -1
- package/nitrogen/generated/shared/c++/HybridNativeQueryResultSpec.cpp +0 -24
- package/nitrogen/generated/shared/c++/HybridNativeQueryResultSpec.hpp +0 -77
- package/nitrogen/generated/shared/c++/NativeBatchQueryCommand.hpp +0 -81
- package/nitrogen/generated/shared/c++/SQLiteNullValue.hpp +0 -69
- package/nitrogen/generated/shared/c++/SQLiteQueryColumnMetadata.hpp +0 -79
- package/src/nullHandling.ts +0 -35
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { HybridObject } from 'react-native-nitro-modules'
|
|
2
2
|
import type {
|
|
3
|
+
BatchQueryCommand,
|
|
3
4
|
BatchQueryResult,
|
|
4
5
|
FileLoadResult,
|
|
5
|
-
|
|
6
|
-
NativeBatchQueryCommand,
|
|
6
|
+
SQLiteQueryParams,
|
|
7
7
|
} from '../types'
|
|
8
|
-
import type {
|
|
8
|
+
import type { NitroSQLiteQueryResult } from './NitroSQLiteQueryResult.nitro'
|
|
9
9
|
|
|
10
10
|
export interface NitroSQLite
|
|
11
11
|
extends HybridObject<{ ios: 'c++'; android: 'c++' }> {
|
|
@@ -22,20 +22,17 @@ export interface NitroSQLite
|
|
|
22
22
|
execute(
|
|
23
23
|
dbName: string,
|
|
24
24
|
query: string,
|
|
25
|
-
params?:
|
|
26
|
-
):
|
|
25
|
+
params?: SQLiteQueryParams,
|
|
26
|
+
): NitroSQLiteQueryResult
|
|
27
27
|
executeAsync(
|
|
28
28
|
dbName: string,
|
|
29
29
|
query: string,
|
|
30
|
-
params?:
|
|
31
|
-
): Promise<
|
|
32
|
-
executeBatch(
|
|
33
|
-
dbName: string,
|
|
34
|
-
commands: NativeBatchQueryCommand[],
|
|
35
|
-
): BatchQueryResult
|
|
30
|
+
params?: SQLiteQueryParams,
|
|
31
|
+
): Promise<NitroSQLiteQueryResult>
|
|
32
|
+
executeBatch(dbName: string, commands: BatchQueryCommand[]): BatchQueryResult
|
|
36
33
|
executeBatchAsync(
|
|
37
34
|
dbName: string,
|
|
38
|
-
commands:
|
|
35
|
+
commands: BatchQueryCommand[],
|
|
39
36
|
): Promise<BatchQueryResult>
|
|
40
37
|
loadFile(dbName: string, location: string): FileLoadResult
|
|
41
38
|
loadFileAsync(dbName: string, location: string): Promise<FileLoadResult>
|
|
@@ -9,36 +9,34 @@ import type { ColumnType, SQLiteValue } from '../types'
|
|
|
9
9
|
* rows: if status is undefined or 0 this object will contain the query results
|
|
10
10
|
* }
|
|
11
11
|
*
|
|
12
|
-
* @interface
|
|
12
|
+
* @interface QueryResult
|
|
13
13
|
*/
|
|
14
|
-
export interface
|
|
14
|
+
export interface NitroSQLiteQueryResult
|
|
15
15
|
extends HybridObject<{ ios: 'c++'; android: 'c++' }> {
|
|
16
16
|
readonly rowsAffected: number
|
|
17
17
|
readonly insertId?: number
|
|
18
18
|
|
|
19
19
|
/** Query results */
|
|
20
|
-
readonly results:
|
|
20
|
+
readonly results: Record<string, SQLiteValue>[]
|
|
21
|
+
|
|
21
22
|
/** Table metadata */
|
|
22
|
-
readonly metadata?: Record<string,
|
|
23
|
+
readonly metadata?: Record<string, NitroSQLiteQueryColumnMetadata>
|
|
23
24
|
}
|
|
24
25
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
//
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
export type NativeSQLiteQueryResults = Record<string, SQLiteValue>[]
|
|
34
|
-
|
|
35
|
-
// TODO: Investigate why this doesn't work with nitrogen
|
|
36
|
-
// export type SQLiteQueryTableMetadata = Record<string, SQLiteQueryColumnMetadata>
|
|
37
|
-
export interface SQLiteQueryColumnMetadata {
|
|
26
|
+
// TODO: Investigate why this cannot be represented in Nitro
|
|
27
|
+
// export type NitroQueryResultRow = {
|
|
28
|
+
// [key: string]: SQLiteValue
|
|
29
|
+
// }
|
|
30
|
+
|
|
31
|
+
// type NitroQueryResultRow = Record<string, SQLiteValue>
|
|
32
|
+
|
|
33
|
+
export type NitroSQLiteQueryColumnMetadata = {
|
|
38
34
|
/** The name used for this column for this result set */
|
|
39
35
|
name: string
|
|
36
|
+
|
|
40
37
|
/** The declared column type for this column, when fetched directly from a table or a View resulting from a table column. "UNKNOWN" for dynamic values, like function returned ones. */
|
|
41
38
|
type: ColumnType
|
|
39
|
+
|
|
42
40
|
/** The index for this column for this result set */
|
|
43
41
|
index: number
|
|
44
42
|
}
|
package/src/typeORM.ts
CHANGED
package/src/types.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { NitroSQLiteQueryResult } from './specs/NitroSQLiteQueryResult.nitro'
|
|
2
|
+
|
|
1
3
|
export interface NitroSQLiteConnectionOptions {
|
|
2
4
|
name: string
|
|
3
5
|
location?: string
|
|
@@ -28,48 +30,37 @@ export enum ColumnType {
|
|
|
28
30
|
NULL_VALUE,
|
|
29
31
|
}
|
|
30
32
|
|
|
31
|
-
|
|
32
|
-
export type SQLiteNullValue = {
|
|
33
|
-
isNitroSQLiteNull: true
|
|
34
|
-
}
|
|
35
|
-
export type SQLiteValue =
|
|
36
|
-
| boolean
|
|
37
|
-
| number
|
|
38
|
-
| string
|
|
39
|
-
| ArrayBuffer
|
|
40
|
-
| SQLiteNullValue
|
|
33
|
+
export type SQLiteValue = boolean | number | string | ArrayBuffer | null
|
|
41
34
|
|
|
42
|
-
|
|
43
|
-
export type NativeSQLiteQueryParams = SQLiteValue[]
|
|
35
|
+
export type SQLiteQueryParams = SQLiteValue[]
|
|
44
36
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
export type QueryResultRowItem = SQLiteValue | undefined
|
|
52
|
-
export type QueryResultRow = Record<string, QueryResultRowItem>
|
|
53
|
-
export interface QueryResult<Row extends QueryResultRow = QueryResultRow> {
|
|
54
|
-
readonly insertId?: number
|
|
55
|
-
readonly rowsAffected: number
|
|
56
|
-
|
|
57
|
-
readonly rows?: {
|
|
58
|
-
/** Raw array with all dataset */
|
|
59
|
-
_array: Row[]
|
|
60
|
-
/** The lengh of the dataset */
|
|
61
|
-
length: number
|
|
62
|
-
/** A convenience function to acess the index based the row object
|
|
63
|
-
* @param idx the row index
|
|
64
|
-
* @returns the row structure identified by column names
|
|
65
|
-
*/
|
|
66
|
-
item: (idx: number) => Row | undefined
|
|
37
|
+
export type QueryResultRow = Record<string, SQLiteValue>
|
|
38
|
+
|
|
39
|
+
export type QueryResult<Row extends QueryResultRow = QueryResultRow> =
|
|
40
|
+
NitroSQLiteQueryResult & {
|
|
41
|
+
/** Query results in a row format for TypeORM compatibility */
|
|
42
|
+
rows: NitroSQLiteQueryResultRows<Row>
|
|
67
43
|
}
|
|
44
|
+
|
|
45
|
+
export type NitroSQLiteQueryResultRows<
|
|
46
|
+
Row extends Record<string, SQLiteValue> = Record<string, SQLiteValue>,
|
|
47
|
+
> = {
|
|
48
|
+
/** Raw array with all dataset */
|
|
49
|
+
_array: Row[]
|
|
50
|
+
|
|
51
|
+
/** The lengh of the dataset */
|
|
52
|
+
length: number
|
|
53
|
+
|
|
54
|
+
/** A convenience function to acess the index based the row object
|
|
55
|
+
* @param idx the row index
|
|
56
|
+
* @returns the row structure identified by column names
|
|
57
|
+
*/
|
|
58
|
+
item: (idx: number) => Row | undefined
|
|
68
59
|
}
|
|
69
60
|
|
|
70
61
|
export type ExecuteQuery = <Row extends QueryResultRow = QueryResultRow>(
|
|
71
62
|
query: string,
|
|
72
|
-
params?:
|
|
63
|
+
params?: SQLiteValue[],
|
|
73
64
|
) => QueryResult<Row>
|
|
74
65
|
|
|
75
66
|
export type ExecuteAsyncQuery = <Row extends QueryResultRow = QueryResultRow>(
|
|
@@ -78,8 +69,8 @@ export type ExecuteAsyncQuery = <Row extends QueryResultRow = QueryResultRow>(
|
|
|
78
69
|
) => Promise<QueryResult<Row>>
|
|
79
70
|
|
|
80
71
|
export interface Transaction {
|
|
81
|
-
commit():
|
|
82
|
-
rollback():
|
|
72
|
+
commit(): NitroSQLiteQueryResult
|
|
73
|
+
rollback(): NitroSQLiteQueryResult
|
|
83
74
|
execute: ExecuteQuery
|
|
84
75
|
executeAsync: ExecuteAsyncQuery
|
|
85
76
|
}
|
|
@@ -95,14 +86,6 @@ export interface BatchQueryCommand {
|
|
|
95
86
|
params?: SQLiteQueryParams | SQLiteQueryParams[]
|
|
96
87
|
}
|
|
97
88
|
|
|
98
|
-
/**
|
|
99
|
-
* Used internally to transform the batch query commands into a native format without nullish values
|
|
100
|
-
*/
|
|
101
|
-
export interface NativeBatchQueryCommand {
|
|
102
|
-
query: string
|
|
103
|
-
params?: NativeSQLiteQueryParams | NativeSQLiteQueryParams[]
|
|
104
|
-
}
|
|
105
|
-
|
|
106
89
|
/**
|
|
107
90
|
* status: 0 or undefined for correct execution, 1 for error
|
|
108
91
|
* message: if status === 1, here you will find error description
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
#include "HybridNativeQueryResult.hpp"
|
|
2
|
-
|
|
3
|
-
namespace margelo::nitro::rnnitrosqlite {
|
|
4
|
-
|
|
5
|
-
std::optional<double> HybridNativeQueryResult::getInsertId() {
|
|
6
|
-
return _result.insertId;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
double HybridNativeQueryResult::getRowsAffected() {
|
|
10
|
-
return _result.rowsAffected;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
SQLiteQueryResults HybridNativeQueryResult::getResults() {
|
|
14
|
-
return _result.results;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
std::optional<SQLiteQueryTableMetadata> HybridNativeQueryResult::getMetadata() {
|
|
18
|
-
return _result.metadata;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
} // namespace margelo::nitro::rnnitrosqlite
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
#pragma once
|
|
2
|
-
|
|
3
|
-
#include "HybridNativeQueryResultSpec.hpp"
|
|
4
|
-
#include "types.hpp"
|
|
5
|
-
#include <map>
|
|
6
|
-
|
|
7
|
-
using namespace margelo::rnnitrosqlite;
|
|
8
|
-
|
|
9
|
-
namespace margelo::nitro::rnnitrosqlite {
|
|
10
|
-
|
|
11
|
-
class HybridNativeQueryResult : public HybridNativeQueryResultSpec {
|
|
12
|
-
public:
|
|
13
|
-
HybridNativeQueryResult() : HybridObject(TAG) {}
|
|
14
|
-
HybridNativeQueryResult(SQLiteExecuteQueryResult&& result) : HybridObject(TAG), _result(std::move(result)) {}
|
|
15
|
-
|
|
16
|
-
private:
|
|
17
|
-
SQLiteExecuteQueryResult _result;
|
|
18
|
-
|
|
19
|
-
public:
|
|
20
|
-
// Properties
|
|
21
|
-
std::optional<double> getInsertId() override;
|
|
22
|
-
double getRowsAffected() override;
|
|
23
|
-
SQLiteQueryResults getResults() override;
|
|
24
|
-
std::optional<SQLiteQueryTableMetadata> getMetadata() override;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
} // namespace margelo::nitro::rnnitrosqlite
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.NITRO_SQLITE_NULL = void 0;
|
|
7
|
-
exports.enableSimpleNullHandling = enableSimpleNullHandling;
|
|
8
|
-
exports.isNitroSQLiteNull = isNitroSQLiteNull;
|
|
9
|
-
exports.isSimpleNullHandlingEnabled = isSimpleNullHandlingEnabled;
|
|
10
|
-
exports.replaceWithNativeNullValue = replaceWithNativeNullValue;
|
|
11
|
-
let ENABLE_SIMPLE_NULL_HANDLING = false;
|
|
12
|
-
function enableSimpleNullHandling(shouldEnableSimpleNullHandling = true) {
|
|
13
|
-
ENABLE_SIMPLE_NULL_HANDLING = shouldEnableSimpleNullHandling;
|
|
14
|
-
}
|
|
15
|
-
function isSimpleNullHandlingEnabled() {
|
|
16
|
-
return ENABLE_SIMPLE_NULL_HANDLING;
|
|
17
|
-
}
|
|
18
|
-
const NITRO_SQLITE_NULL = exports.NITRO_SQLITE_NULL = {
|
|
19
|
-
isNitroSQLiteNull: true
|
|
20
|
-
};
|
|
21
|
-
function isNitroSQLiteNull(value) {
|
|
22
|
-
if (value !== null && typeof value === 'object' && 'isNitroSQLiteNull' in value) {
|
|
23
|
-
return true;
|
|
24
|
-
}
|
|
25
|
-
return false;
|
|
26
|
-
}
|
|
27
|
-
function replaceWithNativeNullValue(value) {
|
|
28
|
-
if (value === undefined || value === null) {
|
|
29
|
-
return NITRO_SQLITE_NULL;
|
|
30
|
-
}
|
|
31
|
-
return value;
|
|
32
|
-
}
|
|
33
|
-
//# sourceMappingURL=nullHandling.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["ENABLE_SIMPLE_NULL_HANDLING","enableSimpleNullHandling","shouldEnableSimpleNullHandling","isSimpleNullHandlingEnabled","NITRO_SQLITE_NULL","exports","isNitroSQLiteNull","value","replaceWithNativeNullValue","undefined"],"sourceRoot":"../../src","sources":["nullHandling.ts"],"mappings":";;;;;;;;;;AAGA,IAAIA,2BAA2B,GAAG,KAAK;AAEhC,SAASC,wBAAwBA,CACtCC,8BAA8B,GAAG,IAAI,EACrC;EACAF,2BAA2B,GAAGE,8BAA8B;AAC9D;AAEO,SAASC,2BAA2BA,CAAA,EAAG;EAC5C,OAAOH,2BAA2B;AACpC;AAEO,MAAMI,iBAAkC,GAAAC,OAAA,CAAAD,iBAAA,GAAG;EAAEE,iBAAiB,EAAE;AAAK,CAAC;AACtE,SAASA,iBAAiBA,CAACC,KAAc,EAA4B;EAC1E,IACEA,KAAK,KAAK,IAAI,IACd,OAAOA,KAAK,KAAK,QAAQ,IACzB,mBAAmB,IAAIA,KAAK,EAC5B;IACA,OAAO,IAAI;EACb;EACA,OAAO,KAAK;AACd;AAEO,SAASC,0BAA0BA,CACxCD,KAA2B,EACd;EACb,IAAIA,KAAK,KAAKE,SAAS,IAAIF,KAAK,KAAK,IAAI,EAAE;IACzC,OAAOH,iBAAiB;EAC1B;EACA,OAAOG,KAAK;AACd","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["specs/NativeQueryResult.nitro.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
let ENABLE_SIMPLE_NULL_HANDLING = false;
|
|
4
|
-
export function enableSimpleNullHandling(shouldEnableSimpleNullHandling = true) {
|
|
5
|
-
ENABLE_SIMPLE_NULL_HANDLING = shouldEnableSimpleNullHandling;
|
|
6
|
-
}
|
|
7
|
-
export function isSimpleNullHandlingEnabled() {
|
|
8
|
-
return ENABLE_SIMPLE_NULL_HANDLING;
|
|
9
|
-
}
|
|
10
|
-
export const NITRO_SQLITE_NULL = {
|
|
11
|
-
isNitroSQLiteNull: true
|
|
12
|
-
};
|
|
13
|
-
export function isNitroSQLiteNull(value) {
|
|
14
|
-
if (value !== null && typeof value === 'object' && 'isNitroSQLiteNull' in value) {
|
|
15
|
-
return true;
|
|
16
|
-
}
|
|
17
|
-
return false;
|
|
18
|
-
}
|
|
19
|
-
export function replaceWithNativeNullValue(value) {
|
|
20
|
-
if (value === undefined || value === null) {
|
|
21
|
-
return NITRO_SQLITE_NULL;
|
|
22
|
-
}
|
|
23
|
-
return value;
|
|
24
|
-
}
|
|
25
|
-
//# sourceMappingURL=nullHandling.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["ENABLE_SIMPLE_NULL_HANDLING","enableSimpleNullHandling","shouldEnableSimpleNullHandling","isSimpleNullHandlingEnabled","NITRO_SQLITE_NULL","isNitroSQLiteNull","value","replaceWithNativeNullValue","undefined"],"sourceRoot":"../../src","sources":["nullHandling.ts"],"mappings":";;AAGA,IAAIA,2BAA2B,GAAG,KAAK;AAEvC,OAAO,SAASC,wBAAwBA,CACtCC,8BAA8B,GAAG,IAAI,EACrC;EACAF,2BAA2B,GAAGE,8BAA8B;AAC9D;AAEA,OAAO,SAASC,2BAA2BA,CAAA,EAAG;EAC5C,OAAOH,2BAA2B;AACpC;AAEA,OAAO,MAAMI,iBAAkC,GAAG;EAAEC,iBAAiB,EAAE;AAAK,CAAC;AAC7E,OAAO,SAASA,iBAAiBA,CAACC,KAAc,EAA4B;EAC1E,IACEA,KAAK,KAAK,IAAI,IACd,OAAOA,KAAK,KAAK,QAAQ,IACzB,mBAAmB,IAAIA,KAAK,EAC5B;IACA,OAAO,IAAI;EACb;EACA,OAAO,KAAK;AACd;AAEA,OAAO,SAASC,0BAA0BA,CACxCD,KAA2B,EACd;EACb,IAAIA,KAAK,KAAKE,SAAS,IAAIF,KAAK,KAAK,IAAI,EAAE;IACzC,OAAOF,iBAAiB;EAC1B;EACA,OAAOE,KAAK;AACd","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["specs/NativeQueryResult.nitro.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { SQLiteNullValue, SQLiteValue } from './types';
|
|
2
|
-
import { SQLiteQueryParamItem } from './types';
|
|
3
|
-
export declare function enableSimpleNullHandling(shouldEnableSimpleNullHandling?: boolean): void;
|
|
4
|
-
export declare function isSimpleNullHandlingEnabled(): boolean;
|
|
5
|
-
export declare const NITRO_SQLITE_NULL: SQLiteNullValue;
|
|
6
|
-
export declare function isNitroSQLiteNull(value: unknown): value is SQLiteNullValue;
|
|
7
|
-
export declare function replaceWithNativeNullValue(value: SQLiteQueryParamItem): SQLiteValue;
|
|
8
|
-
//# sourceMappingURL=nullHandling.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"nullHandling.d.ts","sourceRoot":"","sources":["../../../src/nullHandling.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAI9C,wBAAgB,wBAAwB,CACtC,8BAA8B,UAAO,QAGtC;AAED,wBAAgB,2BAA2B,YAE1C;AAED,eAAO,MAAM,iBAAiB,EAAE,eAA6C,CAAA;AAC7E,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,eAAe,CAS1E;AAED,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,oBAAoB,GAC1B,WAAW,CAKb"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NativeQueryResult.nitro.d.ts","sourceRoot":"","sources":["../../../../src/specs/NativeQueryResult.nitro.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAEvD;;;;;;;;;GASG;AACH,MAAM,WAAW,iBACf,SAAQ,YAAY,CAAC;IAAE,GAAG,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,KAAK,CAAA;CAAE,CAAC;IACpD,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;IAE1B,oBAAoB;IACpB,QAAQ,CAAC,OAAO,EAAE,wBAAwB,CAAA;IAC1C,qBAAqB;IACrB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,yBAAyB,CAAC,CAAA;CAC9D;AAED;;;;GAIG;AAIH,MAAM,MAAM,wBAAwB,GAAG,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,EAAE,CAAA;AAIpE,MAAM,WAAW,yBAAyB;IACxC,wDAAwD;IACxD,IAAI,EAAE,MAAM,CAAA;IACZ,uLAAuL;IACvL,IAAI,EAAE,UAAU,CAAA;IAChB,oDAAoD;IACpD,KAAK,EAAE,MAAM,CAAA;CACd"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { SQLiteNullValue, SQLiteValue } from './types';
|
|
2
|
-
import { SQLiteQueryParamItem } from './types';
|
|
3
|
-
export declare function enableSimpleNullHandling(shouldEnableSimpleNullHandling?: boolean): void;
|
|
4
|
-
export declare function isSimpleNullHandlingEnabled(): boolean;
|
|
5
|
-
export declare const NITRO_SQLITE_NULL: SQLiteNullValue;
|
|
6
|
-
export declare function isNitroSQLiteNull(value: unknown): value is SQLiteNullValue;
|
|
7
|
-
export declare function replaceWithNativeNullValue(value: SQLiteQueryParamItem): SQLiteValue;
|
|
8
|
-
//# sourceMappingURL=nullHandling.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"nullHandling.d.ts","sourceRoot":"","sources":["../../../src/nullHandling.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAI9C,wBAAgB,wBAAwB,CACtC,8BAA8B,UAAO,QAGtC;AAED,wBAAgB,2BAA2B,YAE1C;AAED,eAAO,MAAM,iBAAiB,EAAE,eAA6C,CAAA;AAC7E,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,eAAe,CAS1E;AAED,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,oBAAoB,GAC1B,WAAW,CAKb"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NativeQueryResult.nitro.d.ts","sourceRoot":"","sources":["../../../../src/specs/NativeQueryResult.nitro.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAEvD;;;;;;;;;GASG;AACH,MAAM,WAAW,iBACf,SAAQ,YAAY,CAAC;IAAE,GAAG,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,KAAK,CAAA;CAAE,CAAC;IACpD,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;IAE1B,oBAAoB;IACpB,QAAQ,CAAC,OAAO,EAAE,wBAAwB,CAAA;IAC1C,qBAAqB;IACrB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,yBAAyB,CAAC,CAAA;CAC9D;AAED;;;;GAIG;AAIH,MAAM,MAAM,wBAAwB,GAAG,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,EAAE,CAAA;AAIpE,MAAM,WAAW,yBAAyB;IACxC,wDAAwD;IACxD,IAAI,EAAE,MAAM,CAAA;IACZ,uLAAuL;IACvL,IAAI,EAAE,UAAU,CAAA;IAChB,oDAAoD;IACpD,KAAK,EAAE,MAAM,CAAA;CACd"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// HybridNativeQueryResultSpec.cpp
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
#include "HybridNativeQueryResultSpec.hpp"
|
|
9
|
-
|
|
10
|
-
namespace margelo::nitro::rnnitrosqlite {
|
|
11
|
-
|
|
12
|
-
void HybridNativeQueryResultSpec::loadHybridMethods() {
|
|
13
|
-
// load base methods/properties
|
|
14
|
-
HybridObject::loadHybridMethods();
|
|
15
|
-
// load custom methods/properties
|
|
16
|
-
registerHybrids(this, [](Prototype& prototype) {
|
|
17
|
-
prototype.registerHybridGetter("rowsAffected", &HybridNativeQueryResultSpec::getRowsAffected);
|
|
18
|
-
prototype.registerHybridGetter("insertId", &HybridNativeQueryResultSpec::getInsertId);
|
|
19
|
-
prototype.registerHybridGetter("results", &HybridNativeQueryResultSpec::getResults);
|
|
20
|
-
prototype.registerHybridGetter("metadata", &HybridNativeQueryResultSpec::getMetadata);
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
} // namespace margelo::nitro::rnnitrosqlite
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// HybridNativeQueryResultSpec.hpp
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
#pragma once
|
|
9
|
-
|
|
10
|
-
#if __has_include(<NitroModules/HybridObject.hpp>)
|
|
11
|
-
#include <NitroModules/HybridObject.hpp>
|
|
12
|
-
#else
|
|
13
|
-
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
-
#endif
|
|
15
|
-
|
|
16
|
-
// Forward declaration of `ArrayBuffer` to properly resolve imports.
|
|
17
|
-
namespace NitroModules { class ArrayBuffer; }
|
|
18
|
-
// Forward declaration of `SQLiteNullValue` to properly resolve imports.
|
|
19
|
-
namespace margelo::nitro::rnnitrosqlite { struct SQLiteNullValue; }
|
|
20
|
-
// Forward declaration of `SQLiteQueryColumnMetadata` to properly resolve imports.
|
|
21
|
-
namespace margelo::nitro::rnnitrosqlite { struct SQLiteQueryColumnMetadata; }
|
|
22
|
-
|
|
23
|
-
#include <optional>
|
|
24
|
-
#include <string>
|
|
25
|
-
#include <NitroModules/ArrayBuffer.hpp>
|
|
26
|
-
#include "SQLiteNullValue.hpp"
|
|
27
|
-
#include <variant>
|
|
28
|
-
#include <unordered_map>
|
|
29
|
-
#include <vector>
|
|
30
|
-
#include "SQLiteQueryColumnMetadata.hpp"
|
|
31
|
-
|
|
32
|
-
namespace margelo::nitro::rnnitrosqlite {
|
|
33
|
-
|
|
34
|
-
using namespace margelo::nitro;
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* An abstract base class for `NativeQueryResult`
|
|
38
|
-
* Inherit this class to create instances of `HybridNativeQueryResultSpec` in C++.
|
|
39
|
-
* You must explicitly call `HybridObject`'s constructor yourself, because it is virtual.
|
|
40
|
-
* @example
|
|
41
|
-
* ```cpp
|
|
42
|
-
* class HybridNativeQueryResult: public HybridNativeQueryResultSpec {
|
|
43
|
-
* public:
|
|
44
|
-
* HybridNativeQueryResult(...): HybridObject(TAG) { ... }
|
|
45
|
-
* // ...
|
|
46
|
-
* };
|
|
47
|
-
* ```
|
|
48
|
-
*/
|
|
49
|
-
class HybridNativeQueryResultSpec: public virtual HybridObject {
|
|
50
|
-
public:
|
|
51
|
-
// Constructor
|
|
52
|
-
explicit HybridNativeQueryResultSpec(): HybridObject(TAG) { }
|
|
53
|
-
|
|
54
|
-
// Destructor
|
|
55
|
-
~HybridNativeQueryResultSpec() override = default;
|
|
56
|
-
|
|
57
|
-
public:
|
|
58
|
-
// Properties
|
|
59
|
-
virtual double getRowsAffected() = 0;
|
|
60
|
-
virtual std::optional<double> getInsertId() = 0;
|
|
61
|
-
virtual std::vector<std::unordered_map<std::string, std::variant<std::string, double, bool, std::shared_ptr<ArrayBuffer>, SQLiteNullValue>>> getResults() = 0;
|
|
62
|
-
virtual std::optional<std::unordered_map<std::string, SQLiteQueryColumnMetadata>> getMetadata() = 0;
|
|
63
|
-
|
|
64
|
-
public:
|
|
65
|
-
// Methods
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
protected:
|
|
69
|
-
// Hybrid Setup
|
|
70
|
-
void loadHybridMethods() override;
|
|
71
|
-
|
|
72
|
-
protected:
|
|
73
|
-
// Tag for logging
|
|
74
|
-
static constexpr auto TAG = "NativeQueryResult";
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
} // namespace margelo::nitro::rnnitrosqlite
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// NativeBatchQueryCommand.hpp
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
#pragma once
|
|
9
|
-
|
|
10
|
-
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
-
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
-
#else
|
|
13
|
-
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
-
#endif
|
|
15
|
-
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
-
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
-
#else
|
|
18
|
-
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
-
#endif
|
|
20
|
-
|
|
21
|
-
// Forward declaration of `ArrayBuffer` to properly resolve imports.
|
|
22
|
-
namespace NitroModules { class ArrayBuffer; }
|
|
23
|
-
// Forward declaration of `SQLiteNullValue` to properly resolve imports.
|
|
24
|
-
namespace margelo::nitro::rnnitrosqlite { struct SQLiteNullValue; }
|
|
25
|
-
|
|
26
|
-
#include <string>
|
|
27
|
-
#include <NitroModules/ArrayBuffer.hpp>
|
|
28
|
-
#include "SQLiteNullValue.hpp"
|
|
29
|
-
#include <variant>
|
|
30
|
-
#include <vector>
|
|
31
|
-
#include <optional>
|
|
32
|
-
|
|
33
|
-
namespace margelo::nitro::rnnitrosqlite {
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* A struct which can be represented as a JavaScript object (NativeBatchQueryCommand).
|
|
37
|
-
*/
|
|
38
|
-
struct NativeBatchQueryCommand {
|
|
39
|
-
public:
|
|
40
|
-
std::string query SWIFT_PRIVATE;
|
|
41
|
-
std::optional<std::variant<std::vector<std::variant<std::string, double, bool, std::shared_ptr<ArrayBuffer>, SQLiteNullValue>>, std::vector<std::vector<std::variant<std::string, double, bool, std::shared_ptr<ArrayBuffer>, SQLiteNullValue>>>>> params SWIFT_PRIVATE;
|
|
42
|
-
|
|
43
|
-
public:
|
|
44
|
-
NativeBatchQueryCommand() = default;
|
|
45
|
-
explicit NativeBatchQueryCommand(std::string query, std::optional<std::variant<std::vector<std::variant<std::string, double, bool, std::shared_ptr<ArrayBuffer>, SQLiteNullValue>>, std::vector<std::vector<std::variant<std::string, double, bool, std::shared_ptr<ArrayBuffer>, SQLiteNullValue>>>>> params): query(query), params(params) {}
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
} // namespace margelo::nitro::rnnitrosqlite
|
|
49
|
-
|
|
50
|
-
namespace margelo::nitro {
|
|
51
|
-
|
|
52
|
-
using namespace margelo::nitro::rnnitrosqlite;
|
|
53
|
-
|
|
54
|
-
// C++ NativeBatchQueryCommand <> JS NativeBatchQueryCommand (object)
|
|
55
|
-
template <>
|
|
56
|
-
struct JSIConverter<NativeBatchQueryCommand> final {
|
|
57
|
-
static inline NativeBatchQueryCommand fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
58
|
-
jsi::Object obj = arg.asObject(runtime);
|
|
59
|
-
return NativeBatchQueryCommand(
|
|
60
|
-
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "query")),
|
|
61
|
-
JSIConverter<std::optional<std::variant<std::vector<std::variant<std::string, double, bool, std::shared_ptr<ArrayBuffer>, SQLiteNullValue>>, std::vector<std::vector<std::variant<std::string, double, bool, std::shared_ptr<ArrayBuffer>, SQLiteNullValue>>>>>>::fromJSI(runtime, obj.getProperty(runtime, "params"))
|
|
62
|
-
);
|
|
63
|
-
}
|
|
64
|
-
static inline jsi::Value toJSI(jsi::Runtime& runtime, const NativeBatchQueryCommand& arg) {
|
|
65
|
-
jsi::Object obj(runtime);
|
|
66
|
-
obj.setProperty(runtime, "query", JSIConverter<std::string>::toJSI(runtime, arg.query));
|
|
67
|
-
obj.setProperty(runtime, "params", JSIConverter<std::optional<std::variant<std::vector<std::variant<std::string, double, bool, std::shared_ptr<ArrayBuffer>, SQLiteNullValue>>, std::vector<std::vector<std::variant<std::string, double, bool, std::shared_ptr<ArrayBuffer>, SQLiteNullValue>>>>>>::toJSI(runtime, arg.params));
|
|
68
|
-
return obj;
|
|
69
|
-
}
|
|
70
|
-
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
71
|
-
if (!value.isObject()) {
|
|
72
|
-
return false;
|
|
73
|
-
}
|
|
74
|
-
jsi::Object obj = value.getObject(runtime);
|
|
75
|
-
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "query"))) return false;
|
|
76
|
-
if (!JSIConverter<std::optional<std::variant<std::vector<std::variant<std::string, double, bool, std::shared_ptr<ArrayBuffer>, SQLiteNullValue>>, std::vector<std::vector<std::variant<std::string, double, bool, std::shared_ptr<ArrayBuffer>, SQLiteNullValue>>>>>>::canConvert(runtime, obj.getProperty(runtime, "params"))) return false;
|
|
77
|
-
return true;
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
} // namespace margelo::nitro
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// SQLiteNullValue.hpp
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
#pragma once
|
|
9
|
-
|
|
10
|
-
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
-
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
-
#else
|
|
13
|
-
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
-
#endif
|
|
15
|
-
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
-
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
-
#else
|
|
18
|
-
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
-
#endif
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
namespace margelo::nitro::rnnitrosqlite {
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* A struct which can be represented as a JavaScript object (SQLiteNullValue).
|
|
29
|
-
*/
|
|
30
|
-
struct SQLiteNullValue {
|
|
31
|
-
public:
|
|
32
|
-
bool isNitroSQLiteNull SWIFT_PRIVATE;
|
|
33
|
-
|
|
34
|
-
public:
|
|
35
|
-
SQLiteNullValue() = default;
|
|
36
|
-
explicit SQLiteNullValue(bool isNitroSQLiteNull): isNitroSQLiteNull(isNitroSQLiteNull) {}
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
} // namespace margelo::nitro::rnnitrosqlite
|
|
40
|
-
|
|
41
|
-
namespace margelo::nitro {
|
|
42
|
-
|
|
43
|
-
using namespace margelo::nitro::rnnitrosqlite;
|
|
44
|
-
|
|
45
|
-
// C++ SQLiteNullValue <> JS SQLiteNullValue (object)
|
|
46
|
-
template <>
|
|
47
|
-
struct JSIConverter<SQLiteNullValue> final {
|
|
48
|
-
static inline SQLiteNullValue fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
49
|
-
jsi::Object obj = arg.asObject(runtime);
|
|
50
|
-
return SQLiteNullValue(
|
|
51
|
-
JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, "isNitroSQLiteNull"))
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
static inline jsi::Value toJSI(jsi::Runtime& runtime, const SQLiteNullValue& arg) {
|
|
55
|
-
jsi::Object obj(runtime);
|
|
56
|
-
obj.setProperty(runtime, "isNitroSQLiteNull", JSIConverter<bool>::toJSI(runtime, arg.isNitroSQLiteNull));
|
|
57
|
-
return obj;
|
|
58
|
-
}
|
|
59
|
-
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
60
|
-
if (!value.isObject()) {
|
|
61
|
-
return false;
|
|
62
|
-
}
|
|
63
|
-
jsi::Object obj = value.getObject(runtime);
|
|
64
|
-
if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "isNitroSQLiteNull"))) return false;
|
|
65
|
-
return true;
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
} // namespace margelo::nitro
|