From ea8f4bf69cffdfce7fb3292d22f4e3ffbb2c7840 Mon Sep 17 00:00:00 2001 From: Samuel Scheit Date: Thu, 10 Sep 2026 21:09:17 +0200 Subject: [PATCH 1/2] fix: align native namespaces with Nitro --- .../cpp/hybridObjects/HybridNitroSQLite.cpp | 12 ++++++------ .../cpp/hybridObjects/HybridNitroSQLite.hpp | 4 +--- .../hybridObjects/HybridNitroSQLiteQueryResult.hpp | 4 +--- .../react-native-nitro-sqlite/cpp/importSqlFile.cpp | 4 ++-- .../react-native-nitro-sqlite/cpp/importSqlFile.hpp | 4 ++-- .../react-native-nitro-sqlite/cpp/operations.cpp | 6 ++---- .../react-native-nitro-sqlite/cpp/operations.hpp | 4 ++-- .../cpp/sqliteExecuteBatch.cpp | 4 ++-- .../cpp/sqliteExecuteBatch.hpp | 7 ++----- packages/react-native-nitro-sqlite/cpp/types.hpp | 9 +++------ packages/react-native-nitro-sqlite/cpp/utils.hpp | 4 ++-- 11 files changed, 25 insertions(+), 37 deletions(-) diff --git a/packages/react-native-nitro-sqlite/cpp/hybridObjects/HybridNitroSQLite.cpp b/packages/react-native-nitro-sqlite/cpp/hybridObjects/HybridNitroSQLite.cpp index 74983e0a..751002cd 100644 --- a/packages/react-native-nitro-sqlite/cpp/hybridObjects/HybridNitroSQLite.cpp +++ b/packages/react-native-nitro-sqlite/cpp/hybridObjects/HybridNitroSQLite.cpp @@ -1,11 +1,11 @@ #include "HybridNitroSQLite.hpp" #include "HybridNitroSQLiteQueryResult.hpp" -#include "NitroSQLiteException.hpp" -#include "importSqlFile.hpp" -#include "logs.hpp" -#include "macros.hpp" -#include "operations.hpp" -#include "sqliteExecuteBatch.hpp" +#include "../NitroSQLiteException.hpp" +#include "../importSqlFile.hpp" +#include "../logs.hpp" +#include "../macros.hpp" +#include "../operations.hpp" +#include "../sqliteExecuteBatch.hpp" #include #include #include diff --git a/packages/react-native-nitro-sqlite/cpp/hybridObjects/HybridNitroSQLite.hpp b/packages/react-native-nitro-sqlite/cpp/hybridObjects/HybridNitroSQLite.hpp index a5331964..417b4d99 100644 --- a/packages/react-native-nitro-sqlite/cpp/hybridObjects/HybridNitroSQLite.hpp +++ b/packages/react-native-nitro-sqlite/cpp/hybridObjects/HybridNitroSQLite.hpp @@ -2,9 +2,7 @@ #include "HybridNitroSQLiteQueryResultSpec.hpp" #include "HybridNitroSQLiteSpec.hpp" -#include "types.hpp" - -using namespace margelo::rnnitrosqlite; +#include "../types.hpp" namespace margelo::nitro::rnnitrosqlite { diff --git a/packages/react-native-nitro-sqlite/cpp/hybridObjects/HybridNitroSQLiteQueryResult.hpp b/packages/react-native-nitro-sqlite/cpp/hybridObjects/HybridNitroSQLiteQueryResult.hpp index 144f3f7e..6da59617 100644 --- a/packages/react-native-nitro-sqlite/cpp/hybridObjects/HybridNitroSQLiteQueryResult.hpp +++ b/packages/react-native-nitro-sqlite/cpp/hybridObjects/HybridNitroSQLiteQueryResult.hpp @@ -1,11 +1,9 @@ #pragma once #include "HybridNitroSQLiteQueryResultSpec.hpp" -#include "types.hpp" +#include "../types.hpp" #include -using namespace margelo::rnnitrosqlite; - namespace margelo::nitro::rnnitrosqlite { class HybridNitroSQLiteQueryResult : public HybridNitroSQLiteQueryResultSpec { diff --git a/packages/react-native-nitro-sqlite/cpp/importSqlFile.cpp b/packages/react-native-nitro-sqlite/cpp/importSqlFile.cpp index e38f06f0..44573a1a 100644 --- a/packages/react-native-nitro-sqlite/cpp/importSqlFile.cpp +++ b/packages/react-native-nitro-sqlite/cpp/importSqlFile.cpp @@ -8,7 +8,7 @@ #include #include -namespace margelo::rnnitrosqlite { +namespace margelo::nitro::rnnitrosqlite { SQLiteOperationResult importSqlFile(const std::string& dbName, const std::string& fileLocation) { return importSqlFile(sqliteGetOpenDatabase(dbName), fileLocation); @@ -50,4 +50,4 @@ SQLiteOperationResult importSqlFile(const SQLiteConnectionPtr& connection, const } } -} // namespace margelo::rnnitrosqlite +} // namespace margelo::nitro::rnnitrosqlite diff --git a/packages/react-native-nitro-sqlite/cpp/importSqlFile.hpp b/packages/react-native-nitro-sqlite/cpp/importSqlFile.hpp index 766c6779..45328933 100644 --- a/packages/react-native-nitro-sqlite/cpp/importSqlFile.hpp +++ b/packages/react-native-nitro-sqlite/cpp/importSqlFile.hpp @@ -9,11 +9,11 @@ #include "types.hpp" #include -namespace margelo::rnnitrosqlite { +namespace margelo::nitro::rnnitrosqlite { struct SQLiteConnection; SQLiteOperationResult importSqlFile(const std::string& dbName, const std::string& fileLocation); SQLiteOperationResult importSqlFile(const std::shared_ptr& connection, const std::string& fileLocation); -} // namespace margelo::rnnitrosqlite +} // namespace margelo::nitro::rnnitrosqlite diff --git a/packages/react-native-nitro-sqlite/cpp/operations.cpp b/packages/react-native-nitro-sqlite/cpp/operations.cpp index 8c99db01..5b42c3d1 100644 --- a/packages/react-native-nitro-sqlite/cpp/operations.cpp +++ b/packages/react-native-nitro-sqlite/cpp/operations.cpp @@ -22,10 +22,8 @@ #endif using namespace facebook; -using namespace margelo::nitro; -using namespace margelo::nitro::rnnitrosqlite; -namespace margelo::rnnitrosqlite { +namespace margelo::nitro::rnnitrosqlite { static constexpr double kInt64MinAsDouble = static_cast(std::numeric_limits::min()); static constexpr double kInt64UpperBoundAsDouble = -kInt64MinAsDouble; @@ -355,4 +353,4 @@ SQLiteOperationResult sqliteExecuteCommand(const SQLiteConnectionPtr& connection return {.rowsAffected = isReadOnly ? 0 : sqlite3_changes(db)}; } -} // namespace margelo::rnnitrosqlite +} // namespace margelo::nitro::rnnitrosqlite diff --git a/packages/react-native-nitro-sqlite/cpp/operations.hpp b/packages/react-native-nitro-sqlite/cpp/operations.hpp index 549d68e5..8ef1772c 100644 --- a/packages/react-native-nitro-sqlite/cpp/operations.hpp +++ b/packages/react-native-nitro-sqlite/cpp/operations.hpp @@ -7,7 +7,7 @@ #include #include -namespace margelo::rnnitrosqlite { +namespace margelo::nitro::rnnitrosqlite { // Calls against one connection are serialized by `mutex`. Separate connections // intentionally remain independent, so SQLITE_THREADSAFE=0 still requires the @@ -53,4 +53,4 @@ SQLiteOperationResult sqliteExecuteCommand(const SQLiteConnectionPtr& connection void sqliteCloseAll(); -} // namespace margelo::rnnitrosqlite +} // namespace margelo::nitro::rnnitrosqlite diff --git a/packages/react-native-nitro-sqlite/cpp/sqliteExecuteBatch.cpp b/packages/react-native-nitro-sqlite/cpp/sqliteExecuteBatch.cpp index 0e3d92ca..783a44e4 100644 --- a/packages/react-native-nitro-sqlite/cpp/sqliteExecuteBatch.cpp +++ b/packages/react-native-nitro-sqlite/cpp/sqliteExecuteBatch.cpp @@ -6,7 +6,7 @@ #include "operations.hpp" #include -namespace margelo::rnnitrosqlite { +namespace margelo::nitro::rnnitrosqlite { std::vector batchParamsToCommands(const std::vector& batchParams) { auto commands = std::vector(); @@ -67,4 +67,4 @@ SQLiteOperationResult sqliteExecuteBatch(const SQLiteConnectionPtr& connection, } } -} // namespace margelo::rnnitrosqlite +} // namespace margelo::nitro::rnnitrosqlite diff --git a/packages/react-native-nitro-sqlite/cpp/sqliteExecuteBatch.hpp b/packages/react-native-nitro-sqlite/cpp/sqliteExecuteBatch.hpp index aa68152c..5db205d5 100644 --- a/packages/react-native-nitro-sqlite/cpp/sqliteExecuteBatch.hpp +++ b/packages/react-native-nitro-sqlite/cpp/sqliteExecuteBatch.hpp @@ -7,10 +7,7 @@ #include "types.hpp" #include -using namespace facebook; -using namespace margelo::nitro; - -namespace margelo::rnnitrosqlite { +namespace margelo::nitro::rnnitrosqlite { struct SQLiteConnection; @@ -31,4 +28,4 @@ std::vector batchParamsToCommands(const std::vector& commands); SQLiteOperationResult sqliteExecuteBatch(const std::shared_ptr& connection, const std::vector& commands); -} // namespace margelo::rnnitrosqlite +} // namespace margelo::nitro::rnnitrosqlite diff --git a/packages/react-native-nitro-sqlite/cpp/types.hpp b/packages/react-native-nitro-sqlite/cpp/types.hpp index eefa83a0..ac4c6090 100644 --- a/packages/react-native-nitro-sqlite/cpp/types.hpp +++ b/packages/react-native-nitro-sqlite/cpp/types.hpp @@ -5,12 +5,9 @@ #include #include -using namespace margelo::nitro; -using namespace margelo::nitro::rnnitrosqlite; +namespace margelo::nitro::rnnitrosqlite { -namespace margelo::rnnitrosqlite { - -using SQLiteValue = std::variant, std::string, double>; +using SQLiteValue = std::variant, std::string, double>; using SQLiteQueryParams = std::vector; using SQLiteQueryResultRow = std::unordered_map; using SQLiteQueryResults = std::vector; @@ -40,4 +37,4 @@ inline ColumnType mapSQLiteTypeToColumnType(const char* type) { } } -} // namespace margelo::rnnitrosqlite +} // namespace margelo::nitro::rnnitrosqlite diff --git a/packages/react-native-nitro-sqlite/cpp/utils.hpp b/packages/react-native-nitro-sqlite/cpp/utils.hpp index f6948cbb..7577e3d8 100644 --- a/packages/react-native-nitro-sqlite/cpp/utils.hpp +++ b/packages/react-native-nitro-sqlite/cpp/utils.hpp @@ -3,7 +3,7 @@ #include #include -namespace margelo::rnnitrosqlite { +namespace margelo::nitro::rnnitrosqlite { bool folder_exists(const std::string& foldername) { struct stat buffer; @@ -57,4 +57,4 @@ std::string get_db_path(const std::string& dbName, const std::string& docPath) { return docPath + "/" + dbName; } -} // namespace margelo::rnnitrosqlite +} // namespace margelo::nitro::rnnitrosqlite From 86d6ade9aec8754764ba48b9c3ceafd23b4e0d09 Mon Sep 17 00:00:00 2001 From: chrispader Date: Thu, 10 Sep 2026 21:12:22 +0200 Subject: [PATCH 2/2] style: sort native includes --- .../cpp/hybridObjects/HybridNitroSQLite.cpp | 2 +- .../cpp/hybridObjects/HybridNitroSQLite.hpp | 2 +- .../cpp/hybridObjects/HybridNitroSQLiteQueryResult.hpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/react-native-nitro-sqlite/cpp/hybridObjects/HybridNitroSQLite.cpp b/packages/react-native-nitro-sqlite/cpp/hybridObjects/HybridNitroSQLite.cpp index 751002cd..1fdc3076 100644 --- a/packages/react-native-nitro-sqlite/cpp/hybridObjects/HybridNitroSQLite.cpp +++ b/packages/react-native-nitro-sqlite/cpp/hybridObjects/HybridNitroSQLite.cpp @@ -1,11 +1,11 @@ #include "HybridNitroSQLite.hpp" -#include "HybridNitroSQLiteQueryResult.hpp" #include "../NitroSQLiteException.hpp" #include "../importSqlFile.hpp" #include "../logs.hpp" #include "../macros.hpp" #include "../operations.hpp" #include "../sqliteExecuteBatch.hpp" +#include "HybridNitroSQLiteQueryResult.hpp" #include #include #include diff --git a/packages/react-native-nitro-sqlite/cpp/hybridObjects/HybridNitroSQLite.hpp b/packages/react-native-nitro-sqlite/cpp/hybridObjects/HybridNitroSQLite.hpp index 417b4d99..e608e341 100644 --- a/packages/react-native-nitro-sqlite/cpp/hybridObjects/HybridNitroSQLite.hpp +++ b/packages/react-native-nitro-sqlite/cpp/hybridObjects/HybridNitroSQLite.hpp @@ -1,8 +1,8 @@ #pragma once +#include "../types.hpp" #include "HybridNitroSQLiteQueryResultSpec.hpp" #include "HybridNitroSQLiteSpec.hpp" -#include "../types.hpp" namespace margelo::nitro::rnnitrosqlite { diff --git a/packages/react-native-nitro-sqlite/cpp/hybridObjects/HybridNitroSQLiteQueryResult.hpp b/packages/react-native-nitro-sqlite/cpp/hybridObjects/HybridNitroSQLiteQueryResult.hpp index 6da59617..9563d224 100644 --- a/packages/react-native-nitro-sqlite/cpp/hybridObjects/HybridNitroSQLiteQueryResult.hpp +++ b/packages/react-native-nitro-sqlite/cpp/hybridObjects/HybridNitroSQLiteQueryResult.hpp @@ -1,7 +1,7 @@ #pragma once -#include "HybridNitroSQLiteQueryResultSpec.hpp" #include "../types.hpp" +#include "HybridNitroSQLiteQueryResultSpec.hpp" #include namespace margelo::nitro::rnnitrosqlite {