-
Notifications
You must be signed in to change notification settings - Fork 4
DBConnection
Rollback a SQLite transaction that is in process.
Clears the SQL log.
Connects to the supplied database file. Returns True if the connection was successful, False if it was not.
Storm supports two modes: single database and multiple database
In single database mode, your application uses only a single database. This would be something like iTunes or iPhoto.
In multiple database mode, your application uses a database a document so it may be connected to multiple databases at one time.
This is controlled by the SingleDatabase property.
When SingleDatabase is True, the database will always be created/opened in SpecialFolder.ApplicationData inside a folder with the name of your application. So the StormDemo app will create its database file here:
Mac OS X: ~/Library/Application Support/StormDemo/Baseball.sqlite
Starting with Lion, ~/Library is now a hidden folder so you will have to get to it using the Finder Go To Folder command.
Windows: C:\Users\UserName\AppData\Roaming\StormDemo\Baseball.sqlite
On Windows, AppData is a hidden folder, so you will need to turn on hidden file display in Windows Explorer settings.
If SingleDatabase is False, the database will be created/opened at the location specified by the FolderItem.
Encryption If you would like to encrypt your database when it is created or you would like to connect to a previously encrypted database, supply the password when calling Connect.
Use this method when SingleDatabase is True to open the database specified in SpecialFolder.ApplicationData (~/Library/Application Support on Mac OS X) by name. Returns True if the connection was successful, False if it was not
Supply the password if your database is encrypted.
Commits a SQLite transaction that is in process.
Used to create a PreparedSQLStatement for more secure SQL processing.
Allows you to save the SQL log to a text file. Saving the log does not clear it.
When the log has been enabled, all SQL commands are captured.
Sends the supplied sql command directly to the database to be processed. Returns True is the command completed without an error, False if there was an error.
Sends the supplied sql query directly to the database and returns a RecordSet.
Begins a SQLite transaction. Returns True if the transaction was started, False if there was a problem.
Performs a SQLite VACUUM DATABASE commend which shrinks the size of the database file by permanently removing any deleted rows from the database.
Gives you direct access to the REALSQLDatabase object. It is best not to use the equivalent methods on DBConnection so that you get logging.
Set this to True to have all SQL statements saved to the internal log. Also see ClearLog and SaveLog.
True when a transaction is in process, False otherwise.
True when DBConnection is actually connected to a database, False otherwise.
Returns Database.ErrorCode
Returns Database.ErrorMessage
Returns Database.LastRowID
Set this to True to use only a single database file for your application. Also see Connection for information on how this works.
Assign your own DBUpdater subclass to handle database creation and updates.
Useful for when SingleDatabase is True. Rather than maintaining your own DBConnection property on the App class (or elsewhere) and supplying it to various methods, you can simply use this Shared Property instead and it will be used when a specific connection is not supplied.