NitroSQLite
react-native-nitro-sqliteFunctions

open

TypeScript

Source files: TypeScript

open(options): NitroSQLiteConnection

Open a database and return a managed connection. The default connection is addressed by its name, and opening it twice throws. Set connection to 'independent' to open another native handle to the same file. Async calls on each connection run in call order. An optional encryptionKey requires a native build with SQLite SEE; it does not encrypt an existing plaintext file.

Parameters

options

NitroSQLiteConnectionOptions

Database name, optional directory, connection mode, read-only setting, and SEE key.

Returns

NitroSQLiteConnection

A connection bound to the opened native handle.

Throws

NitroSQLiteError with type EncryptionNotEnabled when a key is supplied without SEE, or DatabaseCannotBeDecrypted for an invalid key, wrong key, or existing plaintext database.

See

Encryption guide

On this page