AlaSQL.js - JavaScript SQL database for browser and Node.js. Handles both traditional relational tables and nested JSON data (NoSQL). Export, store, and import data from localStorage, IndexedDB, or Excel.
var mybase = new alasql.Database();
mybase.exec('CREATE TABLE one (two INT)');
However, when using TypeScript, this causes a type error such as:
src/lib/utils.ts:239:25 - error TS2551: Property 'Database' does not exist on type 'AlaSQL'. Did you mean 'databases'?
239 const db = new alasql.Database();
~~~~~~~~
The cause is that [types/alasql.d.ts] has no Database in its type definitions. This PR adds that type definition.
This fixes issue #1180 and adds the property Database to the types/alasql.d.ts file.
The Getting Started section has this code:
However, when using TypeScript, this causes a type error such as:
The cause is that [types/alasql.d.ts] has no
Database
in its type definitions. This PR adds that type definition.