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

Methods

Detailed Description

Example:


  QmlSqlCreateDatabase{
          id: mainCreateDatabase
          fileName: "SomeFileName"
          databaseName: "ANewDatabase"
          filePath:  "/Some/Path/To/Save/To"
          useMd5: false
          onCreated:{
              //do something
          }
   }

Property Documentation

databaseName : string

Sets the name of the sqlight database to databaseName.

Note This is not the name of the file in which sqlight is saved to see fileName. This is the database's name that is created.

See also fileName and useMd5.


errorString : string

Returns a text error if there is a error in the creation of the database via exec().


fileName : string

Sets the file name of the sqlight database to fileName which will be saved on the users system.

Note: One must set the filePath first before this. fileName is just the name and not the full path that will be saved to the users harddrive.

See also useMd5 and filePath.


filePath : string

Sets the path to where one would like to create the sqlight database


lastCreatedDatabaseFile : string

Returns a string of the fullPath and name (string or md5) of last sqlight database that was created.

See also useMd5.


useMd5 : bool

Sets this to true if you would like the fileName of the sqlight database to be a randomly generated md5Sum.

Note: One can not use both fileName and use this feature.

See also fileName and filePath.


Method Documentation

void exec()

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

See also useMd5 and fileName.