Add sqlite load into Database.Seed

This commit is contained in:
Aaron Po
2026-07-20 00:55:21 -04:00
parent ec770aa724
commit 5fd60b33f7
15 changed files with 298 additions and 21 deletions

View File

@@ -111,8 +111,9 @@ if(NOT BIERGARTEN_MOCK_ONLY)
)
FetchContent_MakeAvailable(llama-cpp)
endif()
if (NOT APPLE)
find_package(OpenMP REQUIRED)
endif()
endif()
# spdlog
@@ -249,9 +250,10 @@ target_include_directories(${PROJECT_NAME} PRIVATE
includes
)
target_link_libraries(${PROJECT_NAME} PRIVATE
$<$<NOT:$<BOOL:${BIERGARTEN_MOCK_ONLY}>>:llama>
$<$<NOT:$<BOOL:${BIERGARTEN_MOCK_ONLY}>>:OpenMP::OpenMP_CXX>
$<TARGET_NAME_IF_EXISTS:OpenMP::OpenMP_CXX>
boost::di
Boost::json
Boost::program_options

View File

@@ -54,11 +54,11 @@ void XegerGenerator::Visit(const Alternation& node) {
}
void XegerGenerator::Visit(const Repeat& node) {
const int lo = node.min;
const int hi = (node.max < 0) ? node.min + unbounded_cap_ : node.max;
std::uniform_int_distribution<int> dist(lo, hi);
const int count = dist(rng_);
for (int i = 0; i < count; ++i) {
const unsigned int low = node.min;
const unsigned int high = node.max.value_or(node.min + unbounded_cap_);
std::uniform_int_distribution<unsigned int> dist(low, high);
const unsigned int count = dist(rng_);
for (unsigned int i = 0; i < count; ++i) {
node.child->Accept(*this);
}
}