I have a new release of my app soon, which used to work with REALSQLDatabase.
Do you advise that I should change my code to replace REALSQLDatabase by SQLiteDatabase?
I will have to migrate from .rsd to .sqlite database for all my clients. Is it worth changing the code and writing an app for the migration?
If anybody knows an answer, it would make me glad to hear.
You should upgrade so that you get SQLite updates. With RealSQLDatabase being deprecated, it will not get any updates.
SQLiteDatabase has a couple important differences:
- If you use RecordSet.Edit, the SQL query must include the primary key
- SQL commands automatically commit unless you start a transaction
I don’t see a need for a migration app. You can leave the extension as rsd.
The only time you may not want to migrate to SQLiteDatabase is if you did not include a primary key in your tables and are relying upon the internal rowid with REALSQLDatabase.
@Paul: Thanks. So I can leave my RSD databases as-is, and connect henceforth with SQLiteDatabase? Is that right?
I don’t want any Autocommit. Is the autocommit True or False by default? Anyway, I can check the documents for this question.
@Bob: Thank you for your advise. I have a database that contains 22 tables, and I’m happy that I included PK’s for each table
The AutoCommit property not available for SQLiteDatabase (it behaves as if it were True). To prevent AutoCommit, you send a BEGIN TRANSACTION command before any SQL that will modify the DB.
I just wanted to ask if I have to add db.SQLExecute(“BEGIN TRANSACTION”) everywhere in my project; will be much time consuming. But you have already answered it.