Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
SQL.InternalSQLiteLibrary.Dump
Convert an SQLite database into SQL statements that will recreate that database.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
SQL | 15.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameters
Parameter | Description | Example | Flags |
---|---|---|---|
Connection | The connection reference number gained with SQL.NewConnection. | $Connection | |
Schema | Which schema to dump. Usually "main". | "main" | |
Table | Which table to dump. “” means everything. |
Optional |
Result
Returns list or error.
Description
Convert an SQLite database into SQL statements that will recreate that database.This subroutine converts the content of an SQLite database into UTF-8 text SQL statements that can be used to exactly recreate the original database. ROWID values are preserved.
The connection handle parameter is the SQLite database connection using our internal SQLite library. Schema is the schema within that database which is to be dumped. Usually the zSchema is "main" but can also be "temp" or any ATTACH-ed database. If Table is not empty, then only the content of that one table is dumped. If zTable is empty, then all tables are dumped.
The generate text is collected and returned as a list.
Examples
Dump SQL commands for SQLite database:
# We use internal SQLite library
Set Variable [ $r ; Value: MBS( "SQL.InternalSQLiteLibrary.Activate" ) ]
# connect to some database
Set Variable [ $Connection ; Value: MBS("SQL.NewConnection") ]
Set Variable [ $r ; Value: MBS("SQL.Connect"; $Connection; "/Users/cs/test.sqlite"; ""; ""; "SQLite") ]
# dump content as SQL statements
Set Variable [ $$SQL ; Value: MBS( "SQL.InternalSQLiteLibrary.Dump"; $Connection; "main" ) ]
# close connection
Set Variable [ $r ; Value: MBS("SQL.FreeConnection"; $Connection) ]
See also
- SQL.Connect
- SQL.FreeConnection
- SQL.InternalSQLiteLibrary.Activate
- SQL.InternalSQLiteLibrary.ICUUsed
- SQL.InternalSQLiteLibrary.LoadICU
- SQL.InternalSQLiteLibrary.SourceID
- SQL.InternalSQLiteLibrary.Version
- SQL.NewConnection
Release notes
- Version 15.3
- Improved SQL.InternalSQLiteLibrary.Dump function.
- Added SQL.InternalSQLiteLibrary.Dump function.
Blog Entries
This function checks for a license.
Created 6th June 2025, last changed 8th June 2025
SQL.InternalSQLiteLibrary.Deactivate - SQL.InternalSQLiteLibrary.GetBase64ExtensionEnabled
