Feb 28, 2023 Replies: 1 This is a prototype I wrote a while back that takes a source SQLite database and clones it to another SQLite database - in this case an in memory SQLite database. The code is prety straight forward, initialize the source (from) and destination (to) SQLite databases and call the CopySQLiteDB sub. NOTE this can be used to clone to a regular SQLite DB as well. B4X: Copy Dim src_db As SQL Dim dest_db As SQL src_db.InitializeSQLite(File.DirApp,"report.sqlite",False) dest_db.InitializeSQLite("", ":memory:",True) DBUtils.CopySQLiteDB(src_db,dest_db) You can then use the dest_db SQL object as per normal. Attachments SQLite_ToMemory.zip SQLite_ToMemory.zip 2.2 KB · Views: 494 Last edited: Mar 29, 2023 Click to expand...
This is a prototype I wrote a while back that takes a source SQLite database and clones it to another SQLite database - in this case an in memory SQLite database. The code is prety straight forward, initialize the source (from) and destination (to) SQLite databases and call the CopySQLiteDB sub. NOTE this can be used to clone to a regular SQLite DB as well. B4X: Copy Dim src_db As SQL Dim dest_db As SQL src_db.InitializeSQLite(File.DirApp,"report.sqlite",False) dest_db.InitializeSQLite("", ":memory:",True) DBUtils.CopySQLiteDB(src_db,dest_db) You can then use the dest_db SQL object as per normal.
Claudio Oliveira Active Member Licensed User Longtime User Apr 13, 2023 #2 Quite useful code indeed. Thanks! Maybe Erel might add it to the DBUtils library.