Skip to main content

OperatorSql

Trait OperatorSql 

Source
pub trait OperatorSql: Send + Sync {
    // Required methods
    fn exec_script<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        project: &'life1 str,
        db: &'life2 str,
        script: &'life3 str,
    ) -> Pin<Box<dyn Future<Output = Result<(), SqlError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
    fn query<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        project: &'life1 str,
        db: &'life2 str,
        sql: &'life3 str,
    ) -> Pin<Box<dyn Future<Output = Result<SqlRows, SqlError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
    fn ping<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        project: &'life1 str,
        db: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<SqlPingReplica>, SqlError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

The operator-facing SQL capability for a managed database: run a migration script or a single query against a compute-backed database boatramp runs, using its sealed managed credential (resolved server-side — the credential never leaves the node). Backs POST /api/sql/{db}/{exec,query} and the boatramp sql CLI. Distinct from SqlBackends (the per-site guest binding): this is a project-scoped operator tool, admin-gated at the API.

Required Methods§

Source

fn exec_script<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, project: &'life1 str, db: &'life2 str, script: &'life3 str, ) -> Pin<Box<dyn Future<Output = Result<(), SqlError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Run a multi-statement migration script against managed database db in project (the simple-query protocol — CREATE EXTENSION + chained DDL).

Source

fn query<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, project: &'life1 str, db: &'life2 str, sql: &'life3 str, ) -> Pin<Box<dyn Future<Output = Result<SqlRows, SqlError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Run one row-returning sql statement against managed database db.

Source

fn ping<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, project: &'life1 str, db: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<SqlPingReplica>, SqlError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Probe every replica of managed database db’s compute workload — an active TCP reachability check, independent of the stored health flag. Lets an operator tell “the DB is actually down” (tcp_reachable: false) from “the DB is up but the endpoint resolver won’t serve it” (tcp_reachable: true, healthy: false — the reachable-but-not-served signature). Never runs a query or presents a credential; it only opens (and immediately drops) a TCP connection.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§