SQLite Multiple Attached rather than single large database - sqlite

I'm going to end-up with a rather large database CubeSQLite in the cloud and cloned on the local machine. In my current databases I already have 185 tables and growing. I store them in 6 SQLite databases and begin by attaching them together Using the ATTACH DATABASE command. There are views that point to information in other databases and, as a result, Navicat won't open the SQLite tables individually. It finds them to be corrupted, although they are not and are working fine.
My actual question is this:
Considering the potential size of the files, is it better/faster/slower to do it this way or to put them all into one really large SQLite DB?

Related

Working with a large db (sqlite / mariadb) in PowerBi

I have a SQlite db-file of 30 GB. This is to large to import into PowerBi Desktop (I don't have a premium-licence), so I want to use DirectQuery.
This doensn't work with SQLite (see link below).
[https://learn.microsoft.com/nl-nl/power-bi/connect-data/power-bi-data-sources][1]
I think it might be possible to use MariaDB (= opensource). I never used this database and it isn't clear to me if the database needs to be installed or that it uses a single database file like sqlite (file.db) that can easily be moved around.
Any advice? On PowerBi or the database?

Sqlite corruption on one database but not on another

I am using sqlite database in an embedded system application. I have two sqlite databases. One database(DB1) has no issues however the other one(DB2) works fine only for a while.
The issue with DB2 is that query on the database starts failing with SQLITE_CORRUPT error. However, the write operation still keeps going on fine forever. So, the issue is that after a while or after it starts growing in size, I can not query the database anymore.
On the other hand, DB1 has no such issues. The difference between DB1 and DB2 is that the table in DB1 is created just for the float entries and the table in DB2 contains 3-4 text entries along with int entries.
I am not able to find the reason as why text entries causes the sqlite database to get corrupted.
sqlite version 3.4.5

Corona SDK - SQLLite Local Database and Updating

I was just looking for some guidance with my app design. I'm going to have a local sqllite database pre populated with about 1000 records.
These records will need to be read frequently within the app to update the UI.
The records will need to be updated from within the app.
Is a local mysql database the best way to do this or should I be storing all this info in a massive lua table? The database has 2 tables one with 2 columns and one with 10 columns.
I don't want the data to be accessible from outside the app as some of the data is going to be paid for content.
How would I go about releasing updates in the future? If I upgrade my app to version 2 and add new records to the database... how would I go about keeping the users existing data in the database and just adding the updated stuff?
Hope someone can point me in the right direction!
Many Thanks,
Krivvenz.
I think this is fairly simple question. If you need to use data after closing and opening the app you will need sqlite. If the data is created and lost after the app usage, then a table will do. However, the sqlite has also the advantage of querying, deleting and so many other functions without loops etc that you may need to do in tables manually.
You can also append further data during app update. The Sqlite file you create is saved to document directory. That is not deleted if you only update. Simply write a code in your update that reads the existing database and appends the new data. Or create a new file for sqlite and use the old one as backup.

SQLite no release memory after delete

Excuse for English
I using SQLite and test it. Insert multi-million row for testing speed. and deletes rows after any insert.
But i know my database size is 33.0 MB..... now database is empty. but size on disk is 33 MB.
WHY?
can you help me?
The VACUUM command rebuilds the entire database. There are several
reasons an application might do this:
Unless SQLite is running in "auto_vacuum=FULL" mode, when a large amount of data is deleted from the database file it leaves behind
empty space, or "free" database pages. This means the database file
might be larger than strictly necessary. Running VACUUM to rebuild the
database reclaims this space and reduces the size of the database
file.
https://www.sqlite.org/lang_vacuum.html

sqlite3 virtual tables lifetime

Can someone please tell me the lifetime of the virtual tables created in sqlite3. I have an android application with a search feature, and i want to use the fast text search feature of sqlite.
I do not know how long these tables stay in the system or if i need to create the tables each time i access the application.
Any help?
The SQLite FTS module creates several 'internal' tables for every virtual table you define. Those tables are plainly visible in the database schema, so FTS virtual tables as well as their underlying data are completely contained in the database file.
This might be different with other types of virtual table; e.g. the VirtualShape extension allows ESRI shapefiles (.shp) files to be read as tables; those are (naturally) stored separately from the SQLite database file.
In any case, the definition of any virtual table itself is stored in the database file, just like a normal table; so the answer to your question is:
No, there's no need to re-create them every time you open the database.
According the SQLite3 file format specification, the virtual table definitions are stored in the schema table like any other table. Any indices for a virtual table are also stored in the DB file.
I take all this to mean that a virtual table is stored in the DB file and thus persistent. You should not have to recreate it each time you open a DB connection - it wouldn't make much sense like that, anyway.
A simple test using the sqlite3 CLI tool and an FTS3 table confirms this :-)

Resources