I've searched but have been unable to find a way to parse an *.sql file into an SQLite database. It doesn't look like DBUtils has that functionality. Did I miss anything? Am I going to have to load and parse this myself?
Sample SQL file to create tables
Sample SQL file to add records
(Technically, those could be put together into one file.)
I did find this comment that offered this code:
It would be nice to have something like
which I will try tomorrow. It's late here and past my bedtime!
Sample SQL file to create tables
Sample SQL file to add records
(Technically, those could be put together into one file.)
I did find this comment that offered this code:
B4X:
Dim txtSql As String
txtSql = File.ReadString(File.DirAssets, "mybook.sql")
SQL1.ExecNonQuery(txtSql)
It would be nice to have something like
B4X:
SQL1.ParseSQL(File.DirAssets,"mydb.sql",File.DirAssets,"mydb.db")
'or
SQL1.CreateFromSQL(File.DirAssets,"mydb.sql",File.DirAssets,"mydb.db")
which I will try tomorrow. It's late here and past my bedtime!