typeORMDriver
TypeScriptSource files: TypeScript
const typeORMDriver: object
Adapter for TypeORM's react-native driver on React Native and NitroUI.
openDatabase reports success or failure through callbacks and returns the
connection on success, or null when opening fails. This implementation does
not import TypeORM; applications install TypeORM explicitly.
Type Declaration
openDatabase
openDatabase: (options, ok, fail) => TypeOrmConnection | null
Open a database for TypeORM.
Parameters
options
Database name, optional relative directory, and optional SEE key.
encryptionKey?
string
Key for a licensed SQLite SEE build. Without SEE, a supplied key fails
with EncryptionNotEnabled. An existing plaintext file is rejected.
location?
string
Directory relative to the platform database directory.
name
string
Database file name.
ok
(db) => void
Receives the adapter connection on success.
fail
(msg) => void
Receives the caught opening error on failure. The legacy string signature does not convert Error objects to strings.
Returns
TypeOrmConnection | null
The callback connection after ok runs, or null after fail runs.
A supplied encryption key requires a licensed SEE build; without SEE the
failure callback receives EncryptionNotEnabled.
Deprecated
Import from react-native-nitro-sqlite-typeorm on React Native or
nitro-sqlite-typeorm on NitroUI instead.