Helpers for the Botpress Database running on Knex
- Source:
Example
import { DatabaseHelpers } from 'botpress'
// or
const { DatabaseHelpers } from 'botpress'
const helpers = DatabaseHelpers(await bp.db.get())
Methods
(inner) createTableIfNotExists(tableName, Callback)
This is a workaround utility function knex's createTableIfNotExists doesn't work with postgres https://github.com/tgriesser/knex/issues/1303
- Source:
Parameters:
Name | Type | Description |
---|---|---|
tableName |
String
|
Name of the table to create |
Callback |
function
|
function. Identical to Knex's callback. |
(inner) isLite() → {Boolean}
Returns whether or not the current database is SQLite
- Source:
Returns:
- Type:
-
Boolean
Returns true if the database is SQLite, false if Postgres