Skip to main content

PostgresTransaction

Struct PostgresTransaction 

Source
pub struct PostgresTransaction {
    pub writable: bool,
}
Expand description

A transaction for reading and writing statements in PostgreSQL.

Fields§

§writable: bool

Implementations§

Source§

impl PostgresTransaction

Source

pub async fn begin( _store: &PostgresStore, writable: bool, ) -> Result<Self, PostgresError>

Source

pub fn is_writable(&self) -> bool

Trait Implementations§

Source§

impl Debug for PostgresTransaction

Source§

fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl ReadTransaction for PostgresTransaction

Source§

type Error = PostgresError

Source§

type Term = HeapTerm

Source§

type Statement = Quad<HeapTerm>

Source§

type StatementPattern = QuadPattern<HeapTerm>

Source§

fn match( &self, _pattern: impl Into<Self::StatementPattern>, ) -> impl Stream<Item = Result<Self::Statement, Self::Error>>

Returns a stream of all statements matching the given statement pattern. Read more
Source§

fn is_empty(&self) -> impl Future<Output = Result<bool, Self::Error>> + Send

Returns true if the store is empty (contains no statements). Read more
Source§

fn contexts(&self) -> impl Stream<Item = Result<Self::Term, Self::Error>> + Send

Returns a stream of all context terms (graph names) in the store. Read more
Source§

fn contains( &self, pattern: impl Into<Self::StatementPattern> + Send, ) -> impl Future<Output = Result<bool, Self::Error>> + Send

Returns true if the store contains the given statement (pattern). Read more
Source§

fn count( &self, pattern: impl Into<Self::StatementPattern> + Send, ) -> impl Future<Output = Result<u64, Self::Error>> + Send

Returns the number of statements matching the given statement pattern. Read more
Source§

impl WriteTransaction for PostgresTransaction

Source§

type Error = PostgresError

Source§

type Term = HeapTerm

Source§

type Statement = Quad<HeapTerm>

Source§

type StatementPattern = QuadPattern<HeapTerm>

Source§

async fn rollback(self) -> Result<(), Self::Error>

Aborts the transaction, discarding any changes. Read more
Source§

async fn commit(self) -> Result<(), Self::Error>

Commits the transaction, applying all changes. Read more
Source§

async fn clear(&mut self) -> Result<(), Self::Error>

Clears all data from the store. Read more
Source§

async fn insert( &mut self, _statement: impl Into<Self::Statement> + Send, ) -> Result<(), Self::Error>

Inserts a statement into the store. Read more
Source§

async fn remove( &mut self, _statement: impl Into<Self::Statement> + Send, ) -> Result<(), Self::Error>

Removes a statement from the store. Read more
Source§

async fn delete( &mut self, _pattern: impl Into<Self::StatementPattern> + Send, ) -> Result<(), Self::Error>

Deletes all statements matching the given statement pattern. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V