Opening SQLite *.db Files
Use the File > Open command and choose SQLite (*.db)
from the File of type list,
or drag and drop a given *.db file into the main GS-Base window.
Data from *.db files can also be accessed via the Add Table and Merge Records commands.
Saving SQLite *.db Files
If the open database is already in the *.db format, the Save command causes saving it back to the same file using the same, original table (field, keys) definitions.
If the current format is not SQLite *.db, use the File > Save Database Copy As or File > Save Recordset As commands and choose SQLite (*.db) from the File of type list. In this case, the newly created SQLite table definitions will follow the rules specified in Notes below.
Notes
-
When editing existing SQLite *.db files and saving them in this format, GS-Base preserves
SQLite table (field, keys) definitions.
New fields added to such a file in GS-Base are subject to the rules listed below. -
SQLite numeric fields become Number fields in GS-Base.
Newly added Number GS-Base fields are saved to new SQLite *.db files as DOUBLE fields. -
SQLite TEXT fields shorter than 8169 bytes become Text fields in GS-Base, and longer SQLite TEXT fields are added as Long Text fields in GS-Base.
Thus, if you export GS-Base Long Text contents shorter than 8169 to SQLite and open that SQLite file again in GS-Base, the previous GS-Base Long Text contents will be shown as Text fields, and to switch again to the Long Text pane view you need to change that field type in the Field Setup dialog box. Please also note that unless you turn off formatting in Long Text fields using Settings > Options > Editing > Strip off formatting in Long Text fields, the formatting RTF tags will be preserved and visible in the Text fields.GS-Base Text and Long Text fields are saved as SQLite TEXT fields.
-
The binary SQLite BLOB field contents from *.db files not created by GS-Base are represented
in GS-Base (in Images/Files fields) by files with the "sql_blob.bin" name.
Data from GS-Base Images/Files fields containing just one such object with that name will be saved back to the SQLite file as the same, original binary SQLite contents.
If a GS-Base Images/Files field contains more than one inserted object, or the object name is not "sql_blob.bin", the resulting SQLite BLOB field will contain binary data representing the list of these objects in the following format:- 36-character GS-Base GUID string:
EBDA2E02-5502-43C4-AF43-44EEF3375275 - a repeating list of the elements:
- 1 byte with the object/file name length,
- the file name,
- 8 bytes (representing the binary INT64 number) of the object/file data length,
- the file contents
- 36-character GS-Base GUID string:
- If a file in the SQLite *.db format is opened, the Database Explorer tree also displays the SQL field definitions along with the corresponding GS-Base field types.
To automatically resize the column widths to fit the field contents in the opened file, select the Options > General > Auto-fit column widths in imported files option. Keep in mind that for very large files this may slow down the import process. To optimize the resizing, in the Options > General dialog box, increase the declared number of processor cores that GS-Base can use.
Related Topics
Saving PDF files
Opening and saving text files
Opening and saving HTML files
Opening and saving Excel workbooks