Import the Rebrickable LEGO database into SQLite.
rbk-db dump
sqlite3 rebrickable.dbThe complete database schema is available here.
An inventory represents either:
- A specific version of a LEGO set, which includes:
- A list of subsets (table
inventory_sets); - A list of parts (table
inventory_parts), excluding parts of subsets and minifigures; - A list of minifigures (table
inventory_minifigs);
- A list of subsets (table
- A minifigure, which includes:
- A list of parts (table
inventory_parts).
- A list of parts (table
Therefore, inventories.set_num serves as a foreign key to either sets.set_num or minifigs.fig_num, depending on the inventory type.
In the case of minifigures, inventories.set_num is prefixed with fig- and version is always 1.
