Methods

initSqlJs(config) → {SqlJs}

Asynchronously initializes sql.js

Parameters:
NameTypeDescription
configSqlJsConfig

module inititialization parameters

Returns:
Type: 
SqlJs
Example
initSqlJs({
 locateFile: name => '/path/to/assets/' + name
}).then(SQL => {
 const db = new SQL.Database();
 const result = db.exec("select 'hello world'");
 console.log(result);
})

Type Definitions

SqlJs

Type:
  • Object
Properties
NameTypeDescription
DatabaseDatabase

A class that represents an SQLite database

StatementStatement

The prepared statement class

SqlJsConfig

Type:
  • Object
Properties
NameTypeDescription
locateFilefunction

a function that returns the full path to a resource given its file name