#[cfg(native)]
pub use reinhardt_testkit::fixtures::{client, dcl, di, loader, mock, server};
#[cfg(all(native, feature = "testcontainers"))]
pub use reinhardt_testkit::fixtures::{
resources, schema, shared_postgres, testcontainers, validator,
};
#[cfg(native)]
pub use reinhardt_testkit::fixtures::migrations;
#[cfg(all(native, feature = "admin"))]
pub use reinhardt_testkit::fixtures::admin;
#[cfg(all(native, feature = "server-fn-test"))]
pub use reinhardt_testkit::fixtures::server_fn;
#[cfg(native)]
pub use reinhardt_testkit::fixtures::*;
#[cfg(native)]
pub async fn load_model_fixture_file(
path: impl AsRef<std::path::Path>,
) -> reinhardt_db::orm::fixtures::FixtureResult<usize> {
let content = std::fs::read_to_string(path)
.map_err(|error| reinhardt_db::orm::fixtures::FixtureError::Database(error.to_string()))?;
let records: Vec<reinhardt_db::orm::fixtures::FixtureRecord> = serde_json::from_str(&content)?;
reinhardt_db::orm::fixtures::load_fixture_records(&records).await
}
#[cfg(native)]
pub mod auth;
#[cfg(all(native, feature = "admin", feature = "testcontainers"))]
pub mod admin_panel;
#[cfg(all(native, feature = "admin", feature = "testcontainers"))]
pub mod admin_migrations;
#[cfg(any(
all(wasm, feature = "wasm"),
all(feature = "e2e", native),
all(feature = "e2e-cdp", native)
))]
pub mod wasm;
#[cfg(all(native, feature = "admin", feature = "testcontainers"))]
pub use admin_migrations::{AdminTableCreator, admin_table_creator};
#[cfg(all(test, native))]
mod database_reexport_tests {
use super::{TestDatabase, TestDatabaseBackend, test_database};
struct EmptyProvider;
impl reinhardt_db::migrations::MigrationProvider for EmptyProvider {
fn migrations() -> Vec<reinhardt_db::migrations::Migration> {
Vec::new()
}
}
#[test]
fn database_types_are_reexported() {
let builder = TestDatabase::builder();
let _macro_name_is_importable = stringify!(test_database);
let _database_future = test_database!(migrations = EmptyProvider);
assert_eq!(builder.backend(), TestDatabaseBackend::SqliteFile);
}
}