NitroSQLite
react-native-nitro-sqlitereact-native-nitro-sqlite/mockFunctions

open

TypeScript

Source files: TypeScript

open(options): MockConnection

Open a SQLite database in a temporary directory for Node tests. Connections with the same name and location share a file. Opening a second default connection with the same name throws; independent connections have separate handles and queues. Read-only opens require an existing database. Closing preserves data until deletion or resetAllDatabases.

Parameters

options

NitroSQLiteConnectionOptions

Name, relative location, connection mode, and read-only setting.

Returns

MockConnection

A connection supporting queries, batches, prepared statements, and transactions.

Throws

If the name or location escapes the temporary directory, the database cannot be opened, or a default connection already uses the name.

See

MockConnection

On this page