iOSSQLiteDatabase

From Xojo Documentation

Revision as of 20:35, 16 December 2020 by PLefebvre (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!

Class (inherits from Object)

Provides access to SQLite databases in iOS projects.

Properties
DatabaseFile LibraryVersion fa-lock-32.png Timeout
EncryptionKey ThreadYieldInterval
Methods
AttachDatabase Decrypt LastRowID
Connect DetachDatabase SQLExecute
CreateDatabaseFile Encrypt SQLSelect

Notes

Version used:

Xojo Version SQLite Version
2019r3 3.29.0
2019r2 3.28.0
2019r1 3.26.0
2018r4 3.25.3
2018r3 3.24.0
2018r2 3.23.1
2018r1 3.22.0
2017r3 3.20.1

For more information about SQLite:

If your database object goes out of scope, the database is closed. This means you are typically going to want your database object be somewhat global to your app. A common technique is to have an iOSSQLiteDatabase property on the App object that you refer throughout your app as App.DB.

Transactions

iOSSQLiteDatabase does an auto-commit after each SQL command if you do not manually start a transaction. You can start a transaction using this command:

myDB.SQLExecute("BEGIN TRANSACTION")

When the transaction is complete, you commit your changes with this command:

myDB.SQLExecute("COMMIT")

You can cancel a transaction by calling rollback with this command:

myDB.SQLExecute("ROLLBACK")

See Also

iOSSQLiteDatabaseField, iOSSQLiteException, iOSSQLiteRecordSet classes