sqlmath 0.0.1 → 2021.11.20

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.
Files changed (96) hide show
  1. package/.npmignore +10 -0
  2. package/CHANGELOG.md +53 -2
  3. package/LICENSE +16 -22
  4. package/README.md +18 -219
  5. package/_binary_sqlmath_napi8_darwin_x64.node +0 -0
  6. package/_binary_sqlmath_napi8_linux_x64.node +0 -0
  7. package/_binary_sqlmath_napi8_win32_x64.node +0 -0
  8. package/jslint.mjs +10998 -0
  9. package/package.json +23 -8
  10. package/sqlmath.mjs +1713 -0
  11. package/.gitconfig +0 -25
  12. package/.github/workflows/ci.yml +0 -61
  13. package/.gitignore +0 -24
  14. package/extension-functions.c +0 -2047
  15. package/jslint_ci.sh +0 -1968
  16. package/node_sqlite3.cc +0 -11877
  17. package/sqlite-autoconf-3360000/INSTALL +0 -370
  18. package/sqlite-autoconf-3360000/Makefile.am +0 -20
  19. package/sqlite-autoconf-3360000/Makefile.fallback +0 -19
  20. package/sqlite-autoconf-3360000/Makefile.in +0 -1028
  21. package/sqlite-autoconf-3360000/Makefile.msc +0 -1037
  22. package/sqlite-autoconf-3360000/README.txt +0 -113
  23. package/sqlite-autoconf-3360000/Replace.cs +0 -223
  24. package/sqlite-autoconf-3360000/aclocal.m4 +0 -10199
  25. package/sqlite-autoconf-3360000/compile +0 -347
  26. package/sqlite-autoconf-3360000/config.guess +0 -1480
  27. package/sqlite-autoconf-3360000/config.sub +0 -1801
  28. package/sqlite-autoconf-3360000/configure +0 -16135
  29. package/sqlite-autoconf-3360000/configure.ac +0 -285
  30. package/sqlite-autoconf-3360000/depcomp +0 -791
  31. package/sqlite-autoconf-3360000/install-sh +0 -508
  32. package/sqlite-autoconf-3360000/ltmain.sh +0 -11156
  33. package/sqlite-autoconf-3360000/missing +0 -215
  34. package/sqlite-autoconf-3360000/shell.c +0 -22381
  35. package/sqlite-autoconf-3360000/sqlite3.1 +0 -286
  36. package/sqlite-autoconf-3360000/sqlite3.c +0 -235517
  37. package/sqlite-autoconf-3360000/sqlite3.h +0 -12353
  38. package/sqlite-autoconf-3360000/sqlite3.pc.in +0 -13
  39. package/sqlite-autoconf-3360000/sqlite3.rc +0 -83
  40. package/sqlite-autoconf-3360000/sqlite3ext.h +0 -663
  41. package/sqlite-autoconf-3360000/sqlite3rc.h +0 -3
  42. package/sqlite-autoconf-3360000/tea/Makefile.in +0 -440
  43. package/sqlite-autoconf-3360000/tea/README +0 -36
  44. package/sqlite-autoconf-3360000/tea/aclocal.m4 +0 -9
  45. package/sqlite-autoconf-3360000/tea/configure +0 -9989
  46. package/sqlite-autoconf-3360000/tea/configure.ac +0 -201
  47. package/sqlite-autoconf-3360000/tea/doc/sqlite3.n +0 -15
  48. package/sqlite-autoconf-3360000/tea/generic/tclsqlite3.c +0 -4016
  49. package/sqlite-autoconf-3360000/tea/license.terms +0 -6
  50. package/sqlite-autoconf-3360000/tea/pkgIndex.tcl.in +0 -7
  51. package/sqlite-autoconf-3360000/tea/tclconfig/install-sh +0 -528
  52. package/sqlite-autoconf-3360000/tea/tclconfig/tcl.m4 +0 -4168
  53. package/sqlite-autoconf-3360000/tea/win/makefile.vc +0 -419
  54. package/sqlite-autoconf-3360000/tea/win/nmakehlp.c +0 -815
  55. package/sqlite-autoconf-3360000/tea/win/rules.vc +0 -711
  56. package/sqlmath.js +0 -238
  57. package/test/backup.test.js +0 -279
  58. package/test/blob.test.js +0 -54
  59. package/test/cache.test.js +0 -42
  60. package/test/constants.test.js +0 -44
  61. package/test/database_fail.test.js +0 -153
  62. package/test/each.test.js +0 -39
  63. package/test/exec.test.js +0 -39
  64. package/test/extension.test.js +0 -26
  65. package/test/extension_functions.test.js +0 -29
  66. package/test/fts-content.test.js +0 -13
  67. package/test/interrupt.test.js +0 -80
  68. package/test/issue-108.test.js +0 -28
  69. package/test/json.test.js +0 -22
  70. package/test/map.test.js +0 -63
  71. package/test/named_columns.test.js +0 -38
  72. package/test/named_params.test.js +0 -69
  73. package/test/null_error.test.js +0 -41
  74. package/test/nw/.gitignore +0 -3
  75. package/test/nw/Makefile +0 -39
  76. package/test/nw/index.html +0 -14
  77. package/test/nw/package.json +0 -9
  78. package/test/open_close.test.js +0 -187
  79. package/test/other_objects.test.js +0 -98
  80. package/test/parallel_insert.test.js +0 -44
  81. package/test/prepare.test.js +0 -427
  82. package/test/profile.test.js +0 -57
  83. package/test/rerun.test.js +0 -50
  84. package/test/scheduling.test.js +0 -44
  85. package/test/serialization.test.js +0 -104
  86. package/test/support/createdb-electron.js +0 -10
  87. package/test/support/createdb.js +0 -47
  88. package/test/support/elmo.png +0 -0
  89. package/test/support/helper.js +0 -37
  90. package/test/support/script.sql +0 -70
  91. package/test/trace.test.js +0 -67
  92. package/test/unicode.test.js +0 -114
  93. package/test/upsert.test.js +0 -27
  94. package/test/verbose.test.js +0 -60
  95. package/test.js +0 -141
  96. package/test.slr.mjs +0 -212
package/.npmignore ADDED
@@ -0,0 +1,10 @@
1
+ *
2
+ .*
3
+ !.npmignore
4
+ !CHANGELOG.md
5
+ !LICENSE
6
+ !README.md
7
+
8
+ !_binary_*
9
+ !jslint.mjs
10
+ !sqlmath.mjs
package/CHANGELOG.md CHANGED
@@ -1,4 +1,55 @@
1
1
  # Changelog
2
+
3
+ # Todo
4
+ - none
5
+
6
+ # v2021.11.20
7
+ - npm publish v2021.10.20
8
+ - update to jslint v2021.10.20
9
+ - refactor - replace nodejs-buffer-api-calls with DataView / TextDecoder / TextEncoder
10
+
11
+ # v2021.10.20
12
+ - revamp - update to jslint_ci.sh from 2020.10.2
13
+
14
+ # v2021.9.9
15
+ - add sql-function slr_ohlcv() with tests
16
+ - update file jslint_ci.sh with chorish shell-functions
17
+ - update function dbOpenAsync with ability to create thread-pool with multiple connections
18
+
19
+ # v2021.9.8
20
+ - merge files in sqlite-autoconf-3360000 into sqlite3.c, sqlite3_ext.c, sqlite3_shell.c
21
+
22
+ # v2021.9.4
23
+ - add functions dbGetLastBlob, dbTableInsertAsync
24
+ - merge file sqlmath_napi.c into sqlmath.c
25
+ - merge file test.js into sqlmath.mjs
26
+ - migrate repo to https://github.com/sqlmath/sqlmath
27
+ - migrate to esm and rename sqlmath.js to sqlmath.mjs
28
+
29
+ # v2021.8.26
30
+ - merge files sqlmath.h and sqlmath_napi.c into sqlmath.c
31
+ - add async functions dbOpen, dbExec, dbClose
32
+ - inline function sqlite3_extension_functions_init without auto_extension
33
+ - disable warnings for all targets except sqlmath.c and sqlmath_napi.c
34
+ - fix build for darwin and win32.
35
+
36
+ # v2021.8.24
37
+ - add addon functions dbOpen(), dbClose(), dbExec(). but ci works only in linux.
38
+
39
+ # v2021.8.16
40
+ - add extension-function b64decode()
41
+ - add c-function sqlite3_exec_get_tables().
42
+ - add target_cli.
43
+ - binaries - upload darwin/linux/win32 binaries to gh-pages.
44
+ - begin compiling sqlmath.c.
45
+ - jslint file sqlmath.js.
46
+ - merge file test-old-prepare.db into test-old.js.
47
+
48
+ # v2021.8.6
49
+ - add coverage testing.
50
+ - add extension-function support.
51
+ - fork repo as sqlmath.
52
+
2
53
  ## 5.0.2
3
54
  - build: rebuild binaries before publishing [#1426](https://github.com/mapbox/node-sqlite3/pull/1426)
4
55
 
@@ -13,7 +64,7 @@
13
64
 
14
65
  ## 5.0.0
15
66
  - prebuilt: Node 14 support, dropped support for all version of Node < 10 [#1304](https://github.com/mapbox/node-sqlite3/pull/1304)
16
- - prebuilt: add electron 7.2 [#1324](https://github.com/mapbox/node-sqlite3/pull/1324)
67
+ - prebuilt: add electron 7.2 [#1324](https://github.com/mapbox/node-sqlite3/pull/1324)
17
68
  - napi: refactor codebase to use N-API instead of NAN (+ various improvements) [#1304](https://github.com/mapbox/node-sqlite3/pull/1304)
18
69
  - trace: don't require throw to add trace info for verbose [#1317](https://github.com/mapbox/node-sqlite3/pull/1317)
19
70
  - ci: remove permission setting [#1319](https://github.com/mapbox/node-sqlite3/pull/1319)
@@ -276,7 +327,7 @@ Released July 14th, 2014
276
327
 
277
328
  Released Jan 13th, 2014
278
329
 
279
- - updated internal libsqlite3 from 3.7.17 -> 3.8.2 (https://www.sqlite.org/news.html) which includes the next-generation query planner http://www.sqlite.org/queryplanner-ng.html
330
+ - updated internal libsqlite3 from 3.7.17 -> 3.8.2 (https://www.sqlite.org/news.html) which includes the next-generation query planner https://www.sqlite.org/queryplanner-ng.html
280
331
  - improved binary deploy system using https://github.com/springmeyer/node-pre-gyp
281
332
  - binary install now supports http proxies
282
333
  - source compile now supports freebsd
package/LICENSE CHANGED
@@ -1,25 +1,19 @@
1
- Copyright (c) MapBox
2
- All rights reserved.
1
+ Copyright (c) 2021 Kai Zhu
3
2
 
4
- Redistribution and use in source and binary forms, with or without modification,
5
- are permitted provided that the following conditions are met:
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
6
9
 
7
- - Redistributions of source code must retain the above copyright notice, this
8
- list of conditions and the following disclaimer.
9
- - Redistributions in binary form must reproduce the above copyright notice, this
10
- list of conditions and the following disclaimer in the documentation and/or
11
- other materials provided with the distribution.
12
- - Neither the name "MapBox" nor the names of its contributors may be
13
- used to endorse or promote products derived from this software without
14
- specific prior written permission.
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
15
12
 
16
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
20
- ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
23
- ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ SOFTWARE.
package/README.md CHANGED
@@ -1,230 +1,29 @@
1
- Asynchronous, non-blocking [SQLite3](https://sqlite.org/) bindings for [Node.js](http://nodejs.org/).
1
+ # sqlmath - sqlite for data-science
2
2
 
3
- [![NPM](https://nodei.co/npm/sqlite3.png?downloads=true&downloadRank=true)](https://nodei.co/npm/sqlite3/)
4
3
 
5
- [![Build Status](https://travis-ci.org/mapbox/node-sqlite3.svg?branch=master)](https://travis-ci.org/mapbox/node-sqlite3)
6
- [![Build status](https://ci.appveyor.com/api/projects/status/gvm7ul0hpmdawqom)](https://ci.appveyor.com/project/Mapbox/node-sqlite3)
7
- [![Coverage Status](https://coveralls.io/repos/mapbox/node-sqlite3/badge.svg?branch=master&service=github)](https://coveralls.io/github/mapbox/node-sqlite3?branch=master)
8
- [![Dependencies](https://david-dm.org/mapbox/node-sqlite3.svg)](https://david-dm.org/mapbox/node-sqlite3)
9
- [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fmapbox%2Fnode-sqlite3.svg?type=shield)](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fmapbox%2Fnode-sqlite3?ref=badge_shield)
10
- [![N-API v3 Badge](https://img.shields.io/badge/N--API-v3-green.svg)](https://nodejs.org/dist/latest/docs/api/n-api.html#n_api_n_api)
4
+ # Status
5
+ | Branch | [master<br>(v2021.11.20)](https://github.com/sqlmath/sqlmath/tree/master) | [beta<br>(Web Demo)](https://github.com/sqlmath/sqlmath/tree/beta) | [alpha<br>(Development)](https://github.com/sqlmath/sqlmath/tree/alpha) |
6
+ |--:|:--:|:--:|:--:|
7
+ | CI | [![ci](https://github.com/sqlmath/sqlmath/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/sqlmath/sqlmath/actions?query=branch%3Amaster) | [![ci](https://github.com/sqlmath/sqlmath/actions/workflows/ci.yml/badge.svg?branch=beta)](https://github.com/sqlmath/sqlmath/actions?query=branch%3Abeta) | [![ci](https://github.com/sqlmath/sqlmath/actions/workflows/ci.yml/badge.svg?branch=alpha)](https://github.com/sqlmath/sqlmath/actions?query=branch%3Aalpha) |
8
+ | Coverage | [![coverage](https://sqlmath.github.io/sqlmath/branch-master/.artifact/coverage/coverage_badge.svg)](https://sqlmath.github.io/sqlmath/branch-master/.artifact/coverage/index.html) | [![coverage](https://sqlmath.github.io/sqlmath/branch-beta/.artifact/coverage/coverage_badge.svg)](https://sqlmath.github.io/sqlmath/branch-beta/.artifact/coverage/index.html) | [![coverage](https://sqlmath.github.io/sqlmath/branch-alpha/.artifact/coverage/coverage_badge.svg)](https://sqlmath.github.io/sqlmath/branch-alpha/.artifact/coverage/index.html) |
9
+ | Artifacts | [<img src="asset_image_folder_open_solid.svg" height="30">](https://github.com/sqlmath/sqlmath/tree/gh-pages/branch-master/.artifact) | [<img src="asset_image_folder_open_solid.svg" height="30">](https://github.com/sqlmath/sqlmath/tree/gh-pages/branch-beta/.artifact) | [<img src="asset_image_folder_open_solid.svg" height="30">](https://github.com/sqlmath/sqlmath/tree/gh-pages/branch-alpha/.artifact) |
11
10
 
12
- ## Supported platforms
13
11
 
14
- The `sqlite3` module works with:
15
- * Node.js v11.x, v12.x, v13.x and v14.x.
16
- * Electron v6.0.x, v6.1.x, v7.0.x, v7.1.x, v8.0.x, v8.1.x and v8.2.x
12
+ <br><br>
13
+ # Table of Contents
17
14
 
18
- Binaries for most Node versions and platforms are provided by default via [node-pre-gyp](https://github.com/mapbox/node-pre-gyp).
15
+ 1. [Package Listing](#package-listing)
19
16
 
20
- The `sqlite3` module also works with [node-webkit](https://github.com/rogerwang/node-webkit) if node-webkit contains a supported version of Node.js engine. [(See below.)](#building-for-node-webkit)
17
+ 2. [Changelog](#changelog)
21
18
 
22
- SQLite's [SQLCipher extension](https://github.com/sqlcipher/sqlcipher) is also supported. [(See below.)](#building-for-sqlcipher)
23
19
 
24
- # Usage
20
+ <br><br>
21
+ # Package Listing
22
+ ![screenshot_package_listing.svg](https://jslint-org.github.io/jslint/branch-beta/.artifact/screenshot_package_listing.svg)
25
23
 
26
- **Note:** the module must be [installed](#installing) before use.
27
24
 
28
- ``` js
29
- var sqlite3 = require('sqlite3').verbose();
30
- var db = new sqlite3.Database(':memory:');
25
+ <br><br>
26
+ # Changelog
27
+ - [Full CHANGELOG.md](CHANGELOG.md)
31
28
 
32
- db.serialize(function() {
33
- db.run("CREATE TABLE lorem (info TEXT)");
34
-
35
- var stmt = db.prepare("INSERT INTO lorem VALUES (?)");
36
- for (var i = 0; i < 10; i++) {
37
- stmt.run("Ipsum " + i);
38
- }
39
- stmt.finalize();
40
-
41
- db.each("SELECT rowid AS id, info FROM lorem", function(err, row) {
42
- console.log(row.id + ": " + row.info);
43
- });
44
- });
45
-
46
- db.close();
47
- ```
48
-
49
- # Features
50
-
51
- - Straightforward query and parameter binding interface
52
- - Full Buffer/Blob support
53
- - Extensive [debugging support](https://github.com/mapbox/node-sqlite3/wiki/Debugging)
54
- - [Query serialization](https://github.com/mapbox/node-sqlite3/wiki/Control-Flow) API
55
- - [Extension support](https://github.com/mapbox/node-sqlite3/wiki/Extensions), including bundled support for the [json1 extension](https://www.sqlite.org/json1.html).
56
- - Big test suite
57
- - Written in modern C++ and tested for memory leaks
58
- - Bundles SQLite3 3.32.3 as a fallback if the installing system doesn't include SQLite
59
-
60
- # API
61
-
62
- See the [API documentation](https://github.com/mapbox/node-sqlite3/wiki) in the wiki.
63
-
64
- # Installing
65
-
66
- You can use [`npm`](https://github.com/isaacs/npm) to download and install:
67
-
68
- * The latest `sqlite3` package: `npm install sqlite3`
69
-
70
- * GitHub's `master` branch: `npm install https://github.com/mapbox/node-sqlite3/tarball/master`
71
-
72
- The module uses [node-pre-gyp](https://github.com/mapbox/node-pre-gyp) to download a pre-compiled binary for your platform, if it exists. Otherwise, it uses `node-gyp` to build the extension.
73
-
74
- It is also possible to make your own build of `sqlite3` from its source instead of its npm package ([see below](#building-from-the-source)).
75
-
76
- It is possible to use the installed package in [node-webkit](https://github.com/rogerwang/node-webkit) instead of the vanilla Node.js. See [Building for node-webkit](#building-for-node-webkit) for details.
77
-
78
- ## Source install
79
-
80
- To skip searching for pre-compiled binaries, and force a build from source, use
81
-
82
- npm install --build-from-source
83
-
84
- The sqlite3 module depends only on libsqlite3. However, by default, an internal/bundled copy of sqlite will be built and statically linked, so an externally installed sqlite3 is not required.
85
-
86
- If you wish to install against an external sqlite then you need to pass the `--sqlite` argument to `npm` wrapper:
87
-
88
- npm install --build-from-source --sqlite=/usr/local
89
-
90
- If building against an external sqlite3 make sure to have the development headers available. Mac OS X ships with these by default. If you don't have them installed, install the `-dev` package with your package manager, e.g. `apt-get install libsqlite3-dev` for Debian/Ubuntu. Make sure that you have at least `libsqlite3` >= 3.6.
91
-
92
- Note, if building against homebrew-installed sqlite on OS X you can do:
93
-
94
- npm install --build-from-source --sqlite=/usr/local/opt/sqlite/
95
-
96
- By default the node-gyp install will use `python` as part of the installation. A
97
- different python executable can be specified on the command line.
98
-
99
- npm install --build-from-source --python=/usr/bin/python2
100
-
101
- This uses the npm_config_python config, so values in .npmrc will be honoured:
102
-
103
- python=/usr/bin/python2
104
-
105
- ## Custom file header (magic)
106
-
107
- The default sqlite file header is "SQLite format 3".
108
- You can specify a different magic, though this will make standard tools and libraries unable to work with your files.
109
-
110
-
111
- npm install --build-from-source --sqlite_magic="MyCustomMagic15"
112
-
113
-
114
- Note that the magic *must* be exactly 15 characters long (16 bytes including null terminator).
115
-
116
- ## Building for node-webkit
117
-
118
- Because of ABI differences, `sqlite3` must be built in a custom to be used with [node-webkit](https://github.com/rogerwang/node-webkit).
119
-
120
- To build node-sqlite3 for node-webkit:
121
-
122
- 1. Install [`nw-gyp`](https://github.com/rogerwang/nw-gyp) globally: `npm install nw-gyp -g` *(unless already installed)*
123
-
124
- 2. Build the module with the custom flags of `--runtime`, `--target_arch`, and `--target`:
125
-
126
- ```sh
127
- NODE_WEBKIT_VERSION="0.8.6" # see latest version at https://github.com/rogerwang/node-webkit#downloads
128
- npm install sqlite3 --build-from-source --runtime=node-webkit --target_arch=ia32 --target=$(NODE_WEBKIT_VERSION)
129
- ```
130
-
131
- This command internally calls out to [`node-pre-gyp`](https://github.com/mapbox/node-pre-gyp) which itself calls out to [`nw-gyp`](https://github.com/rogerwang/nw-gyp) when the `--runtime=node-webkit` option is passed.
132
-
133
- You can also run this command from within a `node-sqlite3` checkout:
134
-
135
- ```sh
136
- npm install --build-from-source --runtime=node-webkit --target_arch=ia32 --target=$(NODE_WEBKIT_VERSION)
137
- ```
138
-
139
- Remember the following:
140
-
141
- * You must provide the right `--target_arch` flag. `ia32` is needed to target 32bit node-webkit builds, while `x64` will target 64bit node-webkit builds (if available for your platform).
142
-
143
- * After the `sqlite3` package is built for node-webkit it cannot run in the vanilla Node.js (and vice versa).
144
- * For example, `npm test` of the node-webkit's package would fail.
145
-
146
- Visit the “[Using Node modules](https://github.com/rogerwang/node-webkit/wiki/Using-Node-modules)” article in the node-webkit's wiki for more details.
147
-
148
- ## Building for sqlcipher
149
-
150
- For instructions for building sqlcipher see
151
- [Building SQLCipher for node.js](https://coolaj86.com/articles/building-sqlcipher-for-node-js-on-raspberry-pi-2/)
152
-
153
- To run node-sqlite3 against sqlcipher you need to compile from source by passing build options like:
154
-
155
- npm install sqlite3 --build-from-source --sqlite_libname=sqlcipher --sqlite=/usr/
156
-
157
- node -e 'require("sqlite3")'
158
-
159
- If your sqlcipher is installed in a custom location (if you compiled and installed it yourself),
160
- you'll also need to to set some environment variables:
161
-
162
- ### On OS X with Homebrew
163
-
164
- Set the location where `brew` installed it:
165
-
166
- export LDFLAGS="-L`brew --prefix`/opt/sqlcipher/lib"
167
- export CPPFLAGS="-I`brew --prefix`/opt/sqlcipher/include"
168
- npm install sqlite3 --build-from-source --sqlite_libname=sqlcipher --sqlite=`brew --prefix`
169
-
170
- node -e 'require("sqlite3")'
171
-
172
- ### On most Linuxes (including Raspberry Pi)
173
-
174
- Set the location where `make` installed it:
175
-
176
- export LDFLAGS="-L/usr/local/lib"
177
- export CPPFLAGS="-I/usr/local/include -I/usr/local/include/sqlcipher"
178
- export CXXFLAGS="$CPPFLAGS"
179
- npm install sqlite3 --build-from-source --sqlite_libname=sqlcipher --sqlite=/usr/local --verbose
180
-
181
- node -e 'require("sqlite3")'
182
-
183
- ### Custom builds and Electron
184
-
185
- Running sqlite3 through [electron-rebuild](https://github.com/electron/electron-rebuild) does not preserve the sqlcipher extension, so some additional flags are needed to make this build Electron compatible. Your `npm install sqlite3 --build-from-source` command needs these additional flags (be sure to replace the target version with the current Electron version you are working with):
186
-
187
- --runtime=electron --target=1.7.6 --dist-url=https://electronjs.org/headers
188
-
189
- In the case of MacOS with Homebrew, the command should look like the following:
190
-
191
- npm install sqlite3 --build-from-source --sqlite_libname=sqlcipher --sqlite=`brew --prefix` --runtime=electron --target=1.7.6 --dist-url=https://electronjs.org/headers
192
-
193
- # Testing
194
-
195
- [mocha](https://github.com/visionmedia/mocha) is required to run unit tests.
196
-
197
- In sqlite3's directory (where its `package.json` resides) run the following:
198
-
199
- npm install mocha
200
- npm test
201
-
202
- # Contributors
203
-
204
- * [Konstantin Käfer](https://github.com/kkaefer)
205
- * [Dane Springmeyer](https://github.com/springmeyer)
206
- * [Will White](https://github.com/willwhite)
207
- * [Orlando Vazquez](https://github.com/orlandov)
208
- * [Artem Kustikov](https://github.com/artiz)
209
- * [Eric Fredricksen](https://github.com/grumdrig)
210
- * [John Wright](https://github.com/mrjjwright)
211
- * [Ryan Dahl](https://github.com/ry)
212
- * [Tom MacWright](https://github.com/tmcw)
213
- * [Carter Thaxton](https://github.com/carter-thaxton)
214
- * [Audrius Kažukauskas](https://github.com/audriusk)
215
- * [Johannes Schauer](https://github.com/pyneo)
216
- * [Mithgol](https://github.com/Mithgol)
217
-
218
- # Acknowledgments
219
-
220
- Thanks to [Orlando Vazquez](https://github.com/orlandov),
221
- [Eric Fredricksen](https://github.com/grumdrig) and
222
- [Ryan Dahl](https://github.com/ry) for their SQLite bindings for node, and to mraleph on Freenode's #v8 for answering questions.
223
-
224
- Development of this module is sponsored by [MapBox](https://mapbox.com/).
225
-
226
- # License
227
-
228
- `node-sqlite3` is [BSD licensed](https://github.com/mapbox/node-sqlite3/raw/master/LICENSE).
229
-
230
- [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fmapbox%2Fnode-sqlite3.svg?type=large)](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fmapbox%2Fnode-sqlite3?ref=badge_large)
29
+ ![screenshot_changelog.svg](https://jslint-org.github.io/jslint/branch-beta/.artifact/screenshot_changelog.svg)