yahoo / squidb

SquiDB is a SQLite database library for Android and iOS
https://github.com/yahoo/squidb/wiki
Apache License 2.0
1.31k stars 132 forks source link

How to create the db? #98

Closed inawlaljar closed 8 years ago

inawlaljar commented 8 years ago

I have upgraded to Squidb 2.0. Now when I try to create the db object (class that extends SquidDatabase), it doesn't create the database.

Do I need to call any method? My understanding was that on Object create, it creates a db.

Please suggest.

Thanks,

jdkoren commented 8 years ago

On Android, the actual database file is created the first time you try to actually open it (e.g. when you call getReadableDatabase() or getWriteableDatabase() on a SQLiteOpenHelper object). The same is true for SquiDB because it uses Android's SQLiteOpenHelper underneath. This should happen the first time you run any database operation, like a query.

If you want, you can open it explicitly by calling squidDatabase.getDatabase(), but usually this isn't necessary.

sbosley commented 8 years ago

Seems like this was resolved -- closing.