better-sqlite3-multiple-ciphers 12.4.1 → 12.5.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/README.md +4 -4
- package/deps/sqlite3/sqlite3.c +5403 -2655
- package/deps/sqlite3/sqlite3.h +306 -113
- package/deps/sqlite3/sqlite3ext.h +7 -0
- package/deps/update-sqlite3mc.sh +2 -2
- package/package.json +2 -2
- package/src/better_sqlite3.cpp +74 -69
- package/src/objects/statement.cpp +383 -383
- package/src/util/binder.cpp +193 -193
- package/src/util/data.cpp +194 -194
- package/src/util/macros.cpp +70 -63
- package/src/util/row-builder.cpp +49 -49
|
@@ -368,6 +368,10 @@ struct sqlite3_api_routines {
|
|
|
368
368
|
int (*set_clientdata)(sqlite3*, const char*, void*, void(*)(void*));
|
|
369
369
|
/* Version 3.50.0 and later */
|
|
370
370
|
int (*setlk_timeout)(sqlite3*,int,int);
|
|
371
|
+
/* Version 3.51.0 and later */
|
|
372
|
+
int (*set_errmsg)(sqlite3*,int,const char*);
|
|
373
|
+
int (*db_status64)(sqlite3*,int,sqlite3_int64*,sqlite3_int64*,int);
|
|
374
|
+
|
|
371
375
|
};
|
|
372
376
|
|
|
373
377
|
/*
|
|
@@ -703,6 +707,9 @@ typedef int (*sqlite3_loadext_entry)(
|
|
|
703
707
|
#define sqlite3_set_clientdata sqlite3_api->set_clientdata
|
|
704
708
|
/* Version 3.50.0 and later */
|
|
705
709
|
#define sqlite3_setlk_timeout sqlite3_api->setlk_timeout
|
|
710
|
+
/* Version 3.51.0 and later */
|
|
711
|
+
#define sqlite3_set_errmsg sqlite3_api->set_errmsg
|
|
712
|
+
#define sqlite3_db_status64 sqlite3_api->db_status64
|
|
706
713
|
#endif /* !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION) */
|
|
707
714
|
|
|
708
715
|
#if !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION)
|
package/deps/update-sqlite3mc.sh
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "better-sqlite3-multiple-ciphers",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.5.0",
|
|
4
4
|
"description": "better-sqlite3 with multiple-cipher encryption support",
|
|
5
5
|
"homepage": "https://github.com/m4heshd/better-sqlite3-multiple-ciphers",
|
|
6
6
|
"author": "Mahesh Bandara Wijerathna (m4heshd) <m4heshd@gmail.com>",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
},
|
|
27
27
|
"overrides": {
|
|
28
28
|
"prebuild": {
|
|
29
|
-
"node-abi": "4.
|
|
29
|
+
"node-abi": "4.15.0"
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
package/src/better_sqlite3.cpp
CHANGED
|
@@ -1,69 +1,74 @@
|
|
|
1
|
-
#include <climits>
|
|
2
|
-
#include <cstdio>
|
|
3
|
-
#include <cstring>
|
|
4
|
-
#include <string>
|
|
5
|
-
#include <vector>
|
|
6
|
-
#include <set>
|
|
7
|
-
#include <unordered_map>
|
|
8
|
-
#include <algorithm>
|
|
9
|
-
#include <mutex>
|
|
10
|
-
#include <sqlite3.h>
|
|
11
|
-
#include <node.h>
|
|
12
|
-
#include <node_object_wrap.h>
|
|
13
|
-
#include <node_buffer.h>
|
|
14
|
-
|
|
15
|
-
struct Addon;
|
|
16
|
-
class Database;
|
|
17
|
-
class Statement;
|
|
18
|
-
class StatementIterator;
|
|
19
|
-
class Backup;
|
|
20
|
-
|
|
21
|
-
#include "util/macros.cpp"
|
|
22
|
-
#include "util/helpers.cpp"
|
|
23
|
-
#include "util/constants.cpp"
|
|
24
|
-
#include "util/bind-map.cpp"
|
|
25
|
-
#include "util/data-converter.cpp"
|
|
26
|
-
#include "util/data.cpp"
|
|
27
|
-
#if defined(NODE_MODULE_VERSION) && NODE_MODULE_VERSION >= 127
|
|
28
|
-
#include "util/row-builder.cpp"
|
|
29
|
-
#endif
|
|
30
|
-
|
|
31
|
-
#include "objects/backup.hpp"
|
|
32
|
-
#include "objects/statement.hpp"
|
|
33
|
-
#include "objects/database.hpp"
|
|
34
|
-
#include "addon.cpp"
|
|
35
|
-
#include "objects/statement-iterator.hpp"
|
|
36
|
-
|
|
37
|
-
#include "util/query-macros.cpp"
|
|
38
|
-
#include "util/custom-function.cpp"
|
|
39
|
-
#include "util/custom-aggregate.cpp"
|
|
40
|
-
#include "util/custom-table.cpp"
|
|
41
|
-
#include "util/binder.cpp"
|
|
42
|
-
|
|
43
|
-
#include "objects/backup.cpp"
|
|
44
|
-
#include "objects/statement.cpp"
|
|
45
|
-
#include "objects/database.cpp"
|
|
46
|
-
#include "objects/statement-iterator.cpp"
|
|
47
|
-
|
|
48
|
-
NODE_MODULE_INIT(/* exports, context */) {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
v8::
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
//
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
1
|
+
#include <climits>
|
|
2
|
+
#include <cstdio>
|
|
3
|
+
#include <cstring>
|
|
4
|
+
#include <string>
|
|
5
|
+
#include <vector>
|
|
6
|
+
#include <set>
|
|
7
|
+
#include <unordered_map>
|
|
8
|
+
#include <algorithm>
|
|
9
|
+
#include <mutex>
|
|
10
|
+
#include <sqlite3.h>
|
|
11
|
+
#include <node.h>
|
|
12
|
+
#include <node_object_wrap.h>
|
|
13
|
+
#include <node_buffer.h>
|
|
14
|
+
|
|
15
|
+
struct Addon;
|
|
16
|
+
class Database;
|
|
17
|
+
class Statement;
|
|
18
|
+
class StatementIterator;
|
|
19
|
+
class Backup;
|
|
20
|
+
|
|
21
|
+
#include "util/macros.cpp"
|
|
22
|
+
#include "util/helpers.cpp"
|
|
23
|
+
#include "util/constants.cpp"
|
|
24
|
+
#include "util/bind-map.cpp"
|
|
25
|
+
#include "util/data-converter.cpp"
|
|
26
|
+
#include "util/data.cpp"
|
|
27
|
+
#if defined(NODE_MODULE_VERSION) && NODE_MODULE_VERSION >= 127
|
|
28
|
+
#include "util/row-builder.cpp"
|
|
29
|
+
#endif
|
|
30
|
+
|
|
31
|
+
#include "objects/backup.hpp"
|
|
32
|
+
#include "objects/statement.hpp"
|
|
33
|
+
#include "objects/database.hpp"
|
|
34
|
+
#include "addon.cpp"
|
|
35
|
+
#include "objects/statement-iterator.hpp"
|
|
36
|
+
|
|
37
|
+
#include "util/query-macros.cpp"
|
|
38
|
+
#include "util/custom-function.cpp"
|
|
39
|
+
#include "util/custom-aggregate.cpp"
|
|
40
|
+
#include "util/custom-table.cpp"
|
|
41
|
+
#include "util/binder.cpp"
|
|
42
|
+
|
|
43
|
+
#include "objects/backup.cpp"
|
|
44
|
+
#include "objects/statement.cpp"
|
|
45
|
+
#include "objects/database.cpp"
|
|
46
|
+
#include "objects/statement-iterator.cpp"
|
|
47
|
+
|
|
48
|
+
NODE_MODULE_INIT(/* exports, context */) {
|
|
49
|
+
#if defined(NODE_MODULE_VERSION) && NODE_MODULE_VERSION >= 140
|
|
50
|
+
// Use Isolate::GetCurrent as stated in deprecation message within v8_context.h 13.9.72320122
|
|
51
|
+
v8::Isolate* isolate = v8::Isolate::GetCurrent();
|
|
52
|
+
#else
|
|
53
|
+
v8::Isolate* isolate = context->GetIsolate();
|
|
54
|
+
#endif
|
|
55
|
+
v8::HandleScope scope(isolate);
|
|
56
|
+
Addon::ConfigureURI();
|
|
57
|
+
|
|
58
|
+
// Initialize addon instance.
|
|
59
|
+
Addon* addon = new Addon(isolate);
|
|
60
|
+
v8::Local<v8::External> data = v8::External::New(isolate, addon);
|
|
61
|
+
node::AddEnvironmentCleanupHook(isolate, Addon::Cleanup, addon);
|
|
62
|
+
|
|
63
|
+
// Create and export native-backed classes and functions.
|
|
64
|
+
exports->Set(context, InternalizedFromLatin1(isolate, "Database"), Database::Init(isolate, data)).FromJust();
|
|
65
|
+
exports->Set(context, InternalizedFromLatin1(isolate, "Statement"), Statement::Init(isolate, data)).FromJust();
|
|
66
|
+
exports->Set(context, InternalizedFromLatin1(isolate, "StatementIterator"), StatementIterator::Init(isolate, data)).FromJust();
|
|
67
|
+
exports->Set(context, InternalizedFromLatin1(isolate, "Backup"), Backup::Init(isolate, data)).FromJust();
|
|
68
|
+
exports->Set(context, InternalizedFromLatin1(isolate, "setErrorConstructor"), v8::FunctionTemplate::New(isolate, Addon::JS_setErrorConstructor, data)->GetFunction(context).ToLocalChecked()).FromJust();
|
|
69
|
+
|
|
70
|
+
// Store addon instance data.
|
|
71
|
+
addon->Statement.Reset(isolate, exports->Get(context, InternalizedFromLatin1(isolate, "Statement")).ToLocalChecked().As<v8::Function>());
|
|
72
|
+
addon->StatementIterator.Reset(isolate, exports->Get(context, InternalizedFromLatin1(isolate, "StatementIterator")).ToLocalChecked().As<v8::Function>());
|
|
73
|
+
addon->Backup.Reset(isolate, exports->Get(context, InternalizedFromLatin1(isolate, "Backup")).ToLocalChecked().As<v8::Function>());
|
|
74
|
+
}
|