SQL.InternalSQLiteLibrary.Dump
------------------------------

Convert an SQLite database into SQL statements that will recreate that database.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [SQL](component_SQL.md) | [15.3](newinversion153.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "SQL.InternalSQLiteLibrary.Dump"; Connection; Schema { ; Table } ) 

**MBS**( **"SQL.InternalSQLiteLibrary.Dump";** /\* Convert an SQLite database into SQL statements that will recreate that database. \*/  
**$Connection**; /\* The connection reference number gained with [SQL.NewConnection](SQLNewConnection.md). \*/   
**$Schema**; /\* Which schema to dump. Usually "main".e.g. "main" \*/   
**$Table**) /\* Optional; Which table to dump.   
“” means everything. \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| Connection | The connection reference number gained with [SQL.NewConnection](SQLNewConnection.md). | $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](SQLInternalSQLiteLibraryActivate.md)" ) \]  
\# connect to some database   
Set Variable \[ $Connection ; Value: MBS ("[SQL.NewConnection](SQLNewConnection.md)") \]  
Set Variable \[ $r ; Value: MBS ("[SQL.Connect](SQLConnect.md)"; $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](SQLFreeConnection.md)"; $Connection ) \]  
### See also

- [SQL.Connect](SQLConnect.md)
- [SQL.FreeConnection](SQLFreeConnection.md)
- [SQL.InternalSQLiteLibrary.Activate](SQLInternalSQLiteLibraryActivate.md)
- [SQL.InternalSQLiteLibrary.ICUUsed](SQLInternalSQLiteLibraryICUUsed.md)
- [SQL.InternalSQLiteLibrary.LoadICU](SQLInternalSQLiteLibraryLoadICU.md)
- [SQL.InternalSQLiteLibrary.SourceID](SQLInternalSQLiteLibrarySourceID.md)
- [SQL.InternalSQLiteLibrary.Version](SQLInternalSQLiteLibraryVersion.md)
- [SQL.NewConnection](SQLNewConnection.md)

### Release notes

- **Version 15.3**
    - Added [SQL.InternalSQLiteLibrary.Dump](https://www.mbsplugins.eu/SQLInternalSQLiteLibraryDump.shtml) function.
    - Improved [SQL.InternalSQLiteLibrary.Dump](https://www.mbsplugins.eu/SQLInternalSQLiteLibraryDump.shtml) function.

### Blog Entries

- [MBS FileMaker Plugin 15.3 News](https://www.mbsplugins.de/archive/2025-07-29/MBS_FileMaker_Plugin_153_News/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 15.3pr3](https://www.mbsplugins.de/archive/2025-06-13/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 15.3pr2](https://www.mbsplugins.de/archive/2025-06-09/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 6th June 2025 , last changed 8th June 2025

  
[SQL.InternalSQLiteLibrary.Deactivate](SQLInternalSQLiteLibraryDeactivate.md) - [SQL.InternalSQLiteLibrary.GetBase64ExtensionEnabled](SQLInternalSQLiteLibraryGetBase64ExtensionEnabled.md)

[HTML Version](SQLInternalSQLiteLibraryDump.shtml)