Access to sqlite db from application bundle

Is possible open a sqlite db located into application bundle or copy a file from application bundle to FileSystem.documentDirectory? SQLite.openDatabase seem work only from FileSystem.documentDirectory
Thanks

I’ve found this solution…
FileSystem.downloadAsync(
Asset.fromModule(require(’…/…/assets/Database/data.mp4’)).uri,
${FileSystem.documentDirectory}SQLite/data.db
)
With mp4 extension i can access and copy file, if i use other extension like db o sqlite it give me this error:
Unable to resolve “…/…/assets/Database/data.db” from “app/screens/LoginScreen.js”
undefined Unable to resolve module ../../assets/Database/data.db from app/screens/LoginScreen.js:
None of these files exist: …
How can add extension to Assets? Or how can access to db file info Application Bundler without copy it into documentDirectory folder?

Thanks

How can add .sqlite or .db extension to Assets extension?


This solve my problem.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.