MockDatabase (database/mock.rs)

sea-orm · sea-orm-sync/src/database/mock.rs · rust · Apache-2.0
database

Scripted in-memory database for unit testing ORM code.

// Source: https://github.com/SeaQL/sea-orm | License: Apache-2.0 | Copyright 2023 Seafire Software Limited
// Provided via justclaw.it.com; keep this notice with the code.
use crate::{
    DatabaseConnection, DatabaseConnectionType, DbBackend, EntityTrait, ExecResult,
    ExecResultHolder, Iden, IdenStatic, Iterable, MockDatabaseConnection, MockDatabaseTrait,
    ModelTrait, QueryResult, QueryResultRow, SelectA, SelectB, Statement, error::*,
};
use sea_query::{Value, ValueType, Values};
use std::{collections::BTreeMap, sync::Arc};
use tracing::instrument;

/// Scripted in-memory database for unit tests.
///
/// Queue up exec and query results with [`append_exec_results`](Self::append_exec_results)
/// / [`append_query_results`](Self::append_query_results), call
/// [`into_connection`](Sel

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key