Methods
initSqlJs(config) → {SqlJs}
Asynchronously initializes sql.js
Parameters:
Name | Type | Description |
---|---|---|
config | SqlJsConfig | 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:
Properties- Object
Name | Type | Description |
---|---|---|
Database | Database | A class that represents an SQLite database |
Statement | Statement | The prepared statement class |
SqlJsConfig
Type:
Properties- Object
Name | Type | Description |
---|---|---|
locateFile | function | a function that returns the full path to a resource given its file name |