|
Lightweight 0.20260213.0
|
Data generation utilities for creating a 500MB+ test database. More...
#include "Entities.hpp"#include <Lightweight/DataMapper/DataMapper.hpp>#include <cstddef>#include <cstdint>#include <random>#include <string>#include <vector>Go to the source code of this file.
Classes | |
| struct | LargeDb::GeneratorConfig |
| Configuration for database generation. More... | |
| class | LargeDb::SeededRandom |
| Seeded random number generator wrapper for deterministic generation. More... | |
Functions | |
| GeneratorConfig | LargeDb::CreateScaledConfig (double scaleFactor) |
| Creates a scaled-down configuration for faster testing. | |
| void | LargeDb::CreateSchema (Light::DataMapper &dm) |
| Creates all tables for the large test database schema. | |
| void | LargeDb::DropSchema (Light::DataMapper &dm) |
| Drops all tables from the large test database schema. | |
| void | LargeDb::PopulateDatabase (Light::DataMapper &dm, GeneratorConfig const &config={}, std::function< void(double, std::string_view)> progressCallback={}) |
| Populates the database with generated data according to config. | |
| size_t | LargeDb::GetExpectedDataSize (GeneratorConfig const &config) |
| Gets the expected total size of generated data based on config. | |
| template<typename Entity , typename Generator > | |
| size_t | LargeDb::BatchInsert (Light::DataMapper &dm, size_t count, Generator &&generator, size_t batchSize=1000) |
| Batch insert helper for efficient data loading. | |
Data generation utilities for creating a 500MB+ test database.
All generation functions are deterministic when using the same seed, allowing reproducible test runs across all supported database backends.
Definition in file DataGenerator.hpp.
| GeneratorConfig LargeDb::CreateScaledConfig | ( | double | scaleFactor | ) |
Creates a scaled-down configuration for faster testing.
| scaleFactor | Factor to scale down counts (e.g., 0.1 for 10% of full size) |
References LargeDb::CreateScaledConfig().
Referenced by LargeDb::CreateScaledConfig().
| void LargeDb::CreateSchema | ( | Light::DataMapper & | dm | ) |
Creates all tables for the large test database schema.
| dm | DataMapper instance connected to the target database. |
References LargeDb::CreateSchema().
Referenced by LargeDb::CreateSchema().
| void LargeDb::DropSchema | ( | Light::DataMapper & | dm | ) |
Drops all tables from the large test database schema.
| dm | DataMapper instance connected to the target database. |
References LargeDb::DropSchema().
Referenced by LargeDb::DropSchema().
| void LargeDb::PopulateDatabase | ( | Light::DataMapper & | dm, |
| GeneratorConfig const & | config = {}, |
||
| std::function< void(double, std::string_view)> | progressCallback = {} |
||
| ) |
Populates the database with generated data according to config.
| dm | DataMapper instance connected to the target database. |
| config | Generation configuration. |
| progressCallback | Optional callback for progress reporting (0.0 to 1.0). |
References LargeDb::PopulateDatabase().
Referenced by LargeDb::PopulateDatabase().
| size_t LargeDb::GetExpectedDataSize | ( | GeneratorConfig const & | config | ) |
Gets the expected total size of generated data based on config.
| config | Generation configuration. |
References LargeDb::GetExpectedDataSize().
Referenced by LargeDb::GetExpectedDataSize().