Nicole Tietz-Sokolskaya
77d4ebb371
backed up by experiments demonstrating that SQLite will meet all of our requirements. This also introduces ADRs in the repo, and adds a README in preparation making the repository public.
26 lines
676 B
Rust
26 lines
676 B
Rust
use rand::{
|
|
distributions::{Alphanumeric, DistString},
|
|
thread_rng,
|
|
};
|
|
use sea_orm::ActiveValue;
|
|
|
|
pub fn random_entities(count: usize, text_length: usize) -> Vec<entity::page::ActiveModel> {
|
|
let mut pages = vec![];
|
|
|
|
let mut rng = thread_rng();
|
|
|
|
for idx in 0..count {
|
|
let _id = idx as i32;
|
|
let title = "dummy_title";
|
|
let text = Alphanumeric.sample_string(&mut rng, text_length);
|
|
|
|
pages.push(entity::page::ActiveModel {
|
|
external_id: ActiveValue::Set(1),
|
|
title: ActiveValue::Set(title.to_owned()),
|
|
text: ActiveValue::Set(text),
|
|
..Default::default()
|
|
});
|
|
}
|
|
|
|
pages
|
|
}
|