Skip to content

Create Database

Andrey Gershun edited this page Apr 14, 2015 · 6 revisions

Alasql Databases

To create Alasql 'native' database:

    alasql('CREATE DATABASE mybase');

External Databases

To create external (localStorage on IndexedDB) database:

    alasql('CREATE LOCALSTORAGE DATABASE lsbase');

When you create external database, you need to attach database before usage:

    alasql('CREATE INDEXEDDB DATABASE ixbase');
    alasql('ATTACH INDEXEDDB DATABASE ixbase AS myixdb');

JavaScript Functions for Opening Databases

To create new database:

	alasql('CREATE DATABASE [My Database]');

	// or

	new mydb = new alasql.Database();

	// or

	new mydb = new alasql.Database('My Database');

You can find database:

	var mydb = alasql.Database('My Database');

	// or

	var mydb = alasql.databases['My Database'];
Clone this wiki locally