You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For the impatients, try the demo here: http://kripken.github.io/sql.js/examples/GUI
5
5
6
-
*sql.js* is a port of [SQLite](http://sqlite.org/about.html) to Webassembly, by compiling the SQLite C code with [Emscripten](http://kripken.github.io/emscripten-site/docs/introducing_emscripten/about_emscripten.html). It uses a [virtual database file stored in memory](https://kripken.github.io/emscripten-site/docs/porting/files/file_systems_overview.html), and thus **doesn't persist the changes** made to the database. However, it allows you to **import** any existing sqlite file, and to **export** the created database as a [javascript typed array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Typed_arrays).
6
+
*sql.js* is a port of [SQLite](http://sqlite.org/about.html) to Webassembly, by compiling the SQLite C code with [Emscripten](http://kripken.github.io/emscripten-site/docs/introducing_emscripten/about_emscripten.html). It uses a [virtual database file stored in memory](https://kripken.github.io/emscripten-site/docs/porting/files/file_systems_overview.html), and thus **doesn't persist the changes** made to the database. However, it allows you to **import** any existing sqlite file, and to **export** the created database as a [JavaScript typed array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Typed_arrays).
7
7
8
-
There are no C bindings or node-gyp compilation here, sql.js is a simple javascript file, that can be used like any traditional javascript library. If you are building a native application in javascript (using Electron for instance), or are working in node.js, you will likely prefer to use [a native binding of SQLite to javascript](https://www.npmjs.com/package/sqlite3).
8
+
There are no C bindings or node-gyp compilation here, sql.js is a simple JavaScript file, that can be used like any traditional JavaScript library. If you are building a native application in JavaScript (using Electron for instance), or are working in node.js, you will likely prefer to use [a native binding of SQLite to JavaScript](https://www.npmjs.com/package/sqlite3).
9
9
10
10
SQLite is public domain, sql.js is MIT licensed.
11
11
@@ -24,9 +24,9 @@ A [full documentation](http://kripken.github.io/sql.js/documentation/#http://kri
24
24
```javascript
25
25
var initSqlJs =require('sql.js');
26
26
// or if you are in a browser:
27
-
//var initSqlJs = window.initSqlJs;
27
+
//var initSqlJs = window.initSqlJs;
28
28
29
-
initSqlJs().then(function(SQL){
29
+
initSqlJs().then(SQL=>{
30
30
31
31
// Create a database
32
32
var db =newSQL.Database();
@@ -57,7 +57,7 @@ initSqlJs().then(function(SQL){
57
57
stmt.bind([0, 'hello']);
58
58
while (stmt.step()) console.log(stmt.get()); // Will print [0, 'hello']
59
59
60
-
// You can also use javascript functions inside your SQL code
60
+
// You can also use JavaScript functions inside your SQL code
61
61
// Create the js function you need
62
62
functionadd(a, b) {return a+b;}
63
63
// Specifies the SQL function's name, the number of it's arguments, and the js function to use
@@ -89,7 +89,7 @@ The test files provide up to date example of the use of the api.
89
89
<scriptsrc='/dist/sql-wasm.js'></script>
90
90
<script>
91
91
config = {
92
-
locateFile:url=>`/dist/${filename}`
92
+
locateFile:filename=>`/dist/${filename}`
93
93
}
94
94
// The `initSqlJs` function is globally provided by all of the main dist files if loaded in the browser.
95
95
// We must specify this locateFile function if we are loading a wasm file from anywhere other than the current html page's folder.
@@ -220,7 +220,7 @@ See [examples/GUI/gui.js](examples/GUI/gui.js) for a full working example.
220
220
221
221
## Flavors/versions Targets/Downloads
222
222
223
-
This library includes both WebAssembly and asm.js versions of Sqlite. (WebAssembly is the newer, preferred way to compile to Javascript, and has superceded asm.js. It produces smaller, faster code.) Asm.js versions are included for compatibility.
223
+
This library includes both WebAssembly and asm.js versions of Sqlite. (WebAssembly is the newer, preferred way to compile to JavaScript, and has superceded asm.js. It produces smaller, faster code.) Asm.js versions are included for compatibility.
0 commit comments