Skip to content

Instantly share code, notes, and snippets.

GendelfLugansk /
Last active February 24, 2024 19:45
Wrapper for expo-sqlite with async/await, migrations and transactions

Expo-sqlite - the right way


With expo-sqlite it's not possible to execute few depending statements inside single transaction - db.transaction does not work with async/promise and tx.executeSql just enqueues sql statement but does not execute it.


Database class has two methods - execute (to execute single statement without transaction) and transaction(cb) to execute few statements inside a transaction