Switch to: V10V9V8V7V6V5

Properties of VSqliteDatabase Class

VSqliteDatabase.Connection

Declaration:

Connection as VConnection [r/o]

Description:

In the Xojo Database API they have decided to join Connection + Database into a single class. This property gives you access to internal VConnection object, which is created inside of VSqliteDatabase object when you call connect() method.

You may need VConnection, to be able to construct VNotificationCenter class, which requires a VConnection as a constructor parameter.

Example:

mSqliteDb = new VSQLiteDatabase
mSqliteDb.Host = ValeUnitTests.mVServerHost
mSqliteDb.UserName = ValeUnitTests.mVServerUserName
mSqliteDb.Password = ValeUnitTests.mVServerPassword 
mSqliteDb.DatabaseName = "test_sqlite.db"
 
mSqliteDb.UseNotifications()
res = mSqliteDb.Connect()  // open connection
 
dim pConnection as VConnection = mSqliteDb.Connection
 
dim nc as new VNotificationCenter( pConnection )
// Now you can subscribe to channels, send and listen to notifications.

VSqliteDatabase.ConnectionTimeout

Declaration:

ConnectionTimeout as Integer

Description:

Specifies connection timeout in a second. If connection cannot be established in this time, then connect() will stop.

Example:

db.ConnectionTimeout = 20
or
ct = db.ConnectionTimeout

VSqliteDatabase.EnabledSharedCache

Declaration:

EnabledSharedCache as Boolean

Description:

For local SQLite database enables shared cache mode. Should be assigned before database opening.

No sense to use with Valentina Server, because vserver always enables this mode for the served databases.

Example:

db.DatabaseFile = GetFolder( "db_name.db" )
db.EnableSharedCache = true
db.connect()

VSqliteDatabase.IsConnected

Declaration:

IsConnected as Boolean [r/o]

Description:

Returns TRUE if database is connected to Valentina Sqlite Server.

It has no sense for LOCAL database and always returns false.

Example:

res = db.IsConnected()

VSqliteDatabase.IsOpen

Declaration:

IsOpen as Boolean [r/o]

Description:

Returns TRUE if database is opened.

Example:

res = db.IsOpen()

VSqliteDatabase.Port

Declaration:

Port as Integer

Description:

The port to establish non-secure connection to a Valentina Sqlite Server. The default is 15532.

If you are using default port of a Valentina Server, then you can skip an assignment of this property before connect(). It is required only if you have changed in the VServer.ini file ports of your Valentina Server.

Example:

db.host = "127.0.0.1"
db.Port = 15532 // optional if port is default
 
db.connect()

VSqliteDatabase.PortSSL

Declaration:

PortSSL as Integer

Description:

The port to establish SSL connection to a Valentina Sqlite Server. The default is 15534.

If you are using default port of a Valentina Server, then you can skip an assignment of this property before connect(). It is required only if you have changed in the VServer.ini file ports of your Valentina Server.

Example:

db.host = "127.0.0.1"
db.PortSSL = 15534  // optional if port is default
 
db.UseSSL()
db.connect()

VSqliteDatabase.EmbeddedSerial

Declaration:

EmbeddedSerial as String

Description:

The embedded key to establish connection to Embedded Valentina Sqlite Server.