better-sqlite3-multiple-ciphers 11.1.1 → 11.2.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/README.md +3 -3
- package/binding.gyp +5 -5
- package/deps/defines.gypi +1 -0
- package/deps/download.sh +113 -112
- package/package.json +1 -1
- package/src/better_sqlite3.cpp +47 -47
- package/src/better_sqlite3.hpp +52 -52
package/README.md
CHANGED
|
@@ -17,8 +17,8 @@ The fastest and simplest library for SQLite3 in Node.js. This particular fork su
|
|
|
17
17
|
## Current versions
|
|
18
18
|
|
|
19
19
|
- ### Stable
|
|
20
|
-
- **better-sqlite3-multiple-ciphers** - [`11.
|
|
21
|
-
- **better-sqlite3** - [`11.
|
|
20
|
+
- **better-sqlite3-multiple-ciphers** - [`11.2.1`](https://github.com/m4heshd/better-sqlite3-multiple-ciphers/releases/tag/v11.2.1)
|
|
21
|
+
- **better-sqlite3** - [`11.2.1`](https://github.com/JoshuaWise/better-sqlite3/releases/tag/v11.2.1)
|
|
22
22
|
- **SQLite** - [`3.46.0`](https://www.sqlite.org/releaselog/3_46_0.html)
|
|
23
23
|
- **SQLite3 Multiple Ciphers** - [`1.8.6`](https://github.com/utelle/SQLite3MultipleCiphers/releases/tag/v1.8.6)
|
|
24
24
|
|
|
@@ -38,7 +38,7 @@ The fastest and simplest library for SQLite3 in Node.js. This particular fork su
|
|
|
38
38
|
|
|
39
39
|
Also head over to [SQLite3MultipleCiphers](https://github.com/utelle/SQLite3MultipleCiphers) repo and give some support to the developer to keep this very useful extension alive.
|
|
40
40
|
|
|
41
|
-
You can also support me (the maintainer of this fork) by buying me a coffee. 😊
|
|
41
|
+
You can also support me (the author/maintainer of this fork) by buying me a coffee. 😊
|
|
42
42
|
|
|
43
43
|
[](https://ko-fi.variatix.net/)
|
|
44
44
|
|
package/binding.gyp
CHANGED
|
@@ -9,17 +9,17 @@
|
|
|
9
9
|
'target_name': 'better_sqlite3',
|
|
10
10
|
'dependencies': ['deps/sqlite3.gyp:sqlite3'],
|
|
11
11
|
'sources': ['src/better_sqlite3.cpp'],
|
|
12
|
-
'cflags_cc': ['-std=c++
|
|
12
|
+
'cflags_cc': ['-std=c++20'],
|
|
13
13
|
'xcode_settings': {
|
|
14
|
-
'OTHER_CPLUSPLUSFLAGS': ['-std=c++
|
|
14
|
+
'OTHER_CPLUSPLUSFLAGS': ['-std=c++20', '-stdlib=libc++'],
|
|
15
15
|
'OTHER_LDFLAGS': ['-framework Security'],
|
|
16
16
|
},
|
|
17
17
|
'msvs_settings': {
|
|
18
18
|
'VCCLCompilerTool': {
|
|
19
19
|
'AdditionalOptions': [
|
|
20
|
-
'/std:c++
|
|
21
|
-
]
|
|
22
|
-
}
|
|
20
|
+
'/std:c++20',
|
|
21
|
+
],
|
|
22
|
+
},
|
|
23
23
|
},
|
|
24
24
|
'conditions': [
|
|
25
25
|
['OS=="linux"', {
|
package/deps/defines.gypi
CHANGED
package/deps/download.sh
CHANGED
|
@@ -1,112 +1,113 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
|
|
3
|
-
# ===
|
|
4
|
-
# This script defines and generates the bundled SQLite3 unit (sqlite3.c).
|
|
5
|
-
#
|
|
6
|
-
# The following steps are taken:
|
|
7
|
-
# 1. populate the shell environment with the defined compile-time options.
|
|
8
|
-
# 2. download and extract the SQLite3 source code into a temporary directory.
|
|
9
|
-
# 3. run "sh configure" and "make sqlite3.c" within the source directory.
|
|
10
|
-
# 4. copy the generated amalgamation into the output directory (./sqlite3).
|
|
11
|
-
# 5. export the defined compile-time options to a gyp file (./defines.gypi).
|
|
12
|
-
# 6. update the docs (../docs/compilation.md) with details of this distribution.
|
|
13
|
-
#
|
|
14
|
-
# When a user builds better-sqlite3, the following steps are taken:
|
|
15
|
-
# 1. node-gyp loads the previously exported compile-time options (defines.gypi).
|
|
16
|
-
# 2. the copy.js script copies the bundled amalgamation into the build folder.
|
|
17
|
-
# 3. node-gyp compiles the copied sqlite3.c along with better_sqlite3.cpp.
|
|
18
|
-
# 4. node-gyp links the two resulting binaries to generate better_sqlite3.node.
|
|
19
|
-
# ===
|
|
20
|
-
|
|
21
|
-
YEAR="2022"
|
|
22
|
-
VERSION="3380200"
|
|
23
|
-
|
|
24
|
-
# Defines below are sorted alphabetically
|
|
25
|
-
DEFINES="
|
|
26
|
-
HAVE_INT16_T=1
|
|
27
|
-
HAVE_INT32_T=1
|
|
28
|
-
HAVE_INT8_T=1
|
|
29
|
-
HAVE_STDINT_H=1
|
|
30
|
-
HAVE_UINT16_T=1
|
|
31
|
-
HAVE_UINT32_T=1
|
|
32
|
-
HAVE_UINT8_T=1
|
|
33
|
-
SQLITE_DEFAULT_CACHE_SIZE=-16000
|
|
34
|
-
SQLITE_DEFAULT_FOREIGN_KEYS=1
|
|
35
|
-
SQLITE_DEFAULT_MEMSTATUS=0
|
|
36
|
-
SQLITE_DEFAULT_WAL_SYNCHRONOUS=1
|
|
37
|
-
SQLITE_DQS=0
|
|
38
|
-
SQLITE_ENABLE_COLUMN_METADATA
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
rm -rf "$
|
|
70
|
-
|
|
71
|
-
mkdir -p "$
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
printf "
|
|
94
|
-
printf "
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
sed -
|
|
103
|
-
sed -i.bak -e "/^
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
printf "
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
# ===
|
|
4
|
+
# This script defines and generates the bundled SQLite3 unit (sqlite3.c).
|
|
5
|
+
#
|
|
6
|
+
# The following steps are taken:
|
|
7
|
+
# 1. populate the shell environment with the defined compile-time options.
|
|
8
|
+
# 2. download and extract the SQLite3 source code into a temporary directory.
|
|
9
|
+
# 3. run "sh configure" and "make sqlite3.c" within the source directory.
|
|
10
|
+
# 4. copy the generated amalgamation into the output directory (./sqlite3).
|
|
11
|
+
# 5. export the defined compile-time options to a gyp file (./defines.gypi).
|
|
12
|
+
# 6. update the docs (../docs/compilation.md) with details of this distribution.
|
|
13
|
+
#
|
|
14
|
+
# When a user builds better-sqlite3, the following steps are taken:
|
|
15
|
+
# 1. node-gyp loads the previously exported compile-time options (defines.gypi).
|
|
16
|
+
# 2. the copy.js script copies the bundled amalgamation into the build folder.
|
|
17
|
+
# 3. node-gyp compiles the copied sqlite3.c along with better_sqlite3.cpp.
|
|
18
|
+
# 4. node-gyp links the two resulting binaries to generate better_sqlite3.node.
|
|
19
|
+
# ===
|
|
20
|
+
|
|
21
|
+
YEAR="2022"
|
|
22
|
+
VERSION="3380200"
|
|
23
|
+
|
|
24
|
+
# Defines below are sorted alphabetically
|
|
25
|
+
DEFINES="
|
|
26
|
+
HAVE_INT16_T=1
|
|
27
|
+
HAVE_INT32_T=1
|
|
28
|
+
HAVE_INT8_T=1
|
|
29
|
+
HAVE_STDINT_H=1
|
|
30
|
+
HAVE_UINT16_T=1
|
|
31
|
+
HAVE_UINT32_T=1
|
|
32
|
+
HAVE_UINT8_T=1
|
|
33
|
+
SQLITE_DEFAULT_CACHE_SIZE=-16000
|
|
34
|
+
SQLITE_DEFAULT_FOREIGN_KEYS=1
|
|
35
|
+
SQLITE_DEFAULT_MEMSTATUS=0
|
|
36
|
+
SQLITE_DEFAULT_WAL_SYNCHRONOUS=1
|
|
37
|
+
SQLITE_DQS=0
|
|
38
|
+
SQLITE_ENABLE_COLUMN_METADATA
|
|
39
|
+
SQLITE_ENABLE_DBSTAT_VTAB
|
|
40
|
+
SQLITE_ENABLE_DESERIALIZE
|
|
41
|
+
SQLITE_ENABLE_FTS3
|
|
42
|
+
SQLITE_ENABLE_FTS3_PARENTHESIS
|
|
43
|
+
SQLITE_ENABLE_FTS4
|
|
44
|
+
SQLITE_ENABLE_FTS5
|
|
45
|
+
SQLITE_ENABLE_GEOPOLY
|
|
46
|
+
SQLITE_ENABLE_JSON1
|
|
47
|
+
SQLITE_ENABLE_MATH_FUNCTIONS
|
|
48
|
+
SQLITE_ENABLE_RTREE
|
|
49
|
+
SQLITE_ENABLE_STAT4
|
|
50
|
+
SQLITE_ENABLE_UPDATE_DELETE_LIMIT
|
|
51
|
+
SQLITE_LIKE_DOESNT_MATCH_BLOBS
|
|
52
|
+
SQLITE_OMIT_DEPRECATED
|
|
53
|
+
SQLITE_OMIT_PROGRESS_CALLBACK
|
|
54
|
+
SQLITE_OMIT_SHARED_CACHE
|
|
55
|
+
SQLITE_OMIT_TCL_VARIABLE
|
|
56
|
+
SQLITE_SOUNDEX
|
|
57
|
+
SQLITE_THREADSAFE=2
|
|
58
|
+
SQLITE_TRACE_SIZE_LIMIT=32
|
|
59
|
+
SQLITE_USER_AUTHENTICATION=0
|
|
60
|
+
SQLITE_USE_URI=0
|
|
61
|
+
"
|
|
62
|
+
|
|
63
|
+
# ========== START SCRIPT ========== #
|
|
64
|
+
|
|
65
|
+
echo "setting up environment..."
|
|
66
|
+
DEPS="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)"
|
|
67
|
+
TEMP="$DEPS/temp"
|
|
68
|
+
OUTPUT="$DEPS/sqlite3"
|
|
69
|
+
rm -rf "$TEMP"
|
|
70
|
+
rm -rf "$OUTPUT"
|
|
71
|
+
mkdir -p "$TEMP"
|
|
72
|
+
mkdir -p "$OUTPUT"
|
|
73
|
+
export CFLAGS=`echo $(echo "$DEFINES" | sed -e "/^\s*$/d" -e "s/^/-D/")`
|
|
74
|
+
|
|
75
|
+
echo "downloading source..."
|
|
76
|
+
curl -#f "https://www.sqlite.org/$YEAR/sqlite-src-$VERSION.zip" > "$TEMP/source.zip" || exit 1
|
|
77
|
+
|
|
78
|
+
echo "extracting source..."
|
|
79
|
+
unzip "$TEMP/source.zip" -d "$TEMP" > /dev/null || exit 1
|
|
80
|
+
cd "$TEMP/sqlite-src-$VERSION" || exit 1
|
|
81
|
+
|
|
82
|
+
echo "configuring amalgamation..."
|
|
83
|
+
sh configure > /dev/null || exit 1
|
|
84
|
+
|
|
85
|
+
echo "building amalgamation..."
|
|
86
|
+
make sqlite3.c > /dev/null || exit 1
|
|
87
|
+
|
|
88
|
+
echo "copying amalgamation..."
|
|
89
|
+
cp sqlite3.c sqlite3.h sqlite3ext.h "$OUTPUT/" || exit 1
|
|
90
|
+
|
|
91
|
+
echo "updating gyp configs..."
|
|
92
|
+
GYP="$DEPS/defines.gypi"
|
|
93
|
+
printf "# THIS FILE IS AUTOMATICALLY GENERATED BY deps/download.sh (DO NOT EDIT)\n\n{\n 'defines': [\n" > "$GYP"
|
|
94
|
+
printf "$DEFINES" | sed -e "/^\s*$/d" -e "s/\(.*\)/ '\1',/" >> "$GYP"
|
|
95
|
+
printf " ],\n}\n" >> "$GYP"
|
|
96
|
+
|
|
97
|
+
echo "updating docs..."
|
|
98
|
+
DOCS="$DEPS/../docs/compilation.md"
|
|
99
|
+
MAJOR=`expr "${VERSION:0:1}" + 0`
|
|
100
|
+
MINOR=`expr "${VERSION:1:2}" + 0`
|
|
101
|
+
PATCH=`expr "${VERSION:3:2}" + 0`
|
|
102
|
+
sed -Ei.bak -e "s/version [0-9]+\.[0-9]+\.[0-9]+/version $MAJOR.$MINOR.$PATCH/g" "$DOCS"
|
|
103
|
+
sed -i.bak -e "/^SQLITE_/,\$d" "$DOCS"
|
|
104
|
+
sed -i.bak -e "/^HAVE_/,\$d" "$DOCS"
|
|
105
|
+
rm "$DOCS".bak
|
|
106
|
+
printf "$DEFINES" | sed -e "/^\s*$/d" >> "$DOCS"
|
|
107
|
+
printf "\`\`\`\n" >> "$DOCS"
|
|
108
|
+
|
|
109
|
+
echo "cleaning up..."
|
|
110
|
+
cd - > /dev/null || exit 1
|
|
111
|
+
rm -rf "$TEMP"
|
|
112
|
+
|
|
113
|
+
echo "done!"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "better-sqlite3-multiple-ciphers",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.2.1",
|
|
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>",
|
package/src/better_sqlite3.cpp
CHANGED
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
//
|
|
3
3
|
|
|
4
4
|
#include "better_sqlite3.hpp"
|
|
5
|
-
#line
|
|
5
|
+
#line 154 "./src/util/macros.lzz"
|
|
6
6
|
void SetPrototypeGetter(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
v8::Isolate* isolate,
|
|
8
|
+
v8::Local<v8::External> data,
|
|
9
|
+
v8::Local<v8::FunctionTemplate> recv,
|
|
10
|
+
const char* name,
|
|
11
|
+
v8::AccessorNameGetterCallback func
|
|
12
12
|
) {
|
|
13
|
-
|
|
13
|
+
v8::HandleScope scope(isolate);
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
#if defined NODE_MODULE_VERSION && NODE_MODULE_VERSION < 121
|
|
16
|
+
recv->InstanceTemplate()->SetAccessor(
|
|
17
17
|
InternalizedFromLatin1(isolate, name),
|
|
18
18
|
func,
|
|
19
19
|
0,
|
|
@@ -21,16 +21,16 @@ void SetPrototypeGetter(
|
|
|
21
21
|
v8::AccessControl::DEFAULT,
|
|
22
22
|
v8::PropertyAttribute::None
|
|
23
23
|
);
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
24
|
+
#else
|
|
25
|
+
recv->InstanceTemplate()->SetNativeDataProperty(
|
|
26
|
+
InternalizedFromLatin1(isolate, name),
|
|
27
|
+
func,
|
|
28
|
+
0,
|
|
29
|
+
data
|
|
30
|
+
);
|
|
31
|
+
#endif
|
|
32
32
|
}
|
|
33
|
-
#line
|
|
33
|
+
#line 184 "./src/util/macros.lzz"
|
|
34
34
|
#ifndef V8_COMPRESS_POINTERS_IN_SHARED_CAGE
|
|
35
35
|
#define SAFE_NEW_BUFFER(env, data, length, finalizeCallback, finalizeHint) node::Buffer::New(env, data, length, finalizeCallback, finalizeHint)
|
|
36
36
|
#else
|
|
@@ -103,49 +103,49 @@ namespace Data
|
|
|
103
103
|
#line 70 "./src/util/data.lzz"
|
|
104
104
|
static char const RAW = 3;
|
|
105
105
|
}
|
|
106
|
-
#line
|
|
106
|
+
#line 38 "./src/util/macros.lzz"
|
|
107
107
|
void ThrowError (char const * message)
|
|
108
|
-
#line
|
|
108
|
+
#line 38 "./src/util/macros.lzz"
|
|
109
109
|
{ v8 :: Isolate * isolate = v8 :: Isolate :: GetCurrent ( ) ; isolate->ThrowException(v8::Exception::Error(StringFromUtf8(isolate, message, -1)));
|
|
110
110
|
}
|
|
111
|
-
#line
|
|
111
|
+
#line 39 "./src/util/macros.lzz"
|
|
112
112
|
void ThrowTypeError (char const * message)
|
|
113
|
-
#line
|
|
113
|
+
#line 39 "./src/util/macros.lzz"
|
|
114
114
|
{ v8 :: Isolate * isolate = v8 :: Isolate :: GetCurrent ( ) ; isolate->ThrowException(v8::Exception::TypeError(StringFromUtf8(isolate, message, -1)));
|
|
115
115
|
}
|
|
116
|
-
#line
|
|
116
|
+
#line 40 "./src/util/macros.lzz"
|
|
117
117
|
void ThrowRangeError (char const * message)
|
|
118
|
-
#line
|
|
118
|
+
#line 40 "./src/util/macros.lzz"
|
|
119
119
|
{ v8 :: Isolate * isolate = v8 :: Isolate :: GetCurrent ( ) ; isolate->ThrowException(v8::Exception::RangeError(StringFromUtf8(isolate, message, -1)));
|
|
120
120
|
}
|
|
121
|
-
#line
|
|
121
|
+
#line 106 "./src/util/macros.lzz"
|
|
122
122
|
v8::Local <v8::FunctionTemplate> NewConstructorTemplate (v8::Isolate * isolate, v8::Local <v8::External> data, v8::FunctionCallback func, char const * name)
|
|
123
|
-
#line
|
|
123
|
+
#line 111 "./src/util/macros.lzz"
|
|
124
124
|
{
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
125
|
+
v8::Local<v8::FunctionTemplate> t = v8::FunctionTemplate::New(isolate, func, data);
|
|
126
|
+
t->InstanceTemplate()->SetInternalFieldCount(1);
|
|
127
|
+
t->SetClassName(InternalizedFromLatin1(isolate, name));
|
|
128
|
+
return t;
|
|
129
129
|
}
|
|
130
|
-
#line
|
|
130
|
+
#line 117 "./src/util/macros.lzz"
|
|
131
131
|
void SetPrototypeMethod (v8::Isolate * isolate, v8::Local <v8::External> data, v8::Local <v8::FunctionTemplate> recv, char const * name, v8::FunctionCallback func)
|
|
132
|
-
#line
|
|
132
|
+
#line 123 "./src/util/macros.lzz"
|
|
133
133
|
{
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
134
|
+
v8::HandleScope scope(isolate);
|
|
135
|
+
recv->PrototypeTemplate()->Set(
|
|
136
|
+
InternalizedFromLatin1(isolate, name),
|
|
137
|
+
v8::FunctionTemplate::New(isolate, func, data, v8::Signature::New(isolate, recv))
|
|
138
|
+
);
|
|
139
139
|
}
|
|
140
|
-
#line
|
|
140
|
+
#line 130 "./src/util/macros.lzz"
|
|
141
141
|
void SetPrototypeSymbolMethod (v8::Isolate * isolate, v8::Local <v8::External> data, v8::Local <v8::FunctionTemplate> recv, v8::Local <v8::Symbol> symbol, v8::FunctionCallback func)
|
|
142
|
-
#line
|
|
142
|
+
#line 136 "./src/util/macros.lzz"
|
|
143
143
|
{
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
144
|
+
v8::HandleScope scope(isolate);
|
|
145
|
+
recv->PrototypeTemplate()->Set(
|
|
146
|
+
symbol,
|
|
147
|
+
v8::FunctionTemplate::New(isolate, func, data, v8::Signature::New(isolate, recv))
|
|
148
|
+
);
|
|
149
149
|
}
|
|
150
150
|
#line 4 "./src/util/constants.lzz"
|
|
151
151
|
v8::Local <v8::String> CS::Code (v8::Isolate * isolate, int code)
|
|
@@ -778,13 +778,13 @@ void Database::JS_unsafeMode (v8::FunctionCallbackInfo <v8 :: Value> const & inf
|
|
|
778
778
|
sqlite3_db_config(db->db_handle, SQLITE_DBCONFIG_DEFENSIVE, static_cast<int>(!db->unsafe_mode), NULL);
|
|
779
779
|
}
|
|
780
780
|
#line 455 "./src/objects/database.lzz"
|
|
781
|
-
void Database::JS_open (v8::Local <v8 ::
|
|
781
|
+
void Database::JS_open (v8::Local <v8 :: Name> _, v8::PropertyCallbackInfo <v8 :: Value> const & info)
|
|
782
782
|
#line 455 "./src/objects/database.lzz"
|
|
783
783
|
{
|
|
784
784
|
info.GetReturnValue().Set( node :: ObjectWrap :: Unwrap <Database>(info.This())->open);
|
|
785
785
|
}
|
|
786
786
|
#line 459 "./src/objects/database.lzz"
|
|
787
|
-
void Database::JS_inTransaction (v8::Local <v8 ::
|
|
787
|
+
void Database::JS_inTransaction (v8::Local <v8 :: Name> _, v8::PropertyCallbackInfo <v8 :: Value> const & info)
|
|
788
788
|
#line 459 "./src/objects/database.lzz"
|
|
789
789
|
{
|
|
790
790
|
Database* db = node :: ObjectWrap :: Unwrap <Database>(info.This());
|
|
@@ -1153,7 +1153,7 @@ void Statement::JS_columns (v8::FunctionCallbackInfo <v8 :: Value> const & info)
|
|
|
1153
1153
|
info.GetReturnValue().Set(columns);
|
|
1154
1154
|
}
|
|
1155
1155
|
#line 321 "./src/objects/statement.lzz"
|
|
1156
|
-
void Statement::JS_busy (v8::Local <v8 ::
|
|
1156
|
+
void Statement::JS_busy (v8::Local <v8 :: Name> _, v8::PropertyCallbackInfo <v8 :: Value> const & info)
|
|
1157
1157
|
#line 321 "./src/objects/statement.lzz"
|
|
1158
1158
|
{
|
|
1159
1159
|
Statement* stmt = node :: ObjectWrap :: Unwrap <Statement>(info.This());
|
package/src/better_sqlite3.hpp
CHANGED
|
@@ -16,48 +16,48 @@
|
|
|
16
16
|
#include <node.h>
|
|
17
17
|
#include <node_object_wrap.h>
|
|
18
18
|
#include <node_buffer.h>
|
|
19
|
-
#line
|
|
19
|
+
#line 145 "./src/util/macros.lzz"
|
|
20
20
|
void SetPrototypeGetter(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
v8::Isolate* isolate,
|
|
22
|
+
v8::Local<v8::External> data,
|
|
23
|
+
v8::Local<v8::FunctionTemplate> recv,
|
|
24
|
+
const char* name,
|
|
25
|
+
v8::AccessorNameGetterCallback func
|
|
26
26
|
);
|
|
27
27
|
#line 36 "./src/util/binder.lzz"
|
|
28
28
|
static bool IsPlainObject(v8::Isolate* isolate, v8::Local<v8::Object> obj);
|
|
29
29
|
#define LZZ_INLINE inline
|
|
30
|
-
#line
|
|
30
|
+
#line 20 "./src/util/macros.lzz"
|
|
31
31
|
v8::Local <v8::String> StringFromUtf8 (v8::Isolate * isolate, char const * data, int length);
|
|
32
|
-
#line
|
|
32
|
+
#line 23 "./src/util/macros.lzz"
|
|
33
33
|
v8::Local <v8::String> InternalizedFromUtf8 (v8::Isolate * isolate, char const * data, int length);
|
|
34
|
-
#line 22 "./src/util/macros.lzz"
|
|
35
|
-
v8::Local <v8::Value> InternalizedFromUtf8OrNull (v8::Isolate * isolate, char const * data, int length);
|
|
36
34
|
#line 26 "./src/util/macros.lzz"
|
|
37
|
-
v8::Local <v8::
|
|
35
|
+
v8::Local <v8::Value> InternalizedFromUtf8OrNull (v8::Isolate * isolate, char const * data, int length);
|
|
38
36
|
#line 30 "./src/util/macros.lzz"
|
|
39
|
-
|
|
37
|
+
v8::Local <v8::String> InternalizedFromLatin1 (v8::Isolate * isolate, char const * str);
|
|
40
38
|
#line 34 "./src/util/macros.lzz"
|
|
39
|
+
void SetFrozen (v8::Isolate * isolate, v8::Local <v8::Context> ctx, v8::Local <v8::Object> obj, v8::Global <v8::String> & key, v8::Local <v8::Value> value);
|
|
40
|
+
#line 38 "./src/util/macros.lzz"
|
|
41
41
|
void ThrowError (char const * message);
|
|
42
|
-
#line
|
|
42
|
+
#line 39 "./src/util/macros.lzz"
|
|
43
43
|
void ThrowTypeError (char const * message);
|
|
44
|
-
#line
|
|
44
|
+
#line 40 "./src/util/macros.lzz"
|
|
45
45
|
void ThrowRangeError (char const * message);
|
|
46
|
-
#line
|
|
46
|
+
#line 92 "./src/util/macros.lzz"
|
|
47
47
|
bool IS_SKIPPED (char c);
|
|
48
|
-
#line
|
|
48
|
+
#line 97 "./src/util/macros.lzz"
|
|
49
49
|
template <typename T>
|
|
50
|
-
#line
|
|
50
|
+
#line 97 "./src/util/macros.lzz"
|
|
51
51
|
T * ALLOC_ARRAY (size_t count);
|
|
52
|
-
#line
|
|
52
|
+
#line 102 "./src/util/macros.lzz"
|
|
53
53
|
template <typename T>
|
|
54
|
-
#line 98 "./src/util/macros.lzz"
|
|
55
|
-
void FREE_ARRAY (T * array_pointer);
|
|
56
54
|
#line 102 "./src/util/macros.lzz"
|
|
55
|
+
void FREE_ARRAY (T * array_pointer);
|
|
56
|
+
#line 106 "./src/util/macros.lzz"
|
|
57
57
|
v8::Local <v8::FunctionTemplate> NewConstructorTemplate (v8::Isolate * isolate, v8::Local <v8::External> data, v8::FunctionCallback func, char const * name);
|
|
58
|
-
#line
|
|
58
|
+
#line 117 "./src/util/macros.lzz"
|
|
59
59
|
void SetPrototypeMethod (v8::Isolate * isolate, v8::Local <v8::External> data, v8::Local <v8::FunctionTemplate> recv, char const * name, v8::FunctionCallback func);
|
|
60
|
-
#line
|
|
60
|
+
#line 130 "./src/util/macros.lzz"
|
|
61
61
|
void SetPrototypeSymbolMethod (v8::Isolate * isolate, v8::Local <v8::External> data, v8::Local <v8::FunctionTemplate> recv, v8::Local <v8::Symbol> symbol, v8::FunctionCallback func);
|
|
62
62
|
#line 1 "./src/util/constants.lzz"
|
|
63
63
|
class CS
|
|
@@ -277,9 +277,9 @@ private:
|
|
|
277
277
|
#line 448 "./src/objects/database.lzz"
|
|
278
278
|
static void JS_unsafeMode (v8::FunctionCallbackInfo <v8 :: Value> const & info);
|
|
279
279
|
#line 455 "./src/objects/database.lzz"
|
|
280
|
-
static void JS_open (v8::Local <v8 ::
|
|
280
|
+
static void JS_open (v8::Local <v8 :: Name> _, v8::PropertyCallbackInfo <v8 :: Value> const & info);
|
|
281
281
|
#line 459 "./src/objects/database.lzz"
|
|
282
|
-
static void JS_inTransaction (v8::Local <v8 ::
|
|
282
|
+
static void JS_inTransaction (v8::Local <v8 :: Name> _, v8::PropertyCallbackInfo <v8 :: Value> const & info);
|
|
283
283
|
#line 464 "./src/objects/database.lzz"
|
|
284
284
|
static bool Deserialize (v8::Local <v8::Object> buffer, Addon * addon, sqlite3 * db_handle, bool readonly);
|
|
285
285
|
#line 489 "./src/objects/database.lzz"
|
|
@@ -369,7 +369,7 @@ private:
|
|
|
369
369
|
#line 278 "./src/objects/statement.lzz"
|
|
370
370
|
static void JS_columns (v8::FunctionCallbackInfo <v8 :: Value> const & info);
|
|
371
371
|
#line 321 "./src/objects/statement.lzz"
|
|
372
|
-
static void JS_busy (v8::Local <v8 ::
|
|
372
|
+
static void JS_busy (v8::Local <v8 :: Name> _, v8::PropertyCallbackInfo <v8 :: Value> const & info);
|
|
373
373
|
#line 326 "./src/objects/statement.lzz"
|
|
374
374
|
Database * const db;
|
|
375
375
|
#line 327 "./src/objects/statement.lzz"
|
|
@@ -811,58 +811,58 @@ struct Addon
|
|
|
811
811
|
#line 63 "./src/better_sqlite3.lzz"
|
|
812
812
|
std::set <Database*, Database::CompareDatabase> dbs;
|
|
813
813
|
};
|
|
814
|
-
#line
|
|
814
|
+
#line 20 "./src/util/macros.lzz"
|
|
815
815
|
LZZ_INLINE v8::Local <v8::String> StringFromUtf8 (v8::Isolate * isolate, char const * data, int length)
|
|
816
|
-
#line
|
|
816
|
+
#line 20 "./src/util/macros.lzz"
|
|
817
817
|
{
|
|
818
|
-
|
|
818
|
+
return v8::String::NewFromUtf8(isolate, data, v8::NewStringType::kNormal, length).ToLocalChecked();
|
|
819
819
|
}
|
|
820
|
-
#line
|
|
820
|
+
#line 23 "./src/util/macros.lzz"
|
|
821
821
|
LZZ_INLINE v8::Local <v8::String> InternalizedFromUtf8 (v8::Isolate * isolate, char const * data, int length)
|
|
822
|
-
#line
|
|
822
|
+
#line 23 "./src/util/macros.lzz"
|
|
823
823
|
{
|
|
824
|
-
|
|
824
|
+
return v8::String::NewFromUtf8(isolate, data, v8::NewStringType::kInternalized, length).ToLocalChecked();
|
|
825
825
|
}
|
|
826
|
-
#line
|
|
826
|
+
#line 26 "./src/util/macros.lzz"
|
|
827
827
|
LZZ_INLINE v8::Local <v8::Value> InternalizedFromUtf8OrNull (v8::Isolate * isolate, char const * data, int length)
|
|
828
|
-
#line
|
|
828
|
+
#line 26 "./src/util/macros.lzz"
|
|
829
829
|
{
|
|
830
|
-
|
|
831
|
-
|
|
830
|
+
if (data == NULL) return v8::Null(isolate);
|
|
831
|
+
return InternalizedFromUtf8(isolate, data, length);
|
|
832
832
|
}
|
|
833
|
-
#line
|
|
833
|
+
#line 30 "./src/util/macros.lzz"
|
|
834
834
|
LZZ_INLINE v8::Local <v8::String> InternalizedFromLatin1 (v8::Isolate * isolate, char const * str)
|
|
835
|
-
#line
|
|
835
|
+
#line 30 "./src/util/macros.lzz"
|
|
836
836
|
{
|
|
837
|
-
|
|
837
|
+
return v8::String::NewFromOneByte(isolate, reinterpret_cast<const uint8_t*>(str), v8::NewStringType::kInternalized).ToLocalChecked();
|
|
838
838
|
}
|
|
839
|
-
#line
|
|
839
|
+
#line 34 "./src/util/macros.lzz"
|
|
840
840
|
LZZ_INLINE void SetFrozen (v8::Isolate * isolate, v8::Local <v8::Context> ctx, v8::Local <v8::Object> obj, v8::Global <v8::String> & key, v8::Local <v8::Value> value)
|
|
841
|
-
#line
|
|
841
|
+
#line 34 "./src/util/macros.lzz"
|
|
842
842
|
{
|
|
843
|
-
|
|
843
|
+
obj->DefineOwnProperty(ctx, key.Get(isolate), value, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly)).FromJust();
|
|
844
844
|
}
|
|
845
|
-
#line
|
|
845
|
+
#line 92 "./src/util/macros.lzz"
|
|
846
846
|
LZZ_INLINE bool IS_SKIPPED (char c)
|
|
847
|
-
#line
|
|
847
|
+
#line 92 "./src/util/macros.lzz"
|
|
848
848
|
{
|
|
849
|
-
|
|
849
|
+
return c == ' ' || c == ';' || (c >= '\t' && c <= '\r');
|
|
850
850
|
}
|
|
851
|
-
#line
|
|
851
|
+
#line 97 "./src/util/macros.lzz"
|
|
852
852
|
template <typename T>
|
|
853
|
-
#line
|
|
853
|
+
#line 97 "./src/util/macros.lzz"
|
|
854
854
|
LZZ_INLINE T * ALLOC_ARRAY (size_t count)
|
|
855
|
-
#line
|
|
855
|
+
#line 97 "./src/util/macros.lzz"
|
|
856
856
|
{
|
|
857
|
-
|
|
857
|
+
return static_cast<T*>(::operator new[](count * sizeof(T)));
|
|
858
858
|
}
|
|
859
|
-
#line
|
|
859
|
+
#line 102 "./src/util/macros.lzz"
|
|
860
860
|
template <typename T>
|
|
861
|
-
#line
|
|
861
|
+
#line 102 "./src/util/macros.lzz"
|
|
862
862
|
LZZ_INLINE void FREE_ARRAY (T * array_pointer)
|
|
863
|
-
#line
|
|
863
|
+
#line 102 "./src/util/macros.lzz"
|
|
864
864
|
{
|
|
865
|
-
|
|
865
|
+
::operator delete[](array_pointer);
|
|
866
866
|
}
|
|
867
867
|
#line 9 "./src/util/bind-map.lzz"
|
|
868
868
|
LZZ_INLINE int BindMap::Pair::GetIndex ()
|