react-native-nitro-sqlite 8.2.1-nitro.1
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/RNNitroSQLite.podspec +59 -0
- package/android/.gradle/8.9/checksums/checksums.lock +0 -0
- package/android/.gradle/8.9/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/8.9/fileChanges/last-build.bin +0 -0
- package/android/.gradle/8.9/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/8.9/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/CMakeLists.txt +38 -0
- package/android/build.gradle +119 -0
- package/android/src/main/AndroidManifest.xml +4 -0
- package/android/src/main/cpp/cpp-adapter.cpp +21 -0
- package/android/src/main/java/com/margelo/rnnitrosqlite/RNNitroSQLiteOnLoadModule.java +57 -0
- package/android/src/main/java/com/margelo/rnnitrosqlite/RNNitroSQLitePackage.java +48 -0
- package/cpp/NitroSQLiteException.hpp +63 -0
- package/cpp/ThreadPool.cpp +91 -0
- package/cpp/ThreadPool.hpp +50 -0
- package/cpp/importSqlFile.cpp +48 -0
- package/cpp/importSqlFile.hpp +15 -0
- package/cpp/logs.hpp +38 -0
- package/cpp/macros.hpp +13 -0
- package/cpp/operations.cpp +296 -0
- package/cpp/operations.hpp +24 -0
- package/cpp/specs/HybridNativeQueryResult.cpp +20 -0
- package/cpp/specs/HybridNativeQueryResult.hpp +35 -0
- package/cpp/specs/HybridNitroSQLite.cpp +132 -0
- package/cpp/specs/HybridNitroSQLite.hpp +36 -0
- package/cpp/sqlite/sqlite3.c +237594 -0
- package/cpp/sqlite/sqlite3.h +12556 -0
- package/cpp/sqliteExecuteBatch.cpp +70 -0
- package/cpp/sqliteExecuteBatch.hpp +30 -0
- package/cpp/types.hpp +53 -0
- package/cpp/utils.hpp +61 -0
- package/ios/NitroSQLite.xcodeproj/project.pbxproj +447 -0
- package/ios/OnLoad.mm +41 -0
- package/ios/RNNitroSQLite-Swift.h +1 -0
- package/lib/commonjs/index.js +58 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/nitro.js +10 -0
- package/lib/commonjs/nitro.js.map +1 -0
- package/lib/commonjs/operations/execute.js +35 -0
- package/lib/commonjs/operations/execute.js.map +1 -0
- package/lib/commonjs/operations/session.js +39 -0
- package/lib/commonjs/operations/session.js.map +1 -0
- package/lib/commonjs/operations/transaction.js +95 -0
- package/lib/commonjs/operations/transaction.js.map +1 -0
- package/lib/commonjs/specs/NativeNitroSQLiteOnLoad.ios.js +11 -0
- package/lib/commonjs/specs/NativeNitroSQLiteOnLoad.ios.js.map +1 -0
- package/lib/commonjs/specs/NativeNitroSQLiteOnLoad.js +9 -0
- package/lib/commonjs/specs/NativeNitroSQLiteOnLoad.js.map +1 -0
- package/lib/commonjs/specs/NativeQueryResult.nitro.js +6 -0
- package/lib/commonjs/specs/NativeQueryResult.nitro.js.map +1 -0
- package/lib/commonjs/specs/NitroSQLite.nitro.js +6 -0
- package/lib/commonjs/specs/NitroSQLite.nitro.js.map +1 -0
- package/lib/commonjs/typeORM.js +62 -0
- package/lib/commonjs/typeORM.js.map +1 -0
- package/lib/commonjs/types.js +35 -0
- package/lib/commonjs/types.js.map +1 -0
- package/lib/module/index.js +23 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/nitro.js +4 -0
- package/lib/module/nitro.js.map +1 -0
- package/lib/module/operations/execute.js +28 -0
- package/lib/module/operations/execute.js.map +1 -0
- package/lib/module/operations/session.js +31 -0
- package/lib/module/operations/session.js.map +1 -0
- package/lib/module/operations/transaction.js +88 -0
- package/lib/module/operations/transaction.js.map +1 -0
- package/lib/module/specs/NativeNitroSQLiteOnLoad.ios.js +5 -0
- package/lib/module/specs/NativeNitroSQLiteOnLoad.ios.js.map +1 -0
- package/lib/module/specs/NativeNitroSQLiteOnLoad.js +3 -0
- package/lib/module/specs/NativeNitroSQLiteOnLoad.js.map +1 -0
- package/lib/module/specs/NativeQueryResult.nitro.js +2 -0
- package/lib/module/specs/NativeQueryResult.nitro.js.map +1 -0
- package/lib/module/specs/NitroSQLite.nitro.js +2 -0
- package/lib/module/specs/NitroSQLite.nitro.js.map +1 -0
- package/lib/module/typeORM.js +54 -0
- package/lib/module/typeORM.js.map +1 -0
- package/lib/module/types.js +33 -0
- package/lib/module/types.js.map +1 -0
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/lib/typescript/index.d.ts +30 -0
- package/lib/typescript/nitro.d.ts +7 -0
- package/lib/typescript/operations/execute.d.ts +3 -0
- package/lib/typescript/operations/session.d.ts +4 -0
- package/lib/typescript/operations/transaction.d.ts +5 -0
- package/lib/typescript/specs/NativeNitroSQLiteOnLoad.d.ts +6 -0
- package/lib/typescript/specs/NativeNitroSQLiteOnLoad.ios.d.ts +3 -0
- package/lib/typescript/specs/NativeQueryResult.nitro.d.ts +37 -0
- package/lib/typescript/specs/NitroSQLite.nitro.d.ts +19 -0
- package/lib/typescript/typeORM.d.ts +19 -0
- package/lib/typescript/types.d.ts +79 -0
- package/nitrogen/generated/android/RNNitroSQLite+autolinking.cmake +48 -0
- package/nitrogen/generated/android/RNNitroSQLite+autolinking.gradle +25 -0
- package/nitrogen/generated/android/RNNitroSQLiteOnLoad.cpp +40 -0
- package/nitrogen/generated/android/RNNitroSQLiteOnLoad.hpp +25 -0
- package/nitrogen/generated/android/RNNitroSQLiteOnLoad.kt +1 -0
- package/nitrogen/generated/ios/RNNitroSQLite+autolinking.rb +56 -0
- package/nitrogen/generated/ios/RNNitroSQLite-Swift-Cxx-Bridge.cpp +8 -0
- package/nitrogen/generated/ios/RNNitroSQLite-Swift-Cxx-Bridge.hpp +303 -0
- package/nitrogen/generated/ios/RNNitroSQLite-Swift-Cxx-Umbrella.hpp +67 -0
- package/nitrogen/generated/ios/RNNitroSQLiteAutolinking.mm +35 -0
- package/nitrogen/generated/ios/RNNitroSQLiteAutolinking.swift +10 -0
- package/nitrogen/generated/shared/c++/BatchQueryCommand.hpp +77 -0
- package/nitrogen/generated/shared/c++/BatchQueryResult.hpp +68 -0
- package/nitrogen/generated/shared/c++/ColumnType.hpp +68 -0
- package/nitrogen/generated/shared/c++/FileLoadResult.hpp +72 -0
- package/nitrogen/generated/shared/c++/HybridNativeQueryResultSpec.cpp +24 -0
- package/nitrogen/generated/shared/c++/HybridNativeQueryResultSpec.hpp +74 -0
- package/nitrogen/generated/shared/c++/HybridNitroSQLiteSpec.cpp +31 -0
- package/nitrogen/generated/shared/c++/HybridNitroSQLiteSpec.hpp +91 -0
- package/nitrogen/generated/shared/c++/SQLiteQueryColumnMetadata.hpp +78 -0
- package/package.json +98 -0
- package/src/index.ts +26 -0
- package/src/nitro.ts +11 -0
- package/src/operations/execute.ts +45 -0
- package/src/operations/session.ts +58 -0
- package/src/operations/transaction.ts +137 -0
- package/src/specs/NativeNitroSQLiteOnLoad.ios.ts +7 -0
- package/src/specs/NativeNitroSQLiteOnLoad.ts +7 -0
- package/src/specs/NativeQueryResult.nitro.ts +44 -0
- package/src/specs/NitroSQLite.nitro.ts +39 -0
- package/src/typeORM.ts +101 -0
- package/src/types.ts +105 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
export interface NitroSQLiteConnectionOptions {
|
|
2
|
+
name: string;
|
|
3
|
+
location?: string;
|
|
4
|
+
}
|
|
5
|
+
export interface NitroSQLiteConnection {
|
|
6
|
+
close(): void;
|
|
7
|
+
delete(): void;
|
|
8
|
+
attach(dbNameToAttach: string, alias: string, location?: string): void;
|
|
9
|
+
detach(alias: string): void;
|
|
10
|
+
transaction(fn: (tx: Transaction) => Promise<void> | void): Promise<void>;
|
|
11
|
+
execute: ExecuteQuery;
|
|
12
|
+
executeAsync: ExecuteAsyncQuery;
|
|
13
|
+
executeBatch(commands: BatchQueryCommand[]): BatchQueryResult;
|
|
14
|
+
executeBatchAsync(commands: BatchQueryCommand[]): Promise<BatchQueryResult>;
|
|
15
|
+
loadFile(location: string): FileLoadResult;
|
|
16
|
+
loadFileAsync(location: string): Promise<FileLoadResult>;
|
|
17
|
+
}
|
|
18
|
+
export declare enum ColumnType {
|
|
19
|
+
BOOLEAN = 0,
|
|
20
|
+
NUMBER = 1,
|
|
21
|
+
INT64 = 2,
|
|
22
|
+
TEXT = 3,
|
|
23
|
+
ARRAY_BUFFER = 4,
|
|
24
|
+
NULL_VALUE = 5
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Represents a value that can be stored in a SQLite database
|
|
28
|
+
*/
|
|
29
|
+
export type SQLiteValue = boolean | number | bigint | string | ArrayBuffer | undefined;
|
|
30
|
+
export type SQLiteItem = Record<string, SQLiteValue>;
|
|
31
|
+
export interface QueryResult<RowData extends SQLiteItem = SQLiteItem> {
|
|
32
|
+
readonly insertId?: number;
|
|
33
|
+
readonly rowsAffected: number;
|
|
34
|
+
readonly rows?: {
|
|
35
|
+
/** Raw array with all dataset */
|
|
36
|
+
_array: RowData[];
|
|
37
|
+
/** The lengh of the dataset */
|
|
38
|
+
length: number;
|
|
39
|
+
/** A convenience function to acess the index based the row object
|
|
40
|
+
* @param idx the row index
|
|
41
|
+
* @returns the row structure identified by column names
|
|
42
|
+
*/
|
|
43
|
+
item: (idx: number) => RowData | undefined;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
export type SQLiteQueryParams = SQLiteValue[];
|
|
47
|
+
export type ExecuteQuery = <RowData extends SQLiteItem = SQLiteItem>(query: string, params?: SQLiteQueryParams) => QueryResult<RowData>;
|
|
48
|
+
export type ExecuteAsyncQuery = <RowData extends SQLiteItem = SQLiteItem>(query: string, params?: SQLiteQueryParams) => Promise<QueryResult<RowData>>;
|
|
49
|
+
export interface Transaction {
|
|
50
|
+
commit(): QueryResult;
|
|
51
|
+
rollback(): QueryResult;
|
|
52
|
+
execute: ExecuteQuery;
|
|
53
|
+
executeAsync: ExecuteAsyncQuery;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Allows the execution of bulk of sql commands
|
|
57
|
+
* inside a transaction
|
|
58
|
+
* If a single query must be executed many times with different arguments, its preferred
|
|
59
|
+
* to declare it a single time, and use an array of array parameters.
|
|
60
|
+
*/
|
|
61
|
+
export interface BatchQueryCommand {
|
|
62
|
+
query: string;
|
|
63
|
+
params?: SQLiteQueryParams | SQLiteQueryParams[];
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* status: 0 or undefined for correct execution, 1 for error
|
|
67
|
+
* message: if status === 1, here you will find error description
|
|
68
|
+
* rowsAffected: Number of affected rows if status == 0
|
|
69
|
+
*/
|
|
70
|
+
export interface BatchQueryResult {
|
|
71
|
+
rowsAffected?: number;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Result of loading a file and executing every line as a SQL command
|
|
75
|
+
* Similar to BatchQueryResult
|
|
76
|
+
*/
|
|
77
|
+
export interface FileLoadResult extends BatchQueryResult {
|
|
78
|
+
commands?: number;
|
|
79
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
#
|
|
2
|
+
# RNNitroSQLite+autolinking.cmake
|
|
3
|
+
# This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
# https://github.com/mrousavy/nitro
|
|
5
|
+
# Copyright © 2024 Marc Rousavy @ Margelo
|
|
6
|
+
#
|
|
7
|
+
|
|
8
|
+
# This is a CMake file that adds all files generated by Nitrogen
|
|
9
|
+
# to the current CMake project.
|
|
10
|
+
#
|
|
11
|
+
# To use it, add this to your CMakeLists.txt:
|
|
12
|
+
# ```cmake
|
|
13
|
+
# include(${CMAKE_SOURCE_DIR}/../nitrogen/generated/android/RNNitroSQLite+autolinking.cmake)
|
|
14
|
+
# ```
|
|
15
|
+
|
|
16
|
+
# Add all headers that were generated by Nitrogen
|
|
17
|
+
include_directories(
|
|
18
|
+
"../nitrogen/generated/shared/c++"
|
|
19
|
+
"../nitrogen/generated/android/c++"
|
|
20
|
+
"../nitrogen/generated/android/"
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
# Add all .cpp sources that were generated by Nitrogen
|
|
24
|
+
target_sources(
|
|
25
|
+
# CMake project name (Android C++ library name)
|
|
26
|
+
RNNitroSQLite PRIVATE
|
|
27
|
+
# Autolinking Setup
|
|
28
|
+
../nitrogen/generated/android/RNNitroSQLiteOnLoad.cpp
|
|
29
|
+
# Shared Nitrogen C++ sources
|
|
30
|
+
../nitrogen/generated/shared/c++/HybridNativeQueryResultSpec.cpp
|
|
31
|
+
../nitrogen/generated/shared/c++/HybridNitroSQLiteSpec.cpp
|
|
32
|
+
# Android-specific Nitrogen C++ sources
|
|
33
|
+
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
# Add all libraries required by the generated specs
|
|
37
|
+
find_package(fbjni REQUIRED) # <-- Used for communication between Java <-> C++
|
|
38
|
+
find_package(ReactAndroid REQUIRED) # <-- Used to set up React Native bindings (e.g. CallInvoker/TurboModule)
|
|
39
|
+
find_package(react-native-nitro-modules REQUIRED) # <-- Used to create all HybridObjects and use the Nitro core library
|
|
40
|
+
|
|
41
|
+
# Link all libraries together
|
|
42
|
+
target_link_libraries(
|
|
43
|
+
RNNitroSQLite
|
|
44
|
+
fbjni::fbjni # <-- Facebook C++ JNI helpers
|
|
45
|
+
ReactAndroid::jsi # <-- RN: JSI
|
|
46
|
+
ReactAndroid::react_nativemodule_core # <-- RN: TurboModules Core
|
|
47
|
+
react-native-nitro-modules::NitroModules # <-- NitroModules Core :)
|
|
48
|
+
)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RNNitroSQLite+autolinking.gradle
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2024 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
/// This is a Gradle file that adds all files generated by Nitrogen
|
|
9
|
+
/// to the current Gradle project.
|
|
10
|
+
///
|
|
11
|
+
/// To use it, add this to your build.gradle:
|
|
12
|
+
/// ```gradle
|
|
13
|
+
/// apply from: '../nitrogen/generated/android/RNNitroSQLite+autolinking.gradle'
|
|
14
|
+
/// ```
|
|
15
|
+
|
|
16
|
+
android {
|
|
17
|
+
sourceSets {
|
|
18
|
+
main {
|
|
19
|
+
java.srcDirs += [
|
|
20
|
+
// Nitrogen files
|
|
21
|
+
"${project.projectDir}/../nitrogen/generated/android/kotlin"
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RNNitroSQLiteOnLoad.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2024 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include "RNNitroSQLiteOnLoad.hpp"
|
|
9
|
+
|
|
10
|
+
#include <jni.h>
|
|
11
|
+
#include <fbjni/fbjni.h>
|
|
12
|
+
#include <NitroModules/HybridObjectRegistry.hpp>
|
|
13
|
+
|
|
14
|
+
#include "HybridNitroSQLite.hpp"
|
|
15
|
+
|
|
16
|
+
namespace margelo::nitro::rnnitrosqlite {
|
|
17
|
+
|
|
18
|
+
int initialize(JavaVM* vm) {
|
|
19
|
+
using namespace margelo::nitro;
|
|
20
|
+
using namespace margelo::nitro::rnnitrosqlite;
|
|
21
|
+
using namespace facebook;
|
|
22
|
+
|
|
23
|
+
return facebook::jni::initialize(vm, [] {
|
|
24
|
+
// Register native JNI methods
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
// Register Nitro Hybrid Objects
|
|
28
|
+
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
29
|
+
"NitroSQLite",
|
|
30
|
+
[]() -> std::shared_ptr<HybridObject> {
|
|
31
|
+
static_assert(std::is_default_constructible_v<HybridNitroSQLite>,
|
|
32
|
+
"The HybridObject \"HybridNitroSQLite\" is not default-constructible! "
|
|
33
|
+
"Create a public constructor that takes zero arguments to be able to autolink this HybridObject.");
|
|
34
|
+
return std::make_shared<HybridNitroSQLite>();
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
} // namespace margelo::nitro::rnnitrosqlite
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RNNitroSQLiteOnLoad.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2024 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include <jni.h>
|
|
9
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
10
|
+
|
|
11
|
+
namespace margelo::nitro::rnnitrosqlite {
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Initializes the native (C++) part of RNNitroSQLite, and autolinks all Hybrid Objects.
|
|
15
|
+
* Call this in your `JNI_OnLoad` function (probably inside `cpp-adapter.cpp`).
|
|
16
|
+
* Example:
|
|
17
|
+
* ```cpp (cpp-adapter.cpp)
|
|
18
|
+
* JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void*) {
|
|
19
|
+
* return margelo::nitro::rnnitrosqlite::initialize(vm);
|
|
20
|
+
* }
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
int initialize(JavaVM* vm);
|
|
24
|
+
|
|
25
|
+
} // namespace margelo::nitro::rnnitrosqlite
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
#
|
|
2
|
+
# RNNitroSQLite+autolinking.rb
|
|
3
|
+
# This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
# https://github.com/mrousavy/nitro
|
|
5
|
+
# Copyright © 2024 Marc Rousavy @ Margelo
|
|
6
|
+
#
|
|
7
|
+
|
|
8
|
+
# This is a Ruby script that adds all files generated by Nitrogen
|
|
9
|
+
# to the given podspec.
|
|
10
|
+
#
|
|
11
|
+
# To use it, add this to your .podspec:
|
|
12
|
+
# ```ruby
|
|
13
|
+
# Pod::Spec.new do |spec|
|
|
14
|
+
# # ...
|
|
15
|
+
#
|
|
16
|
+
# # Add all files generated by Nitrogen
|
|
17
|
+
# load 'nitrogen/generated/ios/RNNitroSQLite+autolinking.rb'
|
|
18
|
+
# add_nitrogen_files(spec)
|
|
19
|
+
# end
|
|
20
|
+
# ```
|
|
21
|
+
|
|
22
|
+
def add_nitrogen_files(spec)
|
|
23
|
+
Pod::UI.puts "[NitroModules] Adding RNNitroSQLite specs..."
|
|
24
|
+
|
|
25
|
+
spec.dependency "NitroModules"
|
|
26
|
+
|
|
27
|
+
current_source_files = spec.attributes_hash['source_files'] || []
|
|
28
|
+
spec.source_files = current_source_files + [
|
|
29
|
+
# Generated cross-platform specs
|
|
30
|
+
"nitrogen/generated/shared/**/*.{h,hpp,c,cpp,swift}",
|
|
31
|
+
# Generated bridges for the cross-platform specs
|
|
32
|
+
"nitrogen/generated/ios/**/*.{h,hpp,c,cpp,mm,swift}",
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
current_public_header_files = spec.attributes_hash['public_header_files'] || []
|
|
36
|
+
spec.public_header_files = current_public_header_files + [
|
|
37
|
+
# Generated specs
|
|
38
|
+
"nitrogen/generated/shared/**/*.{h,hpp}",
|
|
39
|
+
# Swift to C++ bridging helpers
|
|
40
|
+
"nitrogen/generated/ios/RNNitroSQLite-Swift-Cxx-Bridge.hpp"
|
|
41
|
+
]
|
|
42
|
+
|
|
43
|
+
current_private_header_files = spec.attributes_hash['private_header_files'] || []
|
|
44
|
+
spec.private_header_files = current_private_header_files + [
|
|
45
|
+
# iOS specific specs
|
|
46
|
+
"nitrogen/generated/ios/c++/**/*.{h,hpp}",
|
|
47
|
+
]
|
|
48
|
+
|
|
49
|
+
current_pod_target_xcconfig = spec.attributes_hash['pod_target_xcconfig'] || {}
|
|
50
|
+
spec.pod_target_xcconfig = current_pod_target_xcconfig.merge({
|
|
51
|
+
# Use C++ 20
|
|
52
|
+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
|
|
53
|
+
# Enables C++ <-> Swift interop (by default it's only C)
|
|
54
|
+
"SWIFT_OBJC_INTEROP_MODE" => "objcxx",
|
|
55
|
+
})
|
|
56
|
+
end
|
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RNNitroSQLite-Swift-Cxx-Bridge.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2024 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
// Forward declarations of C++ defined types
|
|
11
|
+
// Forward declaration of `ArrayBufferHolder` to properly resolve imports.
|
|
12
|
+
namespace NitroModules { class ArrayBufferHolder; }
|
|
13
|
+
// Forward declaration of `ArrayBuffer` to properly resolve imports.
|
|
14
|
+
namespace NitroModules { class ArrayBuffer; }
|
|
15
|
+
// Forward declaration of `BatchQueryCommand` to properly resolve imports.
|
|
16
|
+
namespace margelo::nitro::rnnitrosqlite { struct BatchQueryCommand; }
|
|
17
|
+
// Forward declaration of `BatchQueryResult` to properly resolve imports.
|
|
18
|
+
namespace margelo::nitro::rnnitrosqlite { struct BatchQueryResult; }
|
|
19
|
+
// Forward declaration of `ColumnType` to properly resolve imports.
|
|
20
|
+
namespace margelo::nitro::rnnitrosqlite { enum class ColumnType; }
|
|
21
|
+
// Forward declaration of `FileLoadResult` to properly resolve imports.
|
|
22
|
+
namespace margelo::nitro::rnnitrosqlite { struct FileLoadResult; }
|
|
23
|
+
// Forward declaration of `HybridNativeQueryResultSpecSwift` to properly resolve imports.
|
|
24
|
+
namespace margelo::nitro::rnnitrosqlite { class HybridNativeQueryResultSpecSwift; }
|
|
25
|
+
// Forward declaration of `HybridNativeQueryResultSpec` to properly resolve imports.
|
|
26
|
+
namespace margelo::nitro::rnnitrosqlite { class HybridNativeQueryResultSpec; }
|
|
27
|
+
// Forward declaration of `SQLiteQueryColumnMetadata` to properly resolve imports.
|
|
28
|
+
namespace margelo::nitro::rnnitrosqlite { struct SQLiteQueryColumnMetadata; }
|
|
29
|
+
|
|
30
|
+
// Include C++ defined types
|
|
31
|
+
#if __has_include("BatchQueryCommand.hpp")
|
|
32
|
+
#include "BatchQueryCommand.hpp"
|
|
33
|
+
#endif
|
|
34
|
+
#if __has_include("BatchQueryResult.hpp")
|
|
35
|
+
#include "BatchQueryResult.hpp"
|
|
36
|
+
#endif
|
|
37
|
+
#if __has_include("ColumnType.hpp")
|
|
38
|
+
#include "ColumnType.hpp"
|
|
39
|
+
#endif
|
|
40
|
+
#if __has_include("FileLoadResult.hpp")
|
|
41
|
+
#include "FileLoadResult.hpp"
|
|
42
|
+
#endif
|
|
43
|
+
#if __has_include("HybridNativeQueryResultSpec.hpp")
|
|
44
|
+
#include "HybridNativeQueryResultSpec.hpp"
|
|
45
|
+
#endif
|
|
46
|
+
#if __has_include("HybridNativeQueryResultSpecSwift.hpp")
|
|
47
|
+
#include "HybridNativeQueryResultSpecSwift.hpp"
|
|
48
|
+
#endif
|
|
49
|
+
#if __has_include("SQLiteQueryColumnMetadata.hpp")
|
|
50
|
+
#include "SQLiteQueryColumnMetadata.hpp"
|
|
51
|
+
#endif
|
|
52
|
+
#if __has_include(<NitroModules/ArrayBuffer.hpp>)
|
|
53
|
+
#include <NitroModules/ArrayBuffer.hpp>
|
|
54
|
+
#endif
|
|
55
|
+
#if __has_include(<NitroModules/ArrayBufferHolder.hpp>)
|
|
56
|
+
#include <NitroModules/ArrayBufferHolder.hpp>
|
|
57
|
+
#endif
|
|
58
|
+
#if __has_include(<NitroModules/PromiseHolder.hpp>)
|
|
59
|
+
#include <NitroModules/PromiseHolder.hpp>
|
|
60
|
+
#endif
|
|
61
|
+
#if __has_include(<future>)
|
|
62
|
+
#include <future>
|
|
63
|
+
#endif
|
|
64
|
+
#if __has_include(<memory>)
|
|
65
|
+
#include <memory>
|
|
66
|
+
#endif
|
|
67
|
+
#if __has_include(<optional>)
|
|
68
|
+
#include <optional>
|
|
69
|
+
#endif
|
|
70
|
+
#if __has_include(<string>)
|
|
71
|
+
#include <string>
|
|
72
|
+
#endif
|
|
73
|
+
#if __has_include(<unordered_map>)
|
|
74
|
+
#include <unordered_map>
|
|
75
|
+
#endif
|
|
76
|
+
#if __has_include(<variant>)
|
|
77
|
+
#include <variant>
|
|
78
|
+
#endif
|
|
79
|
+
#if __has_include(<vector>)
|
|
80
|
+
#include <vector>
|
|
81
|
+
#endif
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Contains specialized versions of C++ templated types so they can be accessed from Swift,
|
|
85
|
+
* as well as helper functions to interact with those C++ types from Swift.
|
|
86
|
+
*/
|
|
87
|
+
namespace margelo::nitro::rnnitrosqlite::bridge::swift {
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Specialized version of `std::optional<double>`.
|
|
91
|
+
*/
|
|
92
|
+
using std__optional_double_ = std::optional<double>;
|
|
93
|
+
inline std::optional<double> create_std__optional_double_(const double& value) {
|
|
94
|
+
return std::optional<double>(value);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Wrapper struct for `std::variant<std::string, double, int64_t, bool, std::shared_ptr<ArrayBuffer>>`.
|
|
99
|
+
* std::variant cannot be used in Swift because of a Swift bug.
|
|
100
|
+
* Not even specializing it works. So we create a wrapper struct.
|
|
101
|
+
*/
|
|
102
|
+
struct std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer__ {
|
|
103
|
+
std::variant<std::string, double, int64_t, bool, std::shared_ptr<ArrayBuffer>> variant;
|
|
104
|
+
std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer__(std::variant<std::string, double, int64_t, bool, std::shared_ptr<ArrayBuffer>> variant): variant(variant) { }
|
|
105
|
+
operator std::variant<std::string, double, int64_t, bool, std::shared_ptr<ArrayBuffer>>() const {
|
|
106
|
+
return variant;
|
|
107
|
+
}
|
|
108
|
+
inline size_t index() const {
|
|
109
|
+
return variant.index();
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
inline std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer__ create_std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer__(const std::string& value) {
|
|
113
|
+
return std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer__(value);
|
|
114
|
+
}
|
|
115
|
+
inline std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer__ create_std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer__(double value) {
|
|
116
|
+
return std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer__(value);
|
|
117
|
+
}
|
|
118
|
+
inline std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer__ create_std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer__(int64_t value) {
|
|
119
|
+
return std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer__(value);
|
|
120
|
+
}
|
|
121
|
+
inline std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer__ create_std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer__(bool value) {
|
|
122
|
+
return std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer__(value);
|
|
123
|
+
}
|
|
124
|
+
inline std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer__ create_std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer__(const std::shared_ptr<ArrayBuffer>& value) {
|
|
125
|
+
return std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer__(value);
|
|
126
|
+
}
|
|
127
|
+
inline std::string get_std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer___0(const std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer__& variantWrapper) {
|
|
128
|
+
return std::get<0>(variantWrapper.variant);
|
|
129
|
+
}
|
|
130
|
+
inline double get_std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer___1(const std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer__& variantWrapper) {
|
|
131
|
+
return std::get<1>(variantWrapper.variant);
|
|
132
|
+
}
|
|
133
|
+
inline int64_t get_std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer___2(const std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer__& variantWrapper) {
|
|
134
|
+
return std::get<2>(variantWrapper.variant);
|
|
135
|
+
}
|
|
136
|
+
inline bool get_std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer___3(const std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer__& variantWrapper) {
|
|
137
|
+
return std::get<3>(variantWrapper.variant);
|
|
138
|
+
}
|
|
139
|
+
inline std::shared_ptr<ArrayBuffer> get_std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer___4(const std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer__& variantWrapper) {
|
|
140
|
+
return std::get<4>(variantWrapper.variant);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Specialized version of `std::unordered_map<std::string, std::variant<std::string, double, int64_t, bool, std::shared_ptr<ArrayBuffer>>>`.
|
|
145
|
+
*/
|
|
146
|
+
using std__unordered_map_std__string__std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer___ = std::unordered_map<std::string, std::variant<std::string, double, int64_t, bool, std::shared_ptr<ArrayBuffer>>>;
|
|
147
|
+
inline std::unordered_map<std::string, std::variant<std::string, double, int64_t, bool, std::shared_ptr<ArrayBuffer>>> create_std__unordered_map_std__string__std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer___(size_t size) {
|
|
148
|
+
std::unordered_map<std::string, std::variant<std::string, double, int64_t, bool, std::shared_ptr<ArrayBuffer>>> map;
|
|
149
|
+
map.reserve(size);
|
|
150
|
+
return map;
|
|
151
|
+
}
|
|
152
|
+
inline std::vector<std::string> get_std__unordered_map_std__string__std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer____keys(const std__unordered_map_std__string__std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer___& map) {
|
|
153
|
+
std::vector<std::string> keys;
|
|
154
|
+
keys.reserve(map.size());
|
|
155
|
+
for (const auto& entry : map) {
|
|
156
|
+
keys.push_back(entry.first);
|
|
157
|
+
}
|
|
158
|
+
return keys;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Specialized version of `std::vector<std::unordered_map<std::string, std::variant<std::string, double, int64_t, bool, std::shared_ptr<ArrayBuffer>>>>`.
|
|
163
|
+
*/
|
|
164
|
+
using std__vector_std__unordered_map_std__string__std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer____ = std::vector<std::unordered_map<std::string, std::variant<std::string, double, int64_t, bool, std::shared_ptr<ArrayBuffer>>>>;
|
|
165
|
+
inline std::vector<std::unordered_map<std::string, std::variant<std::string, double, int64_t, bool, std::shared_ptr<ArrayBuffer>>>> create_std__vector_std__unordered_map_std__string__std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer____(size_t size) {
|
|
166
|
+
std::vector<std::unordered_map<std::string, std::variant<std::string, double, int64_t, bool, std::shared_ptr<ArrayBuffer>>>> vector;
|
|
167
|
+
vector.reserve(size);
|
|
168
|
+
return vector;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Specialized version of `std::unordered_map<std::string, SQLiteQueryColumnMetadata>`.
|
|
173
|
+
*/
|
|
174
|
+
using std__unordered_map_std__string__SQLiteQueryColumnMetadata_ = std::unordered_map<std::string, SQLiteQueryColumnMetadata>;
|
|
175
|
+
inline std::unordered_map<std::string, SQLiteQueryColumnMetadata> create_std__unordered_map_std__string__SQLiteQueryColumnMetadata_(size_t size) {
|
|
176
|
+
std::unordered_map<std::string, SQLiteQueryColumnMetadata> map;
|
|
177
|
+
map.reserve(size);
|
|
178
|
+
return map;
|
|
179
|
+
}
|
|
180
|
+
inline std::vector<std::string> get_std__unordered_map_std__string__SQLiteQueryColumnMetadata__keys(const std__unordered_map_std__string__SQLiteQueryColumnMetadata_& map) {
|
|
181
|
+
std::vector<std::string> keys;
|
|
182
|
+
keys.reserve(map.size());
|
|
183
|
+
for (const auto& entry : map) {
|
|
184
|
+
keys.push_back(entry.first);
|
|
185
|
+
}
|
|
186
|
+
return keys;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Specialized version of `std::optional<std::unordered_map<std::string, SQLiteQueryColumnMetadata>>`.
|
|
191
|
+
*/
|
|
192
|
+
using std__optional_std__unordered_map_std__string__SQLiteQueryColumnMetadata__ = std::optional<std::unordered_map<std::string, SQLiteQueryColumnMetadata>>;
|
|
193
|
+
inline std::optional<std::unordered_map<std::string, SQLiteQueryColumnMetadata>> create_std__optional_std__unordered_map_std__string__SQLiteQueryColumnMetadata__(const std::unordered_map<std::string, SQLiteQueryColumnMetadata>& value) {
|
|
194
|
+
return std::optional<std::unordered_map<std::string, SQLiteQueryColumnMetadata>>(value);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Specialized version of `std::optional<std::string>`.
|
|
199
|
+
*/
|
|
200
|
+
using std__optional_std__string_ = std::optional<std::string>;
|
|
201
|
+
inline std::optional<std::string> create_std__optional_std__string_(const std::string& value) {
|
|
202
|
+
return std::optional<std::string>(value);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Specialized version of `std::vector<std::variant<std::string, double, int64_t, bool, std::shared_ptr<ArrayBuffer>>>`.
|
|
207
|
+
*/
|
|
208
|
+
using std__vector_std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer___ = std::vector<std::variant<std::string, double, int64_t, bool, std::shared_ptr<ArrayBuffer>>>;
|
|
209
|
+
inline std::vector<std::variant<std::string, double, int64_t, bool, std::shared_ptr<ArrayBuffer>>> create_std__vector_std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer___(size_t size) {
|
|
210
|
+
std::vector<std::variant<std::string, double, int64_t, bool, std::shared_ptr<ArrayBuffer>>> vector;
|
|
211
|
+
vector.reserve(size);
|
|
212
|
+
return vector;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Specialized version of `std::optional<std::vector<std::variant<std::string, double, int64_t, bool, std::shared_ptr<ArrayBuffer>>>>`.
|
|
217
|
+
*/
|
|
218
|
+
using std__optional_std__vector_std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer____ = std::optional<std::vector<std::variant<std::string, double, int64_t, bool, std::shared_ptr<ArrayBuffer>>>>;
|
|
219
|
+
inline std::optional<std::vector<std::variant<std::string, double, int64_t, bool, std::shared_ptr<ArrayBuffer>>>> create_std__optional_std__vector_std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer____(const std::vector<std::variant<std::string, double, int64_t, bool, std::shared_ptr<ArrayBuffer>>>& value) {
|
|
220
|
+
return std::optional<std::vector<std::variant<std::string, double, int64_t, bool, std::shared_ptr<ArrayBuffer>>>>(value);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Specialized version of `PromiseHolder<std::shared_ptr<margelo::nitro::rnnitrosqlite::HybridNativeQueryResultSpec>>`.
|
|
225
|
+
*/
|
|
226
|
+
using PromiseHolder_std__shared_ptr_margelo__nitro__rnnitrosqlite__HybridNativeQueryResultSpec__ = PromiseHolder<std::shared_ptr<margelo::nitro::rnnitrosqlite::HybridNativeQueryResultSpec>>;
|
|
227
|
+
inline PromiseHolder<std::shared_ptr<margelo::nitro::rnnitrosqlite::HybridNativeQueryResultSpec>> create_PromiseHolder_std__shared_ptr_margelo__nitro__rnnitrosqlite__HybridNativeQueryResultSpec__() {
|
|
228
|
+
return PromiseHolder<std::shared_ptr<margelo::nitro::rnnitrosqlite::HybridNativeQueryResultSpec>>();
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Specialized version of `std::vector<std::vector<std::variant<std::string, double, int64_t, bool, std::shared_ptr<ArrayBuffer>>>>`.
|
|
233
|
+
*/
|
|
234
|
+
using std__vector_std__vector_std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer____ = std::vector<std::vector<std::variant<std::string, double, int64_t, bool, std::shared_ptr<ArrayBuffer>>>>;
|
|
235
|
+
inline std::vector<std::vector<std::variant<std::string, double, int64_t, bool, std::shared_ptr<ArrayBuffer>>>> create_std__vector_std__vector_std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer____(size_t size) {
|
|
236
|
+
std::vector<std::vector<std::variant<std::string, double, int64_t, bool, std::shared_ptr<ArrayBuffer>>>> vector;
|
|
237
|
+
vector.reserve(size);
|
|
238
|
+
return vector;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* Wrapper struct for `std::variant<std::vector<std::variant<std::string, double, int64_t, bool, std::shared_ptr<ArrayBuffer>>>, std::vector<std::vector<std::variant<std::string, double, int64_t, bool, std::shared_ptr<ArrayBuffer>>>>>`.
|
|
243
|
+
* std::variant cannot be used in Swift because of a Swift bug.
|
|
244
|
+
* Not even specializing it works. So we create a wrapper struct.
|
|
245
|
+
*/
|
|
246
|
+
struct std__variant_std__vector_std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer_____std__vector_std__vector_std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer_____ {
|
|
247
|
+
std::variant<std::vector<std::variant<std::string, double, int64_t, bool, std::shared_ptr<ArrayBuffer>>>, std::vector<std::vector<std::variant<std::string, double, int64_t, bool, std::shared_ptr<ArrayBuffer>>>>> variant;
|
|
248
|
+
std__variant_std__vector_std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer_____std__vector_std__vector_std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer_____(std::variant<std::vector<std::variant<std::string, double, int64_t, bool, std::shared_ptr<ArrayBuffer>>>, std::vector<std::vector<std::variant<std::string, double, int64_t, bool, std::shared_ptr<ArrayBuffer>>>>> variant): variant(variant) { }
|
|
249
|
+
operator std::variant<std::vector<std::variant<std::string, double, int64_t, bool, std::shared_ptr<ArrayBuffer>>>, std::vector<std::vector<std::variant<std::string, double, int64_t, bool, std::shared_ptr<ArrayBuffer>>>>>() const {
|
|
250
|
+
return variant;
|
|
251
|
+
}
|
|
252
|
+
inline size_t index() const {
|
|
253
|
+
return variant.index();
|
|
254
|
+
}
|
|
255
|
+
};
|
|
256
|
+
inline std__variant_std__vector_std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer_____std__vector_std__vector_std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer_____ create_std__variant_std__vector_std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer_____std__vector_std__vector_std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer_____(const std::vector<std::variant<std::string, double, int64_t, bool, std::shared_ptr<ArrayBuffer>>>& value) {
|
|
257
|
+
return std__variant_std__vector_std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer_____std__vector_std__vector_std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer_____(value);
|
|
258
|
+
}
|
|
259
|
+
inline std__variant_std__vector_std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer_____std__vector_std__vector_std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer_____ create_std__variant_std__vector_std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer_____std__vector_std__vector_std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer_____(const std::vector<std::vector<std::variant<std::string, double, int64_t, bool, std::shared_ptr<ArrayBuffer>>>>& value) {
|
|
260
|
+
return std__variant_std__vector_std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer_____std__vector_std__vector_std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer_____(value);
|
|
261
|
+
}
|
|
262
|
+
inline std::vector<std::variant<std::string, double, int64_t, bool, std::shared_ptr<ArrayBuffer>>> get_std__variant_std__vector_std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer_____std__vector_std__vector_std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer______0(const std__variant_std__vector_std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer_____std__vector_std__vector_std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer_____& variantWrapper) {
|
|
263
|
+
return std::get<0>(variantWrapper.variant);
|
|
264
|
+
}
|
|
265
|
+
inline std::vector<std::vector<std::variant<std::string, double, int64_t, bool, std::shared_ptr<ArrayBuffer>>>> get_std__variant_std__vector_std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer_____std__vector_std__vector_std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer______1(const std__variant_std__vector_std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer_____std__vector_std__vector_std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer_____& variantWrapper) {
|
|
266
|
+
return std::get<1>(variantWrapper.variant);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Specialized version of `std::optional<std::variant<std::vector<std::variant<std::string, double, int64_t, bool, std::shared_ptr<ArrayBuffer>>>, std::vector<std::vector<std::variant<std::string, double, int64_t, bool, std::shared_ptr<ArrayBuffer>>>>>>`.
|
|
271
|
+
*/
|
|
272
|
+
using std__optional_std__variant_std__vector_std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer_____std__vector_std__vector_std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer______ = std::optional<std::variant<std::vector<std::variant<std::string, double, int64_t, bool, std::shared_ptr<ArrayBuffer>>>, std::vector<std::vector<std::variant<std::string, double, int64_t, bool, std::shared_ptr<ArrayBuffer>>>>>>;
|
|
273
|
+
inline std::optional<std::variant<std::vector<std::variant<std::string, double, int64_t, bool, std::shared_ptr<ArrayBuffer>>>, std::vector<std::vector<std::variant<std::string, double, int64_t, bool, std::shared_ptr<ArrayBuffer>>>>>> create_std__optional_std__variant_std__vector_std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer_____std__vector_std__vector_std__variant_std__string__double__int64_t__bool__std__shared_ptr_ArrayBuffer______(const std::variant<std::vector<std::variant<std::string, double, int64_t, bool, std::shared_ptr<ArrayBuffer>>>, std::vector<std::vector<std::variant<std::string, double, int64_t, bool, std::shared_ptr<ArrayBuffer>>>>>& value) {
|
|
274
|
+
return std::optional<std::variant<std::vector<std::variant<std::string, double, int64_t, bool, std::shared_ptr<ArrayBuffer>>>, std::vector<std::vector<std::variant<std::string, double, int64_t, bool, std::shared_ptr<ArrayBuffer>>>>>>(value);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* Specialized version of `std::vector<BatchQueryCommand>`.
|
|
279
|
+
*/
|
|
280
|
+
using std__vector_BatchQueryCommand_ = std::vector<BatchQueryCommand>;
|
|
281
|
+
inline std::vector<BatchQueryCommand> create_std__vector_BatchQueryCommand_(size_t size) {
|
|
282
|
+
std::vector<BatchQueryCommand> vector;
|
|
283
|
+
vector.reserve(size);
|
|
284
|
+
return vector;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* Specialized version of `PromiseHolder<BatchQueryResult>`.
|
|
289
|
+
*/
|
|
290
|
+
using PromiseHolder_BatchQueryResult_ = PromiseHolder<BatchQueryResult>;
|
|
291
|
+
inline PromiseHolder<BatchQueryResult> create_PromiseHolder_BatchQueryResult_() {
|
|
292
|
+
return PromiseHolder<BatchQueryResult>();
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* Specialized version of `PromiseHolder<FileLoadResult>`.
|
|
297
|
+
*/
|
|
298
|
+
using PromiseHolder_FileLoadResult_ = PromiseHolder<FileLoadResult>;
|
|
299
|
+
inline PromiseHolder<FileLoadResult> create_PromiseHolder_FileLoadResult_() {
|
|
300
|
+
return PromiseHolder<FileLoadResult>();
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
} // namespace margelo::nitro::rnnitrosqlite::bridge::swift
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RNNitroSQLite-Swift-Cxx-Umbrella.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2024 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
// Forward declarations of C++ defined types
|
|
11
|
+
// Forward declaration of `ArrayBuffer` to properly resolve imports.
|
|
12
|
+
namespace NitroModules { class ArrayBuffer; }
|
|
13
|
+
// Forward declaration of `BatchQueryCommand` to properly resolve imports.
|
|
14
|
+
namespace margelo::nitro::rnnitrosqlite { struct BatchQueryCommand; }
|
|
15
|
+
// Forward declaration of `BatchQueryResult` to properly resolve imports.
|
|
16
|
+
namespace margelo::nitro::rnnitrosqlite { struct BatchQueryResult; }
|
|
17
|
+
// Forward declaration of `ColumnType` to properly resolve imports.
|
|
18
|
+
namespace margelo::nitro::rnnitrosqlite { enum class ColumnType; }
|
|
19
|
+
// Forward declaration of `FileLoadResult` to properly resolve imports.
|
|
20
|
+
namespace margelo::nitro::rnnitrosqlite { struct FileLoadResult; }
|
|
21
|
+
// Forward declaration of `HybridNativeQueryResultSpec` to properly resolve imports.
|
|
22
|
+
namespace margelo::nitro::rnnitrosqlite { class HybridNativeQueryResultSpec; }
|
|
23
|
+
// Forward declaration of `HybridNitroSQLiteSpec` to properly resolve imports.
|
|
24
|
+
namespace margelo::nitro::rnnitrosqlite { class HybridNitroSQLiteSpec; }
|
|
25
|
+
// Forward declaration of `SQLiteQueryColumnMetadata` to properly resolve imports.
|
|
26
|
+
namespace margelo::nitro::rnnitrosqlite { struct SQLiteQueryColumnMetadata; }
|
|
27
|
+
|
|
28
|
+
// Include C++ defined types
|
|
29
|
+
#include "BatchQueryCommand.hpp"
|
|
30
|
+
#include "BatchQueryResult.hpp"
|
|
31
|
+
#include "ColumnType.hpp"
|
|
32
|
+
#include "FileLoadResult.hpp"
|
|
33
|
+
#include "HybridNativeQueryResultSpec.hpp"
|
|
34
|
+
#include "HybridNitroSQLiteSpec.hpp"
|
|
35
|
+
#include "SQLiteQueryColumnMetadata.hpp"
|
|
36
|
+
#include <NitroModules/ArrayBuffer.hpp>
|
|
37
|
+
#include <future>
|
|
38
|
+
#include <memory>
|
|
39
|
+
#include <optional>
|
|
40
|
+
#include <string>
|
|
41
|
+
#include <unordered_map>
|
|
42
|
+
#include <variant>
|
|
43
|
+
#include <vector>
|
|
44
|
+
|
|
45
|
+
// C++ helpers for Swift
|
|
46
|
+
#include "RNNitroSQLite-Swift-Cxx-Bridge.hpp"
|
|
47
|
+
|
|
48
|
+
// Common C++ types used in Swift
|
|
49
|
+
#include <NitroModules/ArrayBufferHolder.hpp>
|
|
50
|
+
#include <NitroModules/AnyMapHolder.hpp>
|
|
51
|
+
#include <NitroModules/HybridContext.hpp>
|
|
52
|
+
#include <NitroModules/PromiseHolder.hpp>
|
|
53
|
+
|
|
54
|
+
// Forward declarations of Swift defined types
|
|
55
|
+
// Forward declaration of `HybridNativeQueryResultSpecCxx` to properly resolve imports.
|
|
56
|
+
namespace RNNitroSQLite { class HybridNativeQueryResultSpecCxx; }
|
|
57
|
+
// Forward declaration of `HybridNitroSQLiteSpecCxx` to properly resolve imports.
|
|
58
|
+
namespace RNNitroSQLite { class HybridNitroSQLiteSpecCxx; }
|
|
59
|
+
|
|
60
|
+
// Include Swift defined types
|
|
61
|
+
#if __has_include("RNNitroSQLite-Swift.h")
|
|
62
|
+
// This header is generated by Xcode/Swift on every app build.
|
|
63
|
+
// If it cannot be found, make sure the Swift module's name (= podspec name) is actually "RNNitroSQLite".
|
|
64
|
+
#include "RNNitroSQLite-Swift.h"
|
|
65
|
+
#else
|
|
66
|
+
#error RNNitroSQLite's autogenerated Swift header cannot be found! Make sure the Swift module's name (= podspec name) is actually "RNNitroSQLite", and try building the app first.
|
|
67
|
+
#endif
|