Skip to content

Is it possible to create a driver for Expo's SQLite API? #2183

@cuibonobo

Description

@cuibonobo

Issue type:

[x] question
[ ] bug report
[x] feature request
[ ] documentation issue

Database system/driver:

[ ] cordova
[ ] mongodb
[ ] mssql
[ ] mysql / mariadb
[ ] oracle
[ ] postgres
[ ] sqlite
[ ] sqljs
[ ] react-native

TypeORM version:

[x] latest
[ ] @next
[ ] 0.x.x (or put your version here)

Steps to reproduce or a small repository showing the problem:

Expo has a SQLite API, but it is extremely rudimentary. I wanted to get some opinions on whether it's even possible to create a TypeORM driver for it.

  • The openDatabase method accepts a name parameter and Expo's internal API will figure out the database location depending on the platform. This returns a Database object.
  • The Database object has a single transaction method with 3 arguments: a callback function that accepts a Transaction object as its only argument, and error function, and a success function.
  • The Transaction object has a single method with the following signature: executeSql(sqlStatement, arguments, success_callback, error_callback)

Comparing what's available in Expo's SQLite API to how TypeORM's Driver works, there doesn't seem to be a good way to do connection management, i.e. I can't 'open' or 'close' a connection to the database. Would it still be possible to create a driver for this or is it a lost cause?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions