Database is the main interface in creating and manage a database for an application.
A database can be created using the new operator:
const idb = new InlineDB(idbName);| Param | Required | Type | Default | Description |
|---|---|---|---|---|
| idbName | Yes | String | None | Name of the database to create |
- When
idbNameis not provided. - When
idbNameis not a string. - When
idbNamedoes not match[a-zA-Z0-9]+([-_][a-zA-Z0-9]+)*pattern.- see naming conventions for examples.
An instance of Database.
Creates an instance of Table.
idb.createTable(tableName);| Param | Required | Type | Default | Description |
|---|---|---|---|---|
| tableName | Yes | String | None | Name of the table to create |
- When
tableNameis not provided. - When
tableNameis not a string. - When
tableNamedoes not match[a-zA-Z0-9]+([-_][a-zA-Z0-9]+)*pattern.- see naming conventions for examples.
An instance of Table.
Lists table that are created so far in the database.
idb.listTables();An array of table names (Array<String>).
Deletes a table permanently.
idb.dropTable(tableName);| Param | Required | Type | Default | Description |
|---|---|---|---|---|
| tableName | Yes | String | None | Name of the table to drop |
Current instance of Database.
Deletes the database permanently.
idb.drop();Nothing (undefined).