QmlSqlCreateDatabase QML Type
Creates a local database for sqlight only. One must set the databaseName and also the filePath in which they would like to save the database file. One can use a md5Sum that is randomly generated to create the databaseName. Or if you like you can also name the database fileName via databaseName. The method of exec
is what is used to create the database. More...
Import Statement: | import QmlSql 1.0 |
Properties
- databaseName : string
- errorString : string
- fileName : string
- filePath : string
- lastCreatedDatabaseFile : string
- useMd5 : bool
Methods
- void exec()
Detailed Description
Example:
QmlSqlCreateDatabase{ id: mainCreateDatabase fileName: "SomeFileName" databaseName: "ANewDatabase" filePath: "/Some/Path/To/Save/To" useMd5: false onCreated:{ //do something } }
Property Documentation
Returns a text error if there is a error in the creation of the database via exec().
Returns a string of the fullPath and name (string or md5) of last sqlight database that was created.
See also useMd5.
Method Documentation
A method that is run to create the database. Returns a errorString
if it can not complete the method. If one is using a md5 it creates the fileName based on the random md5 that is generated in this method. Else it uses the fileName that you have set.
Note If you do not set the fileName and also do not set the md5Sum to true
. This will return a errorString