Table of Contents
VDatabase Class: Dump Methods
VDatabase.Dump()
Declaration:
Dump( inDumpFile as FolderItem, inDumpType as Integer, inDumpData as EVDataKind = kStructureAndRecords, inFormatDump as Boolean = false, inEncoding = "UTF-16" )
Parameters:
- inDumpFile - The location of dump file.
- inDumpType - The Type of dump.
- inDumpData - Specify which information to dump.
- inFormatDump - If TRUE then formats the dump file for human read.
- inEncoding - Encoding of dump file.
Description:
Dumps all possible information about a database into a dump file.
Tip: You can use this file to recreate a database into a different location.
DumpType can be one of the following: kSQL dump. A Text file that contains a set of INSERT commands. kXML dump. A Text file that contains the database information in XML format.
XML dump is very useful since it allows you to dump a database with ObjectPtr fields safely. On loading this information into a new database, Valentina will automatically correct the values of ObjectPtr fields in related tables. You can also use XML dump and load to compact your database.
Example:
dim db as VDatabase ... db.Dump( fiXML, EVDumpType.kXML )
VDatabase.LoadDump()
Declaration:
LoadDump( inDumpFile as FolderItem, inNewDb as FolderItem, inDumpType as Integer, inEncoding = "UTF-16" )
Parameters:
- inDumpFile - The location of a dump file.
- inNewDb - The location for a new database.
- inDumpType - Type of a dump.
- inEncoding - Encoding of dump file.
Description:
Loads the dump file into a new fresh database. This function is similar to the db.Create() function.
Note: You should use a variable of type VDatabase, but not your subclass of VDatabase! After the loading is complete, you will have to close the VDatabase and open it again as your subclass.
Example:
dim db as VDatabase ... db.LoadDump(fiXML,fiNewDb, EVDumpType.kXML )
VDatabase.DumpEx()
[New in v.9.1]
Declaration:
DumpEx( inDumpFile as FolderItem, inDataFile as FolderItem, inMaxDataSizeForInline as integer, inIsExternalizeStringData as Boolean inEncoding = "UTF-16" )
Parameters:
- inDumpFile - The location of dump file.
- inDataFile - The location of external data file.
- inMaxDataSizeForInline - The max binary-data size which will be inlined in the dump file. The bigger data will come to external data-file.
- inIsExternalizeStringData - If TRUE then string-based data (String/VarChar/TEXT) bigger then inMaxDataSizeForInline will come to external data-file.
- inEncoding - Encoding of dump file.
Description:
Dumps database structure and data into a SQL-dump file and external binary-data file. The SQL-dump file employs Valentina extension - “$(offset,size)” for such “externalized” data. It looks like file-binding and means offset and extension in the additional external binary-data file. It would be helpful for “big-data” databases.
Example:
dim db as VDatabase ... -- Externalize any data bigger than 10 bytes including string-based ones. db.DumpEx( fiDump, fiData, 10, true )
VDatabase.LoadDumpEx()
[New in v.9.1]
Declaration:
LoadDumpEx( inDumpFile as FolderItem, inDataFile as FolderItem inNewDb as FolderItem, inEncoding = "UTF-16" )
Parameters:
- inDumpFile - The location of a dump file.
- inDataFile - The location of external data file.
- inNewDb - The location for a new database.
- inEncoding - Encoding of dump file.
Description:
Loads the SQL-dump file with external data in inDataFile (optionally) into a new fresh database. This function is similar to the db.LoadDump() function.
Example:
dim db as VDatabase ... db.LoadDumpEx( fiDump, fiData, fiNewDb )