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,79 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// SQLiteQueryColumnMetadata.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 `ColumnType` to properly resolve imports.
|
|
22
|
-
namespace margelo::nitro::rnnitrosqlite { enum class ColumnType; }
|
|
23
|
-
|
|
24
|
-
#include <string>
|
|
25
|
-
#include "ColumnType.hpp"
|
|
26
|
-
|
|
27
|
-
namespace margelo::nitro::rnnitrosqlite {
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* A struct which can be represented as a JavaScript object (SQLiteQueryColumnMetadata).
|
|
31
|
-
*/
|
|
32
|
-
struct SQLiteQueryColumnMetadata {
|
|
33
|
-
public:
|
|
34
|
-
std::string name SWIFT_PRIVATE;
|
|
35
|
-
ColumnType type SWIFT_PRIVATE;
|
|
36
|
-
double index SWIFT_PRIVATE;
|
|
37
|
-
|
|
38
|
-
public:
|
|
39
|
-
SQLiteQueryColumnMetadata() = default;
|
|
40
|
-
explicit SQLiteQueryColumnMetadata(std::string name, ColumnType type, double index): name(name), type(type), index(index) {}
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
} // namespace margelo::nitro::rnnitrosqlite
|
|
44
|
-
|
|
45
|
-
namespace margelo::nitro {
|
|
46
|
-
|
|
47
|
-
using namespace margelo::nitro::rnnitrosqlite;
|
|
48
|
-
|
|
49
|
-
// C++ SQLiteQueryColumnMetadata <> JS SQLiteQueryColumnMetadata (object)
|
|
50
|
-
template <>
|
|
51
|
-
struct JSIConverter<SQLiteQueryColumnMetadata> final {
|
|
52
|
-
static inline SQLiteQueryColumnMetadata fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
53
|
-
jsi::Object obj = arg.asObject(runtime);
|
|
54
|
-
return SQLiteQueryColumnMetadata(
|
|
55
|
-
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "name")),
|
|
56
|
-
JSIConverter<ColumnType>::fromJSI(runtime, obj.getProperty(runtime, "type")),
|
|
57
|
-
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "index"))
|
|
58
|
-
);
|
|
59
|
-
}
|
|
60
|
-
static inline jsi::Value toJSI(jsi::Runtime& runtime, const SQLiteQueryColumnMetadata& arg) {
|
|
61
|
-
jsi::Object obj(runtime);
|
|
62
|
-
obj.setProperty(runtime, "name", JSIConverter<std::string>::toJSI(runtime, arg.name));
|
|
63
|
-
obj.setProperty(runtime, "type", JSIConverter<ColumnType>::toJSI(runtime, arg.type));
|
|
64
|
-
obj.setProperty(runtime, "index", JSIConverter<double>::toJSI(runtime, arg.index));
|
|
65
|
-
return obj;
|
|
66
|
-
}
|
|
67
|
-
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
68
|
-
if (!value.isObject()) {
|
|
69
|
-
return false;
|
|
70
|
-
}
|
|
71
|
-
jsi::Object obj = value.getObject(runtime);
|
|
72
|
-
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "name"))) return false;
|
|
73
|
-
if (!JSIConverter<ColumnType>::canConvert(runtime, obj.getProperty(runtime, "type"))) return false;
|
|
74
|
-
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "index"))) return false;
|
|
75
|
-
return true;
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
} // namespace margelo::nitro
|
package/src/nullHandling.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { SQLiteNullValue, SQLiteValue } from './types'
|
|
2
|
-
import { SQLiteQueryParamItem } from './types'
|
|
3
|
-
|
|
4
|
-
let ENABLE_SIMPLE_NULL_HANDLING = false
|
|
5
|
-
|
|
6
|
-
export function enableSimpleNullHandling(
|
|
7
|
-
shouldEnableSimpleNullHandling = true,
|
|
8
|
-
) {
|
|
9
|
-
ENABLE_SIMPLE_NULL_HANDLING = shouldEnableSimpleNullHandling
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export function isSimpleNullHandlingEnabled() {
|
|
13
|
-
return ENABLE_SIMPLE_NULL_HANDLING
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export const NITRO_SQLITE_NULL: SQLiteNullValue = { isNitroSQLiteNull: true }
|
|
17
|
-
export function isNitroSQLiteNull(value: unknown): value is SQLiteNullValue {
|
|
18
|
-
if (
|
|
19
|
-
value !== null &&
|
|
20
|
-
typeof value === 'object' &&
|
|
21
|
-
'isNitroSQLiteNull' in value
|
|
22
|
-
) {
|
|
23
|
-
return true
|
|
24
|
-
}
|
|
25
|
-
return false
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export function replaceWithNativeNullValue(
|
|
29
|
-
value: SQLiteQueryParamItem,
|
|
30
|
-
): SQLiteValue {
|
|
31
|
-
if (value === undefined || value === null) {
|
|
32
|
-
return NITRO_SQLITE_NULL
|
|
33
|
-
}
|
|
34
|
-
return value
|
|
35
|
-
}
|