assembly_data/fdb/
mod.rs

1//! # The database (`*.fdb`) file format used for the core database (`CDClient`)
2//!
3//! Among the resource files distributed with the LEGO® Universe game client is
4//! a copy of the core database. This database includes information on all zones,
5//! objects, components, behaviors, items, loot, currency, missions, scripts, …
6//!
7//! This (unpacked) name of this file is `/res/CDClient.fdb`. The file uses a custom
8//! database format which is essentially a sorted list of hash maps.
9//!
10//! ## Terminology
11//!
12//! - **Database**: The whole file, a collection of tables
13//! - **Table**: A collection of rows, implemented as an array of buckets
14//! - **Column**: A name and default type for the fields in every row
15//! - **Bucket**: A linked-list of rows for one value of the primary-key hash
16//! - **Row**: A list of fields, corresponding to the columns of the table definition
17//! - **Field**: A value with a type marker
18//!
19//! ## File format
20//!
21//! The file format is constructed from a bunch of structs made out of 32-bit words
22//! that may reference other structs by offset from the start of the file. These structs
23//! form a tree without circular references.
24//!
25//! These basic structs are implemented in the [`mod@file`] module.
26//!
27//! ## Using this library
28//!
29//! You can use the `mem` module to load a database from an in-memory buffer:
30//!
31//! ```
32//! use assembly_data::fdb::mem::Database;
33//!
34//! let file: &[u8] = &[0,0,0,0,8,0,0,0];
35//! let db = Database::new(file);
36//! let tables = db.tables().unwrap();
37//!
38//! assert_eq!(0, tables.len());
39//! ```
40
41#![warn(missing_docs)]
42
43pub mod common;
44pub mod core;
45pub mod file;
46pub mod io;
47pub mod mem;
48pub mod parser;
49pub mod query;
50pub mod reader;
51pub mod ro;
52pub mod store;
53
54#[cfg(feature = "sqlite")]
55pub mod sqlite;