Platforms to show: All Mac Windows Linux Cross-Platform

The module InternalSQLiteLibraryMBS

module InternalSQLiteLibraryMBS
Type Topic Plugin Version macOS Windows Linux iOS Targets
module SQL MBS SQL Plugin 15.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The module for our internal SQLite3 engine.
Example
// enable our built-in SQLite library, which supports encryption
Call InternalSQLiteLibraryMBS.Use

// where to store?
Var f As FolderItem = SpecialFolder.Desktop.Child("test.db")
Var storage_database As New SQLDatabaseMBS ' SQLiteDatabase
storage_database.SQLiteEncryptionKey = "aes256:password" ' <-- password with AES256 as prefix to pick algorithm
storage_database.DatabaseName = "sqlite:"+ f.NativePath

If storage_database.Connect Then

// create table if this is not yet here
storage_database.SQLExecute "Create table if not exists pics(pic_id integer PRIMARY KEY AUTOINCREMENT, name varchar(20), pic blob)"

// done
MsgBox "Ready"
Else
MsgBox storage_database.ErrorMessage
End If

This is a SQLite3 library built into a plugin, so you can decide with use of MBS SQL Plugin to use this plugin instead of providing your own external copy of SQLite shared library.

Our internal SQLite library includes the following extensions:

  • JSON1, the extension to provide JSON functions
  • FTS5, the full text search extension in version 5
  • R*Tree index extension
  • SOUNDEX function
  • SQL math functions
  • Geopoly extension
  • ICU extension for unicode handling
  • The RBU Extension

You can turn on these SQLite extensions at runtime with MBS Plugin:

  • UUID extension
  • Base64 extension
  • CSV extension

More extensions could be added on request.

  • method CompileOption(index as Integer) as String
  • method CompileOptionUsed(optionName as String) as Boolean
  • method DumpToFile(SqliteDBConectionHandle as Ptr, File as FolderItem, TableName as string = "", PreserveRowid as Boolean = false, Newlines as Boolean = false, DumpDataOnly as Boolean = false, DumpNoSys as Boolean = false)
  • method DumpToString(SqliteDBConectionHandle as Ptr, byref Data as String, MaximumSize as Integer = 10000000, TableName as string = "", PreserveRowid as Boolean = false, Newlines as Boolean = false, DumpDataOnly as Boolean = false, DumpNoSys as Boolean = false)
  • method DumpToStrings(SqliteDBConectionHandle as Ptr, SchemaName as String = "", TableName as string = "") as String()
  • method isKeyword(name as string) as boolean
  • method Keywords as String()
  • method LoadICU as Boolean
  • method SourceID as String
  • method Use as boolean
  • method Version as String
  • method VersionNumber as Integer
  • property Base64ExtensionEnabled as Boolean
  • property CSVExtensionEnabled as Boolean
  • property ICUEnabled as Boolean
  • property ICULoaded as Boolean
  • property ICUUsed as Boolean
  • property MemoryHighwater as Int64
  • property MemoryUsed as Int64
  • property Path as String
  • property UUIDExtensionEnabled as Boolean

Some examples which use this module:

Blog Entries

Xojo Developer Magazine

Release notes

  • Version 25.3
    • Improved DumpToStrings method to InternalSQLiteLibraryMBS module.
    • Added uuid and base64 extensions for the built-in SQLite library in InternalSQLiteLibraryMBS module.
    • Added UUIDExtensionEnabled and Base64ExtensionEnabled properties to InternalSQLiteLibraryMBS module.
    • Added CSV extension for the built-in SQLite library in InternalSQLiteLibraryMBS module.
    • Added DumpToStrings method to InternalSQLiteLibraryMBS module.
  • Version 24.1
  • Version 22.5
  • Version 22.2
  • Version 22.0
  • Version 21.2
  • Version 19.2
  • Version 18.3

The items on this page are in the following plugins: MBS SQL Plugin.


The biggest plugin in space...