This document outlines the export functionality, which provides distinct export structures: Compact CSV, Raw CSV and JSON.
The default selected export structure is Compact CSV, which compresses multiple tables into a single file.
- Choose the export structure based on your specific needs and the tools you plan to use with the exported data.
- The Raw CSV export maintains table separation, which may be useful for direct database imports or when working with large datasets.
- The Compact CSV export provides a denormalized view of the data, which can be convenient for data analysis or when a single-file export is preferred.
- The JSON export provides a denormalized view of the data, which can be convenient for data analysis or when a single-file export is preferred.
The Compact CSV export combines all data into a single CSV file.
export.csv
: Contains data from all tables
The CSV file includes a header row followed by data rows.
The separator used in the format is the semicolon ;
Example export.csv
:
transactionDate;transactionTotalPrice;shop;product;variant;category;producer;price;quantity
1639353600000;75.57;null;Monster;568 ml;Energy Drink;null;4.5;1
1639353600000;75.57;null;Paper;16 Rolls;Utility;null;12;1
1644451200000;29.11;Aldi;Tomato;null;Vegetables;null;16;0.253
1644451200000;129.37;Allegro;null;null;null;null;null;null
The Raw CSV export is a literal database dump, with each table exported to a separate CSV file.
category.csv
: Contains all data from the ProductCategory tableitem.csv
: Contains all data from the Item tableproducer.csv
: Contains all data from the ProductProducer tableproduct.csv
: Contains all data from the Product tableshop.csv
: Contains all data from the Shop tabletransaction.csv
: Contains all data from the TransactionBasket tablevariant.csv
: Contains all data from the ProductVariant table
- Primary Key:
id
- Relationships:
- One-to-Many with Product (categoryId)
- Primary Key:
id
- Foreign Keys:
transactionBasketId
references TransactionBasket.idproductId
references Product.idvariantId
references Variant.id (nullable)
- Relationships:
- Many-to-One with Product
- Many-to-One with Variant (optional)
- One-to-Many with Transaction
- Primary Key:
id
- Relationships:
- One-to-Many with Product (producerId)
- Primary Key:
id
- Foreign Keys:
categoryId
references Category.idproducerId
references Producer.id (nullable)
- Relationships:
- Many-to-One with Category
- Many-to-One with Producer (optional)
- One-to-Many with Item
- One-to-Many with Variant
- Primary Key:
id
- Relationships:
- One-to-Many with Transaction (shopId)
- Primary Key:
id
- Foreign Key:
shopId
references Shop.id (nullable)
- Relationships:
- Many-to-One with Shop (optional)
- Many-to-One with Item
- Primary Key:
id
- Foreign Key:
productId
references Product.id
- Relationships:
- Many-to-One with Product
- One-to-Many with Item
- Products are categorized (Category) and may have a producer (Producer).
- Items represent specific instances of products, potentially with variants.
- Variants are specific versions or types of products.
- Transactions occur at shops and consist of multiple items.
Each CSV file includes a header row followed by data rows.
The separator used in the format is the semicolon ;
Example category.csv
:
id;name
0;Energy Drink
1;Utility
2;Vegetables
Example item.csv
:
id;transactionBasketId;productId;variantId;quantity;price
0;0;0;0;1;4.5
1;0;1;1;1;12
2;1;2;null;0.253;16
Example producer.csv
:
id;name
Example product.csv
:
id;categoryId;producerId;name
0;0;null;Monster
1;1;null;Paper
2;2;null;Tomato
Example shop.csv
:
id;name
3;Aldi
5;Allegro
Example transaction.csv
:
id;date;shopId;totalCost
0;1639353600000;null;75.57
2;1644451200000;3;29.11
7;1644451200000;5;129.37
Example variant.csv
:
id;productId;name
0;0;568 ml
1;1;16 Rolls
The JSON export combines all data into a single JSON file.
export.json
: Contains data from all tables
Example export.json
:
[
{
"id": 0,
"date": 1639353600000,
"cost": 72.57,
"shop": null,
"items": [
{
"id": 0,
"price": 4.5,
"quantity": 1.0,
"product": {
"id": 0,
"name": "Monster",
"category": {
"id": 0,
"name": "Energy Drink"
},
"producer": null
},
"variant": {
"id": 0,
"name": "568 ml"
}
},
{
"id": 0,
"price": 12.0,
"quantity": 1.0,
"product": {
"id": 1,
"name": "Paper",
"category": {
"id": 1,
"name": "Utility"
},
"producer": null
},
"variant": {
"id": 1,
"name": "16 Rolls"
}
}
]
}
]