User Tools

Site Tools


mbbsemu:development:sqlite_database_specifications

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
mbbsemu:development:sqlite_database_specifications [2020/11/14 21:13] – created tudaymbbsemu:development:sqlite_database_specifications [2023/10/06 23:41] (current) – external edit 127.0.0.1
Line 1: Line 1:
 <markdown> <markdown>
-#SQLite Database Sepcifications+#SQLite Database Specifications
  
 MajorBBS & WorldGroup modules make heavy use of Btrieve databases. MajorBBS & WorldGroup modules make heavy use of Btrieve databases.
Line 15: Line 15:
 * data_t * data_t
  
-# The `metadata_ttable+# The 'metadata_ttable
  
 This table contains metadata information about the file, analogous to the file header in the Btrieve `.DAT` file. The schema is as follows This table contains metadata information about the file, analogous to the file header in the Btrieve `.DAT` file. The schema is as follows
  
-`CREATE TABLE metadata_t(record_length INTEGER NOT NULL, physical_record_length INTEGER NOT NULL, page_length INTEGER NOT NULL);`+`CREATE TABLE metadata_t(record_length INTEGER NOT NULL, physical_record_length INTEGER NOT NULL, page_length INTEGER NOT NULL, variable_length_records INTEGER NOT NULL, version INTEGER NOT NULL, acs_name STRING, acs BLOB)`
  
-The `record_length` field is the length of all the records stored in the databasein the `data` column in the `data_t` table.+The `record_length` field is the length of all the records stored in the database in the `data` column in the `data_t` table. For variable length records, this is the length of the fixed portion, so every record will be at least this large and of course could be much larger.
  
-The `physical_record_length` is the length of each physical record in the Btrieve file, and stored for informational purposes and not used by MBBSEmu.+The `physical_record_length` is the length of each fixed physical record in the Btrieve file, and stored for informational purposes and not used by MBBSEmu.
  
 The `page_length` is the length of each page in the Btrieve file, and likewise stored only for information purposes and not used by MBBSEmu. The `page_length` is the length of each page in the Btrieve file, and likewise stored only for information purposes and not used by MBBSEmu.
 +
 +`variable_length_records` indicates whether the records in this database are of variable length. Each record has a minimum length of `record_length.`
 +
 +`version` specifies the schema version of this database. It is used for schema upgrades, for example if MBBSEmu has an update that changes the schema number and adds/removes database fields, MBBSEmu can examine the `version` field and automatically upgrade the database if necessary. 
 +
 +`acs_name` and `acs` are related fields and contain information about the Alternate Collating Sequence. ACS is used to alter string keys in the database. The `acs` table is a byte array of size 256 which performs a simple string mapping for keys. ACS tables are often used for implementing case-insensitive string keys - for example the ACS table would map lower case characters to upper case and the engine treats the key as all upper case.
 +
 +`acs_name` and `acs` are both `null` if ACS tables are not used for the database. Otherwise `acs_name` is used for informational purposes only, and `acs` is a blob of length 256.
  
 *** ***
Line 57: Line 65:
 There could be multiple rows in this table depending on how many keys are in the original Btrieve database. There could be multiple rows in this table depending on how many keys are in the original Btrieve database.
  
-# The `data_ttable+# The 'data_ttable
  
-This table contains all the data/records in the database.+This table contains all the data/records in the database, one row for each record.
  
 The schema is dynamic based on the key, but always contains at least the following: The schema is dynamic based on the key, but always contains at least the following:
mbbsemu/development/sqlite_database_specifications.1605388385.txt · Last modified: 2023/10/06 23:40 (external edit)