Comments (3)
If the pre-loaded is an sqlite database and assuming the sqlite format is the same for all android/iOS version you install your app on it (SQLite db files should be OS independant), you could check if the database file exists on the file system and if not copy a file from your assets to the database path and then open it.
Alternatively you could execute a list of sql statement from a text file (be careful on text encoding here though). Otherwise the safest is to use the onCreate callback and execute statements
from sqflite.
Ok
from sqflite.
FYI the example now includes opening an asset database (copying it to the file system first). Check documentation here:
https://github.com/tekartik/sqflite/blob/master/doc/opening_asset_db.md
from sqflite.
Related Issues (20)
- v2.3.2 iOS does not work HOT 8
- java.lang.NoClassDefFoundError: Failed resolution of: Lcom/tekartik/sqflite/Database after build my apk it crashes
- Is it possible to create subqueries in SQFLite ?
- [WEB] Is there any possibility to browse the data? HOT 3
- sqflite iOS can't save out of application directory HOT 1
- error HOT 2
- Intermittent Data Incompleteness Issue When Copying SQLite Database File for Backup HOT 1
- Adding Offline Syncing to Online Database HOT 2
- Cursors HOT 1
- Support for .sql files HOT 2
- COLLATE NOCASE is not supporting in web build
- [sqflite_common_ffi_web 0.4.3] - db is not accessible in Android Chrome HOT 7
- Update PRAGMA version in windows
- openDatabase never returns a database in tests. HOT 1
- SQLite Upgrade? HOT 2
- ConflictAlgorithm.replace deletes the row with FOREIGN KEY ON DELETE CASCADE ON UPDATE NO ACTION
- power function not supported HOT 1
- Inserting a row after clearing a table is not working HOT 2
- Can you tell me the general area on how to create a stream/watch a table? HOT 3
- Possibility to create functions? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sqflite.