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.
Files changed (118) hide show
  1. package/android/CMakeLists.txt +1 -1
  2. package/cpp/NitroSQLiteException.hpp +1 -2
  3. package/cpp/{specs → hybridObjects}/HybridNitroSQLite.cpp +64 -16
  4. package/cpp/{specs → hybridObjects}/HybridNitroSQLite.hpp +6 -6
  5. package/cpp/hybridObjects/HybridNitroSQLiteQueryResult.cpp +93 -0
  6. package/cpp/hybridObjects/HybridNitroSQLiteQueryResult.hpp +47 -0
  7. package/cpp/operations.cpp +16 -12
  8. package/cpp/operations.hpp +3 -1
  9. package/cpp/sqliteExecuteBatch.cpp +2 -2
  10. package/cpp/sqliteExecuteBatch.hpp +2 -2
  11. package/cpp/types.hpp +4 -14
  12. package/ios/NitroSQLite.xcodeproj/project.pbxproj +2 -2
  13. package/lib/commonjs/index.js +0 -25
  14. package/lib/commonjs/index.js.map +1 -1
  15. package/lib/commonjs/operations/execute.js +19 -32
  16. package/lib/commonjs/operations/execute.js.map +1 -1
  17. package/lib/commonjs/operations/executeBatch.js +2 -19
  18. package/lib/commonjs/operations/executeBatch.js.map +1 -1
  19. package/lib/commonjs/specs/{NativeQueryResult.nitro.js → NitroSQLiteQueryResult.nitro.js} +1 -1
  20. package/lib/commonjs/specs/NitroSQLiteQueryResult.nitro.js.map +1 -0
  21. package/lib/commonjs/types.js +1 -8
  22. package/lib/commonjs/types.js.map +1 -1
  23. package/lib/module/index.js +0 -1
  24. package/lib/module/index.js.map +1 -1
  25. package/lib/module/operations/execute.js +19 -33
  26. package/lib/module/operations/execute.js.map +1 -1
  27. package/lib/module/operations/executeBatch.js +2 -19
  28. package/lib/module/operations/executeBatch.js.map +1 -1
  29. package/lib/module/specs/NitroSQLiteQueryResult.nitro.js +4 -0
  30. package/lib/module/specs/NitroSQLiteQueryResult.nitro.js.map +1 -0
  31. package/lib/module/types.js +0 -12
  32. package/lib/module/types.js.map +1 -1
  33. package/lib/typescript/commonjs/index.d.ts +0 -1
  34. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  35. package/lib/typescript/commonjs/operations/execute.d.ts +1 -1
  36. package/lib/typescript/commonjs/operations/execute.d.ts.map +1 -1
  37. package/lib/typescript/commonjs/operations/executeBatch.d.ts +1 -1
  38. package/lib/typescript/commonjs/operations/executeBatch.d.ts.map +1 -1
  39. package/lib/typescript/commonjs/operations/transaction.d.ts.map +1 -1
  40. package/lib/typescript/commonjs/specs/NitroSQLite.nitro.d.ts +6 -6
  41. package/lib/typescript/commonjs/specs/NitroSQLite.nitro.d.ts.map +1 -1
  42. package/lib/typescript/{module/specs/NativeQueryResult.nitro.d.ts → commonjs/specs/NitroSQLiteQueryResult.nitro.d.ts} +7 -13
  43. package/lib/typescript/commonjs/specs/NitroSQLiteQueryResult.nitro.d.ts.map +1 -0
  44. package/lib/typescript/commonjs/typeORM.d.ts +1 -1
  45. package/lib/typescript/commonjs/typeORM.d.ts.map +1 -1
  46. package/lib/typescript/commonjs/types.d.ts +21 -37
  47. package/lib/typescript/commonjs/types.d.ts.map +1 -1
  48. package/lib/typescript/module/index.d.ts +0 -1
  49. package/lib/typescript/module/index.d.ts.map +1 -1
  50. package/lib/typescript/module/operations/execute.d.ts +1 -1
  51. package/lib/typescript/module/operations/execute.d.ts.map +1 -1
  52. package/lib/typescript/module/operations/executeBatch.d.ts +1 -1
  53. package/lib/typescript/module/operations/executeBatch.d.ts.map +1 -1
  54. package/lib/typescript/module/operations/transaction.d.ts.map +1 -1
  55. package/lib/typescript/module/specs/NitroSQLite.nitro.d.ts +6 -6
  56. package/lib/typescript/module/specs/NitroSQLite.nitro.d.ts.map +1 -1
  57. package/lib/typescript/{commonjs/specs/NativeQueryResult.nitro.d.ts → module/specs/NitroSQLiteQueryResult.nitro.d.ts} +7 -13
  58. package/lib/typescript/module/specs/NitroSQLiteQueryResult.nitro.d.ts.map +1 -0
  59. package/lib/typescript/module/typeORM.d.ts +1 -1
  60. package/lib/typescript/module/typeORM.d.ts.map +1 -1
  61. package/lib/typescript/module/types.d.ts +21 -37
  62. package/lib/typescript/module/types.d.ts.map +1 -1
  63. package/nitrogen/generated/android/RNNitroSQLite+autolinking.cmake +9 -6
  64. package/nitrogen/generated/android/RNNitroSQLite+autolinking.gradle +1 -1
  65. package/nitrogen/generated/android/RNNitroSQLiteOnLoad.cpp +2 -4
  66. package/nitrogen/generated/android/RNNitroSQLiteOnLoad.hpp +1 -1
  67. package/nitrogen/generated/android/c++/JHybridNitroSQLiteOnLoadSpec.cpp +14 -1
  68. package/nitrogen/generated/android/c++/JHybridNitroSQLiteOnLoadSpec.hpp +4 -1
  69. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rnnitrosqlite/HybridNitroSQLiteOnLoadSpec.kt +8 -3
  70. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rnnitrosqlite/RNNitroSQLiteOnLoad.kt +1 -1
  71. package/nitrogen/generated/ios/RNNitroSQLite+autolinking.rb +2 -2
  72. package/nitrogen/generated/ios/RNNitroSQLite-Swift-Cxx-Bridge.cpp +1 -1
  73. package/nitrogen/generated/ios/RNNitroSQLite-Swift-Cxx-Bridge.hpp +1 -1
  74. package/nitrogen/generated/ios/RNNitroSQLite-Swift-Cxx-Umbrella.hpp +1 -1
  75. package/nitrogen/generated/ios/RNNitroSQLiteAutolinking.mm +1 -1
  76. package/nitrogen/generated/ios/RNNitroSQLiteAutolinking.swift +5 -1
  77. package/nitrogen/generated/shared/c++/BatchQueryCommand.hpp +92 -0
  78. package/nitrogen/generated/shared/c++/BatchQueryResult.hpp +25 -11
  79. package/nitrogen/generated/shared/c++/ColumnType.hpp +5 -7
  80. package/nitrogen/generated/shared/c++/FileLoadResult.hpp +28 -14
  81. package/nitrogen/generated/shared/c++/HybridNitroSQLiteOnLoadSpec.cpp +1 -1
  82. package/nitrogen/generated/shared/c++/HybridNitroSQLiteOnLoadSpec.hpp +1 -1
  83. package/nitrogen/generated/shared/c++/HybridNitroSQLiteQueryResultSpec.cpp +24 -0
  84. package/nitrogen/generated/shared/c++/HybridNitroSQLiteQueryResultSpec.hpp +73 -0
  85. package/nitrogen/generated/shared/c++/HybridNitroSQLiteSpec.cpp +1 -1
  86. package/nitrogen/generated/shared/c++/HybridNitroSQLiteSpec.hpp +12 -16
  87. package/nitrogen/generated/shared/c++/NitroSQLiteQueryColumnMetadata.hpp +93 -0
  88. package/package.json +5 -5
  89. package/src/index.ts +0 -6
  90. package/src/operations/execute.ts +23 -58
  91. package/src/operations/executeBatch.ts +3 -41
  92. package/src/operations/session.ts +1 -1
  93. package/src/operations/transaction.ts +1 -1
  94. package/src/specs/NitroSQLite.nitro.ts +9 -12
  95. package/src/specs/{NativeQueryResult.nitro.ts → NitroSQLiteQueryResult.nitro.ts} +15 -17
  96. package/src/typeORM.ts +1 -1
  97. package/src/types.ts +28 -45
  98. package/cpp/specs/HybridNativeQueryResult.cpp +0 -21
  99. package/cpp/specs/HybridNativeQueryResult.hpp +0 -27
  100. package/lib/commonjs/nullHandling.js +0 -33
  101. package/lib/commonjs/nullHandling.js.map +0 -1
  102. package/lib/commonjs/specs/NativeQueryResult.nitro.js.map +0 -1
  103. package/lib/module/nullHandling.js +0 -25
  104. package/lib/module/nullHandling.js.map +0 -1
  105. package/lib/module/specs/NativeQueryResult.nitro.js +0 -4
  106. package/lib/module/specs/NativeQueryResult.nitro.js.map +0 -1
  107. package/lib/typescript/commonjs/nullHandling.d.ts +0 -8
  108. package/lib/typescript/commonjs/nullHandling.d.ts.map +0 -1
  109. package/lib/typescript/commonjs/specs/NativeQueryResult.nitro.d.ts.map +0 -1
  110. package/lib/typescript/module/nullHandling.d.ts +0 -8
  111. package/lib/typescript/module/nullHandling.d.ts.map +0 -1
  112. package/lib/typescript/module/specs/NativeQueryResult.nitro.d.ts.map +0 -1
  113. package/nitrogen/generated/shared/c++/HybridNativeQueryResultSpec.cpp +0 -24
  114. package/nitrogen/generated/shared/c++/HybridNativeQueryResultSpec.hpp +0 -77
  115. package/nitrogen/generated/shared/c++/NativeBatchQueryCommand.hpp +0 -81
  116. package/nitrogen/generated/shared/c++/SQLiteNullValue.hpp +0 -69
  117. package/nitrogen/generated/shared/c++/SQLiteQueryColumnMetadata.hpp +0 -79
  118. 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
@@ -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
- }