Skip to content

Commit a292f5a

Browse files
authored
fix: Null handling improvements (#161)
* refactor: move null handling code * fix: execute always replacing null values * refactor: simplify null handling in execute * feat: implement null handling for executeBatch * chore: update nitrogen specs * fix: use null handling function * update pods * chore: remove Xcode 16.2 Swift hotfix * Update Podfile.lock * fix: update c++ batch code * chore: release 9.1.8
1 parent 46f58cb commit a292f5a

17 files changed

+150
-64
lines changed

example/ios/Podfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ target 'NitroSQLiteExample' do
3737

3838
installer.pods_project.targets.each do |target|
3939
target.build_configurations.each do |config|
40-
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET[sdk=iphonesimulator*]'] = '16.6'
4140
config.build_settings['DEAD_CODE_STRIPPING'] = 'YES'
4241
end
4342
end

example/ios/Podfile.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1614,7 +1614,7 @@ PODS:
16141614
- React-logger (= 0.78.0)
16151615
- React-perflogger (= 0.78.0)
16161616
- React-utils (= 0.78.0)
1617-
- RNNitroSQLite (9.1.7):
1617+
- RNNitroSQLite (9.1.8):
16181618
- DoubleConversion
16191619
- glog
16201620
- hermes-engine
@@ -1973,11 +1973,11 @@ SPEC CHECKSUMS:
19731973
ReactAppDependencyProvider: f2e81d80afd71a8058589e19d8a134243fa53f17
19741974
ReactCodegen: 335c73d9eb04d93d9b2350157ed52a6a9ad05e1e
19751975
ReactCommon: c8fdbc582b98a07daf201cd95c1da75dd029f3ee
1976-
RNNitroSQLite: 6f4b16233d10ca5da070d1b8012107d561c60d5b
1976+
RNNitroSQLite: ffd6b8298153f00d8a57d11464a93bd5bf52d012
19771977
RNScreens: 77f93ec55b749c49549b447527ebf78e990125f3
19781978
SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748
19791979
Yoga: be02ca501b03c79d7027a6bbbd0a8db985034f11
19801980

1981-
PODFILE CHECKSUM: 60941c02e965706ce3073b8e6f186a204a7b6e73
1981+
PODFILE CHECKSUM: 94e2eb7d622b44feacdd64fd57969a1205a734ae
19821982

19831983
COCOAPODS: 1.15.2

example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"react": "19.0.0",
2525
"react-native": "0.78.0",
2626
"react-native-nitro-modules": "0.24.1",
27-
"react-native-nitro-sqlite": "9.1.7",
27+
"react-native-nitro-sqlite": "9.1.8",
2828
"react-native-safe-area-context": "^5.2.0",
2929
"react-native-screens": "^4.9.1",
3030
"reflect-metadata": "^0.1.13",

package/cpp/specs/HybridNitroSQLite.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,15 @@ std::shared_ptr<Promise<std::shared_ptr<HybridNativeQueryResultSpec>>> HybridNit
6666
});
6767
};
6868

69-
BatchQueryResult HybridNitroSQLite::executeBatch(const std::string& dbName, const std::vector<BatchQueryCommand>& batchParams) {
69+
BatchQueryResult HybridNitroSQLite::executeBatch(const std::string& dbName, const std::vector<NativeBatchQueryCommand>& batchParams) {
7070
const auto commands = batchParamsToCommands(batchParams);
7171

7272
auto result = sqliteExecuteBatch(dbName, commands);
7373
return BatchQueryResult(result.rowsAffected);
7474
};
7575

7676
std::shared_ptr<Promise<BatchQueryResult>> HybridNitroSQLite::executeBatchAsync(const std::string& dbName,
77-
const std::vector<BatchQueryCommand>& batchParams) {
77+
const std::vector<NativeBatchQueryCommand>& batchParams) {
7878
return Promise<BatchQueryResult>::async([=, this]() -> BatchQueryResult {
7979
auto result = executeBatch(dbName, batchParams);
8080
return result;

package/cpp/specs/HybridNitroSQLite.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ class HybridNitroSQLite : public HybridNitroSQLiteSpec {
3232

3333
std::shared_ptr<Promise<std::shared_ptr<HybridNativeQueryResultSpec>>> executeAsync(const std::string& dbName, const std::string& query, const std::optional<SQLiteQueryParams>& params) override;
3434

35-
BatchQueryResult executeBatch(const std::string& dbName, const std::vector<BatchQueryCommand>& commands) override;
36-
std::shared_ptr<Promise<BatchQueryResult>> executeBatchAsync(const std::string& dbName, const std::vector<BatchQueryCommand>& commands) override;
35+
BatchQueryResult executeBatch(const std::string& dbName, const std::vector<NativeBatchQueryCommand>& commands) override;
36+
std::shared_ptr<Promise<BatchQueryResult>> executeBatchAsync(const std::string& dbName, const std::vector<NativeBatchQueryCommand>& commands) override;
3737

3838
FileLoadResult loadFile(const std::string& dbName, const std::string& location) override;
3939
std::shared_ptr<Promise<FileLoadResult>> loadFileAsync(const std::string& dbName, const std::string& location) override;

package/cpp/sqliteExecuteBatch.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
namespace margelo::rnnitrosqlite {
1010

11-
std::vector<BatchQuery> batchParamsToCommands(const std::vector<BatchQueryCommand>& batchParams) {
11+
std::vector<BatchQuery> batchParamsToCommands(const std::vector<NativeBatchQueryCommand>& batchParams) {
1212
auto commands = std::vector<BatchQuery>();
1313

1414
for (auto& command : batchParams) {

package/cpp/sqliteExecuteBatch.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*/
44
#pragma once
55

6-
#include "BatchQueryCommand.hpp"
6+
#include "NativeBatchQueryCommand.hpp"
77
#include "types.hpp"
88

99
using namespace facebook;
@@ -20,7 +20,7 @@ struct BatchQuery {
2020
* Local Helper method to translate JSI objects BatchQuery datastructure
2121
* MUST be called in the JavaScript Thread
2222
*/
23-
std::vector<BatchQuery> batchParamsToCommands(const std::vector<BatchQueryCommand>& batchParams);
23+
std::vector<BatchQuery> batchParamsToCommands(const std::vector<NativeBatchQueryCommand>& batchParams);
2424

2525
/**
2626
* Execute a batch of commands in a exclusive transaction

package/nitrogen/generated/shared/c++/HybridNitroSQLiteSpec.hpp

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package/nitrogen/generated/shared/c++/BatchQueryCommand.hpp renamed to package/nitrogen/generated/shared/c++/NativeBatchQueryCommand.hpp

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-nitro-sqlite",
3-
"version": "9.1.7",
3+
"version": "9.1.8",
44
"description": "Fast SQLite library for React Native built using Nitro Modules",
55
"source": "./src/index.ts",
66
"main": "./lib/commonjs/index",

0 commit comments

Comments
 (0)