fts5sqljs 1.12.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,105 @@
1
+ # We build our DevContainer on MS' Typescript-Node Devcontainer
2
+ # This gives us lots of standard stuff, and lets us layer a few custom things on top, like the Emscripten compiler, Puppeteer
3
+
4
+ # --------------------------------------------------------------------
5
+ # BEGIN Standard MS Devcontainer for Typescript-Node
6
+
7
+ # See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.155.1/containers/typescript-node/.devcontainer/base.Dockerfile
8
+ # [Choice] Node.js version: 14, 12, 10
9
+ ARG VARIANT="16-buster"
10
+ FROM mcr.microsoft.com/vscode/devcontainers/typescript-node:0-${VARIANT}
11
+
12
+ # [Optional] Uncomment if you want to install an additional version of node using nvm
13
+ # ARG EXTRA_NODE_VERSION=10
14
+ # RUN su node -c "source /usr/local/share/nvm/nvm.sh && nvm install ${EXTRA_NODE_VERSION}"
15
+
16
+ # [Optional] Uncomment if you want to install more global node packages
17
+ # RUN su node -c "npm install -g <your-package-list -here>"
18
+
19
+ # END Standard MS Devcontainer for Typescript-Node
20
+ # --------------------------------------------------------------------
21
+
22
+ # --------------------------------------------------------------------
23
+ # BEGIN EMSDK
24
+ # Install EMSDK to /emsdk just like the EMSDK Dockerfile: https://github.com/emscripten-core/emsdk/blob/master/docker/Dockerfile
25
+ ENV EMSDK /emsdk
26
+ # We pin the EMSDK version rather than 'latest' so that everyone is using the same compiler version
27
+ ENV EMSCRIPTEN_VERSION 3.1.64
28
+
29
+ RUN git clone https://github.com/emscripten-core/emsdk.git $EMSDK
30
+
31
+ RUN echo "## Install Emscripten" \
32
+ && cd ${EMSDK} \
33
+ && ./emsdk install ${EMSCRIPTEN_VERSION} \
34
+ && echo "## Done"
35
+
36
+ # Copied directly from https://github.com/emscripten-core/emsdk/blob/master/docker/Dockerfile
37
+ RUN cd ${EMSDK} \
38
+ && echo "## Generate standard configuration" \
39
+ && ./emsdk activate ${EMSCRIPTEN_VERSION} \
40
+ && chmod 777 ${EMSDK}/upstream/emscripten \
41
+ && chmod -R 777 ${EMSDK}/upstream/emscripten/cache \
42
+ && echo "int main() { return 0; }" > hello.c \
43
+ && ${EMSDK}/upstream/emscripten/emcc -c hello.c \
44
+ && cat ${EMSDK}/upstream/emscripten/cache/sanity.txt \
45
+ && echo "## Done"
46
+
47
+ ENV PATH $EMSDK:$EMSDK/upstream/emscripten/:$PATH
48
+
49
+ # Cleanup Emscripten installation and strip some symbols
50
+ # Copied directly from https://github.com/emscripten-core/emsdk/blob/master/docker/Dockerfile
51
+ RUN echo "## Aggressive optimization: Remove debug symbols" \
52
+ && cd ${EMSDK} && . ./emsdk_env.sh \
53
+ # Remove debugging symbols from embedded node (extra 7MB)
54
+ && strip -s `which node` \
55
+ # Tests consume ~80MB disc space
56
+ && rm -fr ${EMSDK}/upstream/emscripten/tests \
57
+ # Fastcomp is not supported
58
+ && rm -fr ${EMSDK}/upstream/fastcomp \
59
+ # strip out symbols from clang (~extra 50MB disc space)
60
+ && find ${EMSDK}/upstream/bin -type f -exec strip -s {} + || true \
61
+ && echo "## Done"
62
+
63
+ RUN echo ". /emsdk/emsdk_env.sh" >> /etc/bash.bashrc
64
+ # We must set the EM_NODE_JS environment variable for a somewhat silly reason
65
+ # We run our build scripts with `npm run`, which sets the NODE environment variable as it runs.
66
+ # The EMSDK picks up on that environment variable and gives a deprecation warning: warning: honoring legacy environment variable `NODE`. Please switch to using `EM_NODE_JS` instead`
67
+ # So, we are going to put this environment variable here explicitly to avoid the deprecation warning.
68
+ RUN echo 'export EM_NODE_JS="$EMSDK_NODE"' >> /etc/bash.bashrc
69
+
70
+ # END EMSDK
71
+ # --------------------------------------------------------------------
72
+
73
+ # --------------------------------------------------------------------
74
+ # BEGIN PUPPETEER dependencies
75
+ # Here we install all of the packages depended upon by Chrome (that Puppeteer will use for headless tests).
76
+ # We could also take a page from https://github.com/buildkite/docker-puppeteer/blob/master/Dockerfile instead,
77
+ # and install the latest stable version of Chrome to get the right dependencies, but that version changes over time,
78
+ # so the stable version of Chrome and the version installed by Puppeteer might diverge over time.
79
+ # It also means they end up having Chrome downloaded and installed twice.
80
+ # We could install the particular version of Chrome that our version of Puppeteer would use and then tell Puppeteer not to download its own version of Chrome,
81
+ # but then we'd have to rebuild our Docker container every time we revved Puppeteer, and that feels fiddly too.
82
+ # For all of these reasons, it seems safer to simply install the explicit list packages depended upon by Chrome, assume that's unlikely to change
83
+ # and move on.
84
+
85
+ # List taken from:
86
+ # https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md#chrome-headless-doesnt-launch-on-unix
87
+ RUN apt-get update \
88
+ && apt-get install -y wget gnupg \
89
+ && wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
90
+ && sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
91
+ && apt-get update \
92
+ && apt-get install -y google-chrome-stable fonts-freefont-ttf libxss1 libxshmfence1 libglu1 \
93
+ --no-install-recommends \
94
+ # Installs the command "sha3sum", which is used check the download integrity of sqlite source.
95
+ && apt-get install -y libdigest-sha3-perl \
96
+ && rm -rf /var/lib/apt/lists/*
97
+
98
+ # We set this env variable (RUN_WORKER_TEST_WITHOUT_PUPPETEER_SANDBOX=1) this to tell our sql.js test harness to run Puppeteer without the sandbox.
99
+ # Otherwise, when we instantiate Puppeteer, we get this error:
100
+ # Puppeteer can't start due to a sandbox error. (Details follow.)
101
+ # [0321/173044.694524:FATAL:zygote_host_impl_linux.cc(117)] No usable sandbox! Update your kernel or see https://chromium.googlesource.com/chromium/src/+/master/docs/linux/suid_sandbox_development.md for more information on developing with the SUID sandbox. If you want to live dangerously and need an immediate workaround, you can try using --no-sandbox.
102
+ ENV RUN_WORKER_TEST_WITHOUT_PUPPETEER_SANDBOX=1
103
+
104
+ # END PUPPETEER
105
+ # --------------------------------------------------------------------
@@ -0,0 +1,26 @@
1
+ // For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
2
+ // https://github.com/microsoft/vscode-dev-containers/tree/v0.155.1/containers/typescript-node
3
+ {
4
+ "name": "Node.js & TypeScript",
5
+ "build": {
6
+ "dockerfile": "Dockerfile",
7
+ // Update 'VARIANT' to pick a Node version: 12, 14, 16
8
+ "args": {
9
+ "VARIANT": "16-buster"
10
+ },
11
+ },
12
+ // Set *default* container specific settings.json values on container create.
13
+ "settings": {},
14
+ // Add the IDs of extensions you want installed when the container is created.
15
+ "extensions": [
16
+ "dbaeumer.vscode-eslint"
17
+ ],
18
+ // Use 'forwardPorts' to make a list of ports inside the container available locally.
19
+ // "forwardPorts": [],
20
+ // Use 'postCreateCommand' to run commands after the container is created.
21
+ // We use `npm ci` instead of `npm install` because we want to respect the lockfile and ONLY the lockfile.
22
+ // That way, our devcontainer is more reproducible. --Taytay
23
+ "postCreateCommand": "npm ci",
24
+ // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
25
+ "remoteUser": "node"
26
+ }
package/.eslintrc.js ADDED
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+
3
+ module.exports = {
4
+ env: {
5
+ browser: true,
6
+ es6: true,
7
+ node: true
8
+ },
9
+ extends: [
10
+ "airbnb-base"
11
+ ],
12
+ globals: {
13
+ Atomics: "readonly",
14
+ SharedArrayBuffer: "readonly"
15
+ },
16
+ ignorePatterns: [
17
+ "/dist/",
18
+ "/examples/",
19
+ "/documentation/",
20
+ "/node_modules/",
21
+ "/out/",
22
+ "/src/shell-post.js",
23
+ "/src/shell-pre.js",
24
+ "/test/",
25
+ "!/.eslintrc.js"
26
+ ],
27
+ parserOptions: {
28
+ ecmaVersion: 5,
29
+ sourceType: "script"
30
+ },
31
+ rules: {
32
+ // reason - sqlite exposes functions with underscore-naming-convention
33
+ camelcase: "off",
34
+ // reason - They make it easier to add new elements to arrays
35
+ // and parameters to functions, and make commit diffs clearer
36
+ "comma-dangle": "off",
37
+ // reason - string-notation needed to prevent closure-minifier
38
+ // from mangling property-name
39
+ "dot-notation": "off",
40
+ // reason - enforce 4-space indent
41
+ indent: ["error", 4, { SwitchCase: 1 }],
42
+ // reason - enforce 80-column-width limit
43
+ "max-len": ["error", { code: 80 }],
44
+ // reason - src/api.js uses bitwise-operators
45
+ "no-bitwise": "off",
46
+ "no-cond-assign": ["error", "except-parens"],
47
+ "no-param-reassign": "off",
48
+ "no-throw-literal": "off",
49
+ // reason - parserOptions is set to es5 language-syntax
50
+ "no-var": "off",
51
+ // reason - parserOptions is set to es5 language-syntax
52
+ "object-shorthand": "off",
53
+ // reason - parserOptions is set to es5 language-syntax
54
+ "prefer-arrow-callback": "off",
55
+ // reason - parserOptions is set to es5 language-syntax
56
+ "prefer-destructuring": "off",
57
+ // reason - parserOptions is set to es5 language-syntax
58
+ "prefer-spread": "off",
59
+ // reason - parserOptions is set to es5 language-syntax
60
+ "prefer-template": "off",
61
+ // reason - sql.js frequently use sql-query-strings containing
62
+ // single-quotes
63
+ quotes: ["error", "double"],
64
+ // reason - allow top-level "use-strict" in commonjs-modules
65
+ strict: ["error", "safe"],
66
+ "vars-on-top": "off"
67
+ }
68
+ };
@@ -0,0 +1,38 @@
1
+ {
2
+ "plugins": [
3
+ "plugins/markdown"
4
+ ],
5
+ "source": {
6
+ "include": [
7
+ "src/api.js"
8
+ ]
9
+ },
10
+ "opts": {
11
+ "encoding": "utf8",
12
+ "destination": "./documentation/",
13
+ "readme": "documentation_index.md",
14
+ "template": "./node_modules/clean-jsdoc-theme",
15
+ "theme_opts": {
16
+ "title": "sql.js",
17
+ "meta": [
18
+ "<title>sql.js API documentation</title>",
19
+ "<meta name=\"author\" content=\"Ophir Lojkine\">",
20
+ "<meta name=\"description\" content=\"Documentation for sql.js: an in-memory SQL database for the browser based on SQLite.\">"
21
+ ],
22
+ "menu": [
23
+ {
24
+ "title": "Website",
25
+ "link": "https://sql.js.org/"
26
+ },
27
+ {
28
+ "title": "Github",
29
+ "link": "https://github.com/sql-js/sql.js"
30
+ },
31
+ {
32
+ "title": "Demo",
33
+ "link": "https://sql.js.org/examples/GUI/"
34
+ }
35
+ ]
36
+ }
37
+ }
38
+ }
package/.nojekyll ADDED
File without changes
package/AUTHORS ADDED
@@ -0,0 +1,8 @@
1
+ Ophir LOJKINE <pere.jobs@gmail.com> (https://github.com/lovasoa)
2
+ @kripken
3
+ @hankinsoft
4
+ @firien
5
+ @dinedal
6
+ @taytay
7
+ @kaizhu256
8
+ @brodybits
@@ -0,0 +1,66 @@
1
+
2
+ # Compiling and Contributing
3
+
4
+ General consumers of this library don't need to read any further. (The compiled files are available via the [release page](https://github.com/sql-js/sql.js/releases).)
5
+
6
+ If you want to compile your own version of SQLite for WebAssembly, or want to contribute to this project, read on.
7
+
8
+ ## Setting up your Development Environment
9
+
10
+ ### Containerized Development Environment (Recommended)
11
+
12
+ This project defines a standardized development environment using Docker (and the .devcontainer spec in particular). This allows for anyone on any platform to get up and running quickly. (VSCode is not technically required to make use of this standardized environment, but it makes containerized development so seamless that the non-VSCode path is not currently documented here.)
13
+
14
+ Standardizing our development environment has numerous benefits:
15
+ - Allows anyone on ANY platform (Linux, Mac, and Windows) to contribute or compile their own build.
16
+ - It's quicker and easier for any contributor to dive in and fix issues.
17
+ - (Practically) eliminates configuration bugs that are difficult for maintainers to reproduce. Also known as "works on my machine" issues.
18
+ - Allows us to write our scripts assuming that they're _always_ running in a single known environment of a single, known platform.
19
+ - Ensure that all contributors use a known, standardized installation of EMSDK.
20
+ - Allows for a more clearly documented process for updating the EMSDK to a new version.
21
+ - End-Users that simply want to compile and install their own version of SQLite don't have to bother with EMSDK installation in their particular environment.
22
+
23
+ To get started:
24
+
25
+ 1. Follow the [Installation Steps for Containerized Development in VSCode](https://code.visualstudio.com/docs/remote/containers#_installation). This includes installing Docker, VSCode, and the [Remote Development extension pack](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.vscode-remote-extensionpack) for VSCode)
26
+ 2. Clone this repository
27
+ 3. Open the repository folder in VSCode. It will detect the presence of a .devcontainer and prompt you: "Folder contains a Dev Container configuration file. Reopen folder to develop in a container." Click "Reopen in container"
28
+
29
+ You're now ready to test the dev environment:
30
+
31
+ 4. Click on Terminal->New Terminal to be dropped into a terminal inside the dev environment.
32
+ 5. Run `$ npm install` to install the required modules
33
+ 6. Run `$ npm test` to ensure all tests pass
34
+ 7. Run `$ npm rebuild` to re-compile the project from scratch (using the version of EMSDK installed in the container).
35
+ 8. Run `$ npm test` to ensure all tests pass after said rebuild
36
+
37
+ You're now ready for development!
38
+
39
+ ### Host-based configuration (Not recommended)
40
+
41
+ If you're on a Mac or Linux-based host machine, you can install and use the EMSDK directly to perform a build.
42
+ Note that if you run into bugs with this configuration, we highly encourage you to use the containerized development environment instead, as detailed above.
43
+
44
+ Instructions:
45
+
46
+ 1. [Install the EMSDK](https://emscripten.org/docs/getting_started/downloads.html)
47
+ 2. Clone this repository
48
+ 3. Run `$ npm install` to install the required modules
49
+ 4. Run `$ npm test` to ensure all tests pass
50
+ 5. Run `$ npm rebuild` to re-compile the project from scratch (using the version of EMSDK installed in the container).
51
+ 6. Run `$ npm test` to ensure all tests pass after said rebuild
52
+
53
+ ## Compiling SQLite with different options
54
+
55
+ In order to enable extensions like FTS5, change the CFLAGS in the [Makefile](Makefile) and run `npm run rebuild`:
56
+
57
+ ``` diff
58
+ CFLAGS = \
59
+ -O2 \
60
+ -DSQLITE_OMIT_LOAD_EXTENSION \
61
+ -DSQLITE_DISABLE_LFS \
62
+ -DSQLITE_ENABLE_FTS3 \
63
+ -DSQLITE_ENABLE_FTS3_PARENTHESIS \
64
+ + -DSQLITE_ENABLE_FTS5 \
65
+ -DSQLITE_THREADSAFE=0
66
+ ```
package/LICENSE ADDED
@@ -0,0 +1,44 @@
1
+ MIT license
2
+ ===========
3
+
4
+ Copyright (c) 2017 sql.js authors (see AUTHORS)
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
23
+
24
+
25
+
26
+ # Some portions of the Makefile taken from:
27
+ Copyright 2017 Ryusei Yamaguchi
28
+
29
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
30
+ this software and associated documentation files (the "Software"), to deal in
31
+ the Software without restriction, including without limitation the rights to
32
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
33
+ the Software, and to permit persons to whom the Software is furnished to do so,
34
+ subject to the following conditions:
35
+
36
+ The above copyright notice and this permission notice shall be included in all
37
+ copies or substantial portions of the Software.
38
+
39
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
40
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
41
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
42
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
43
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
44
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.