sqlmath 0.0.1 → 0.0.2

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 (100) hide show
  1. package/.gitconfig +2 -2
  2. package/.github/workflows/ci.yml +73 -15
  3. package/.github/workflows/publish.yml +66 -0
  4. package/.gitignore +1 -5
  5. package/CHANGELOG.md +53 -2
  6. package/LICENSE +16 -22
  7. package/README.md +18 -219
  8. package/asset_image_folder_open_solid.svg +1 -0
  9. package/jslint.mjs +10998 -0
  10. package/jslint_ci.sh +1542 -728
  11. package/package.json +23 -8
  12. package/{sqlite-autoconf-3360000/sqlite3.c → sqlite3.c} +13116 -85
  13. package/sqlite3_ext.c +8372 -0
  14. package/{sqlite-autoconf-3360000/shell.c → sqlite3_shell.c} +330 -275
  15. package/sqlmath.mjs +1713 -0
  16. package/sqlmath_base.c +1832 -0
  17. package/sqlmath_custom.c +78 -0
  18. package/sqlmath_custom.cpp +0 -0
  19. package/sqlmath_custom.mjs +4 -0
  20. package/sqlmath_old.js +31038 -0
  21. package/extension-functions.c +0 -2047
  22. package/node_sqlite3.cc +0 -11877
  23. package/sqlite-autoconf-3360000/INSTALL +0 -370
  24. package/sqlite-autoconf-3360000/Makefile.am +0 -20
  25. package/sqlite-autoconf-3360000/Makefile.fallback +0 -19
  26. package/sqlite-autoconf-3360000/Makefile.in +0 -1028
  27. package/sqlite-autoconf-3360000/Makefile.msc +0 -1037
  28. package/sqlite-autoconf-3360000/README.txt +0 -113
  29. package/sqlite-autoconf-3360000/Replace.cs +0 -223
  30. package/sqlite-autoconf-3360000/aclocal.m4 +0 -10199
  31. package/sqlite-autoconf-3360000/compile +0 -347
  32. package/sqlite-autoconf-3360000/config.guess +0 -1480
  33. package/sqlite-autoconf-3360000/config.sub +0 -1801
  34. package/sqlite-autoconf-3360000/configure +0 -16135
  35. package/sqlite-autoconf-3360000/configure.ac +0 -285
  36. package/sqlite-autoconf-3360000/depcomp +0 -791
  37. package/sqlite-autoconf-3360000/install-sh +0 -508
  38. package/sqlite-autoconf-3360000/ltmain.sh +0 -11156
  39. package/sqlite-autoconf-3360000/missing +0 -215
  40. package/sqlite-autoconf-3360000/sqlite3.1 +0 -286
  41. package/sqlite-autoconf-3360000/sqlite3.h +0 -12353
  42. package/sqlite-autoconf-3360000/sqlite3.pc.in +0 -13
  43. package/sqlite-autoconf-3360000/sqlite3.rc +0 -83
  44. package/sqlite-autoconf-3360000/sqlite3ext.h +0 -663
  45. package/sqlite-autoconf-3360000/sqlite3rc.h +0 -3
  46. package/sqlite-autoconf-3360000/tea/Makefile.in +0 -440
  47. package/sqlite-autoconf-3360000/tea/README +0 -36
  48. package/sqlite-autoconf-3360000/tea/aclocal.m4 +0 -9
  49. package/sqlite-autoconf-3360000/tea/configure +0 -9989
  50. package/sqlite-autoconf-3360000/tea/configure.ac +0 -201
  51. package/sqlite-autoconf-3360000/tea/doc/sqlite3.n +0 -15
  52. package/sqlite-autoconf-3360000/tea/generic/tclsqlite3.c +0 -4016
  53. package/sqlite-autoconf-3360000/tea/license.terms +0 -6
  54. package/sqlite-autoconf-3360000/tea/pkgIndex.tcl.in +0 -7
  55. package/sqlite-autoconf-3360000/tea/tclconfig/install-sh +0 -528
  56. package/sqlite-autoconf-3360000/tea/tclconfig/tcl.m4 +0 -4168
  57. package/sqlite-autoconf-3360000/tea/win/makefile.vc +0 -419
  58. package/sqlite-autoconf-3360000/tea/win/nmakehlp.c +0 -815
  59. package/sqlite-autoconf-3360000/tea/win/rules.vc +0 -711
  60. package/sqlmath.js +0 -238
  61. package/test/backup.test.js +0 -279
  62. package/test/blob.test.js +0 -54
  63. package/test/cache.test.js +0 -42
  64. package/test/constants.test.js +0 -44
  65. package/test/database_fail.test.js +0 -153
  66. package/test/each.test.js +0 -39
  67. package/test/exec.test.js +0 -39
  68. package/test/extension.test.js +0 -26
  69. package/test/extension_functions.test.js +0 -29
  70. package/test/fts-content.test.js +0 -13
  71. package/test/interrupt.test.js +0 -80
  72. package/test/issue-108.test.js +0 -28
  73. package/test/json.test.js +0 -22
  74. package/test/map.test.js +0 -63
  75. package/test/named_columns.test.js +0 -38
  76. package/test/named_params.test.js +0 -69
  77. package/test/null_error.test.js +0 -41
  78. package/test/nw/.gitignore +0 -3
  79. package/test/nw/Makefile +0 -39
  80. package/test/nw/index.html +0 -14
  81. package/test/nw/package.json +0 -9
  82. package/test/open_close.test.js +0 -187
  83. package/test/other_objects.test.js +0 -98
  84. package/test/parallel_insert.test.js +0 -44
  85. package/test/prepare.test.js +0 -427
  86. package/test/profile.test.js +0 -57
  87. package/test/rerun.test.js +0 -50
  88. package/test/scheduling.test.js +0 -44
  89. package/test/serialization.test.js +0 -104
  90. package/test/support/createdb-electron.js +0 -10
  91. package/test/support/createdb.js +0 -47
  92. package/test/support/elmo.png +0 -0
  93. package/test/support/helper.js +0 -37
  94. package/test/support/script.sql +0 -70
  95. package/test/trace.test.js +0 -67
  96. package/test/unicode.test.js +0 -114
  97. package/test/upsert.test.js +0 -27
  98. package/test/verbose.test.js +0 -60
  99. package/test.js +0 -141
  100. package/test.slr.mjs +0 -212
package/.gitconfig CHANGED
@@ -19,7 +19,7 @@
19
19
  denyCurrentBranch = warn
20
20
  [remote "origin"]
21
21
  fetch = +refs/heads/*:refs/remotes/origin/*
22
- url = https://github.com/user/sqlmath.js
22
+ url = https://github.com/user/sqlmath
23
23
  [remote "upstream"]
24
24
  fetch = +refs/heads/*:refs/remotes/upstream/*
25
- url = https://github.com/sqlmath/sqlmath.js
25
+ url = https://github.com/sqlmath/sqlmath
@@ -14,10 +14,11 @@ on:
14
14
  - beta
15
15
  - master
16
16
  - sandbox
17
- # shCiBase - start
18
17
  jobs:
19
- build:
20
- runs-on: ${{ matrix.os }}
18
+
19
+
20
+ # shCiBase - start
21
+ job1:
21
22
  strategy:
22
23
  matrix:
23
24
  architecture:
@@ -27,35 +28,92 @@ jobs:
27
28
  node_version:
28
29
  # - 12
29
30
  - 14
30
- # - 16
31
+ - 16
31
32
  os:
32
33
  - macos-latest
33
34
  - ubuntu-latest
34
35
  - windows-latest
35
- name: node . v${{ matrix.node_version }} . ${{ matrix.architecture }} . ${{ matrix.os }}
36
+ name: job1 . node . v${{ matrix.node_version }} . ${{ matrix.architecture }} . ${{ matrix.os }}
37
+ runs-on: ${{ matrix.os }}
36
38
  steps:
37
39
  # disable autocrlf in windows
38
40
  - run: git config --global core.autocrlf false
39
41
  # https://github.com/actions/checkout
40
42
  - uses: actions/checkout@v2
43
+ # https://github.com/actions/cache
44
+ - uses: actions/cache@v2
45
+ with:
46
+ key: ${{ matrix.architecture }}-${{ matrix.node_version }}-${{ matrix.os }}-${{ hashFiles('./package.json') }}
47
+ path: .cache
41
48
  # https://github.com/actions/setup-node
42
49
  - uses: actions/setup-node@v2
43
50
  with:
44
51
  node-version: ${{ matrix.node_version }}
45
52
  architecture: ${{ matrix.architecture }}
46
53
  # fetch jslint_ci.sh from trusted source
47
- - run: git fetch origin alpha && git checkout origin/alpha jslint_ci.sh
54
+ - run: git fetch origin alpha && git checkout origin/alpha .ci.sh jslint_ci.sh
48
55
  # run nodejs coverages and tests
49
56
  - run: sh jslint_ci.sh shCiBase
50
57
  # shCiBase - end
51
- #!! # fetch jslint_ci.sh from trusted source
52
- #!! - run: git fetch origin alpha && git checkout origin/alpha jslint_ci.sh
53
- #!! # upload build-artifacts to branch-gh-pages
54
- #!! - run: sh jslint_ci.sh shCiArtifactUpload
55
- #!! env:
56
- #!! CI_NODE_VERSION_ARCH_PLATFORM: v14.x64.linux
57
- #!! GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58
+
59
+
60
+ # shCiArtifactUpload - start
61
+ # fetch jslint_ci.sh from trusted source
62
+ - run: git fetch origin alpha && git checkout origin/alpha .ci.sh jslint_ci.sh
63
+ # upload build-artifacts to branch-gh-pages
64
+ - run: sh jslint_ci.sh shCiArtifactUpload
65
+ env:
66
+ CI_NODE_VERSION_ARCH_PLATFORM: v16.x64.linux
67
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
68
+ # shCiArtifactUpload - end
69
+
70
+
71
+ # upload binaries - start
58
72
  - uses: actions/upload-artifact@v2
59
73
  with:
60
- name: lib
61
- path: lib
74
+ name: binaries
75
+ path: _binary_*
76
+ # upload binaries - end
77
+
78
+
79
+ job2:
80
+ needs: job1
81
+ strategy:
82
+ matrix:
83
+ architecture:
84
+ # - arm64
85
+ - x64
86
+ # - x86
87
+ node_version:
88
+ # - 12
89
+ # - 14
90
+ - 16
91
+ os:
92
+ # - macos-latest
93
+ - ubuntu-latest
94
+ # - windows-latest
95
+ name: job2 . node . v${{ matrix.node_version }} . ${{ matrix.architecture }} . ${{ matrix.os }}
96
+ runs-on: ${{ matrix.os }}
97
+ steps:
98
+ # disable autocrlf in windows
99
+ - run: git config --global core.autocrlf false
100
+ # https://github.com/actions/checkout
101
+ - uses: actions/checkout@v2
102
+
103
+
104
+ # download binaries - start
105
+ - uses: actions/download-artifact@v2
106
+ with:
107
+ name: binaries
108
+ # download binaries - end
109
+
110
+
111
+ # shCiArtifactUpload2 - start
112
+ # fetch jslint_ci.sh from trusted source
113
+ - run: git fetch origin alpha && git checkout origin/alpha .ci.sh jslint_ci.sh
114
+ # upload build-artifacts to branch-gh-pages
115
+ - run: sh jslint_ci.sh shCiArtifactUpload2
116
+ env:
117
+ CI_NODE_VERSION_ARCH_PLATFORM: v16.x64.linux
118
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
119
+ # shCiArtifactUpload2 - end
@@ -0,0 +1,66 @@
1
+ # Publishing packages to npm and GitHub Packages
2
+ # https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages#publishing-packages-to-npm-and-github-packages
3
+ name: publish
4
+ on:
5
+ release:
6
+ types: [created]
7
+ workflow_dispatch:
8
+ branches:
9
+ - alpha
10
+ - beta
11
+ - master
12
+ - sandbox
13
+ jobs:
14
+
15
+
16
+ # npm publish - start
17
+ build:
18
+ strategy:
19
+ matrix:
20
+ architecture:
21
+ # - arm64
22
+ - x64
23
+ # - x86
24
+ node_version:
25
+ # - 12
26
+ # - 14
27
+ - 16
28
+ os:
29
+ # - macos-latest
30
+ - ubuntu-latest
31
+ # - windows-latest
32
+ name: job1 . node . v${{ matrix.node_version }} . ${{ matrix.architecture }} . ${{ matrix.os }}
33
+ runs-on: ${{ matrix.os }}
34
+ permissions:
35
+ contents: read
36
+ packages: write
37
+ steps:
38
+
39
+ #!! # Setup .npmrc file to publish to GitHub Packages
40
+ #!! - run: rm -f /home/runner/work/_temp/.npmrc
41
+ #!! - uses: actions/checkout@v2
42
+ #!! - uses: actions/setup-node@v2
43
+ #!! with:
44
+ #!! node-version: ${{ matrix.node_version }}
45
+ #!! architecture: ${{ matrix.architecture }}
46
+ #!! registry-url: 'https://npm.pkg.github.com'
47
+ #!! # Defaults to the user or organization that owns the workflow file
48
+ #!! # scope: '@octocat'
49
+ #!! # Publish to GitHub Packages
50
+ #!! - run: sh jslint_ci.sh shCiNpmPublishCustom
51
+ #!! env:
52
+ #!! NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53
+
54
+ # Setup .npmrc file to publish to npm
55
+ - run: rm -f /home/runner/work/_temp/.npmrc
56
+ - uses: actions/checkout@v2
57
+ - uses: actions/setup-node@v2
58
+ with:
59
+ node-version: ${{ matrix.node_version }}
60
+ architecture: ${{ matrix.architecture }}
61
+ registry-url: 'https://registry.npmjs.org'
62
+ # Publish to npm
63
+ - run: sh jslint_ci.sh shCiNpmPublishCustom
64
+ env:
65
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
66
+ # npm publish - end
package/.gitignore CHANGED
@@ -17,8 +17,4 @@ undefined
17
17
  !.github
18
18
  !.gitignore
19
19
 
20
- jslint.cjs
21
- jslint.js
22
-
23
- *.db
24
- build
20
+ sqlite-autoconf-3360000
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.7.24)](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)
@@ -0,0 +1 @@
1
+ <svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="folder-open" class="svg-inline--fa fa-folder-open fa-w-18" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path fill="currentColor" d="M572.694 292.093L500.27 416.248A63.997 63.997 0 0 1 444.989 448H45.025c-18.523 0-30.064-20.093-20.731-36.093l72.424-124.155A64 64 0 0 1 152 256h399.964c18.523 0 30.064 20.093 20.73 36.093zM152 224h328v-48c0-26.51-21.49-48-48-48H272l-64-64H48C21.49 64 0 85.49 0 112v278.046l69.077-118.418C86.214 242.25 117.989 224 152 224z"></path></svg>