MARS documentation
Rust librariesmars-serverStore

mars-server · store::postgres

Public declarations and documentation for mars-server::store::postgres.

Package: mars-server · Workspace version: 0.1.0 · Module: store::postgres

This reference follows declared modules and public syntax, including public implementation methods. Function bodies and constant values are omitted. Feature conditions are retained. Private-module re-exports and trait resolution require the compiler; not every declaration is a root import.

Module condition

#[cfg(feature = "postgres")]

pub use sqlx_core::query::query;

#[cfg(feature = "postgres")]
pub use sqlx_core::query::query;

Source line: 29.

pub use sqlx_core::query_scalar::query_scalar;

#[cfg(feature = "postgres")]
pub use sqlx_core::query_scalar::query_scalar;

Source line: 30.

pub use sqlx_core::row::Row;

#[cfg(feature = "postgres")]
pub use sqlx_core::row::Row;

Source line: 31.

pub use sqlx_postgres::{PgPool, Postgres};

#[cfg(feature = "postgres")]
pub use sqlx_postgres::{PgPool, Postgres};

Source line: 32.

store::postgres::sqlx::postgres

#[cfg(feature = "postgres")]
pub mod postgres;

Source line: 34.

pub use sqlx_postgres::PgPoolOptions;

#[cfg(feature = "postgres")]
pub use sqlx_postgres::PgPoolOptions;

Source line: 35.

store::postgres::PostgresStore

PostgreSQL-backed storage for the MARS registry.

Thread-safe via sqlx::PgPool (connection pool). Sequence allocation and every mutation side record are committed by one PostgreSQL transaction.

#[cfg(feature = "postgres")]
pub struct PostgresStore {

}

Source line: 161.

store::postgres::PostgresStore::connect

Connect to PostgreSQL and apply migrations.

Arguments

  • database_url — PostgreSQL connection string (e.g. postgres://user:pass@host/db)
  • config — Validated pool and PostgreSQL session bounds.
#[cfg(feature = "postgres")]
pub async fn connect<C>(database_url: &str, config: C) -> Result<Self, ServerError>
    where
        C: Into<crate::config::DatabaseConfig>,;

Source line: 172.

store::postgres::PostgresStore::connect_with_pool

Construct a store from an existing PostgreSQL pool and apply migrations.

This supports schema-scoped integration tests and deployments that own pool configuration outside MARS.

#[cfg(feature = "postgres")]
pub async fn connect_with_pool(pool: PgPool) -> Result<Self, ServerError>;

Source line: 217.

store::postgres::PostgresStore::pool

Get a reference to the underlying connection pool.

#[cfg(feature = "postgres")]
pub fn pool(&self) -> &PgPool;

Source line: 256.

Source provenance

Source: mars-server/src/store/postgres.rs · SHA-256 d42e295200f8ed04b0365792f65e8af11225d62ccae1627cbff974e5ce327e71. Package overview.

On this page