pub struct PostgresDatabase { /* private fields */ }

Implementations§

source§

impl PostgresDatabase

source

pub async fn build(url: &str, user: &str, password: &str) -> LunaOrmResult<Self>

Trait Implementations§

source§

impl CommandExecutor for PostgresDatabase

§

type G = PostgresGenerator

source§

fn get_generator(&self) -> &Self::G

source§

fn select<'life0, 'life1, 'life2, 'async_trait, SE>( &'life0 mut self, primary: &'life1 dyn Primary, selection: &'life2 dyn Selection ) -> Pin<Box<dyn Future<Output = LunaOrmResult<Option<SE>>> + Send + 'async_trait>>
where SE: SelectedEntity + Send + Unpin + 'async_trait, Self: Send + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

source§

fn create<'a, 'life0, 'async_trait>( &'life0 mut self, entity: &'a dyn Entity ) -> Pin<Box<dyn Future<Output = LunaOrmResult<&'a dyn Entity>> + Send + 'async_trait>>
where Self: Send + 'async_trait, 'a: 'async_trait, 'life0: 'async_trait,

source§

fn insert<'life0, 'life1, 'async_trait>( &'life0 mut self, entity: &'life1 dyn Entity ) -> Pin<Box<dyn Future<Output = LunaOrmResult<bool>> + Send + 'async_trait>>
where Self: Send + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

fn upsert<'life0, 'life1, 'async_trait>( &'life0 mut self, entity: &'life1 dyn Entity ) -> Pin<Box<dyn Future<Output = LunaOrmResult<bool>> + Send + 'async_trait>>
where Self: Send + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

fn update<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, mutation: &'life1 dyn Mutation, primary: &'life2 dyn Primary ) -> Pin<Box<dyn Future<Output = LunaOrmResult<bool>> + Send + 'async_trait>>
where Self: Send + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

source§

fn delete<'life0, 'life1, 'async_trait>( &'life0 mut self, primary: &'life1 dyn Primary ) -> Pin<Box<dyn Future<Output = LunaOrmResult<bool>> + Send + 'async_trait>>
where Self: Send + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

fn search<'life0, 'life1, 'life2, 'life3, 'async_trait, SE>( &'life0 mut self, location: &'life1 dyn Location, order_by: Option<&'life2 dyn OrderBy>, selection: &'life3 dyn Selection ) -> Pin<Box<dyn Future<Output = LunaOrmResult<Vec<SE>>> + Send + 'async_trait>>
where SE: SelectedEntity + Send + Unpin + 'async_trait, Self: Send + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

source§

fn count<'life0, 'life1, 'async_trait>( &'life0 mut self, location: &'life1 dyn Location ) -> Pin<Box<dyn Future<Output = LunaOrmResult<usize>> + Send + 'async_trait>>
where Self: Send + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

fn search_paged<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait, SE>( &'life0 mut self, location: &'life1 dyn Location, order_by: Option<&'life2 dyn OrderBy>, selection: &'life3 dyn Selection, page: &'life4 Pagination ) -> Pin<Box<dyn Future<Output = LunaOrmResult<PagedList<SE>>> + Send + 'async_trait>>
where SE: SelectedEntity + Send + Unpin + 'async_trait, Self: Send + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait,

source§

fn search_joined<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait, SE>( &'life0 mut self, joined_conds: JoinedConditions, locations: Vec<&'life1 dyn Location>, order_by: Option<&'life2 dyn OrderBy>, selections: Vec<&'life3 dyn Selection>, page: &'life4 Pagination ) -> Pin<Box<dyn Future<Output = String> + Send + 'async_trait>>
where SE: 'async_trait, Self: Send + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait,

source§

fn purify<'life0, 'life1, 'async_trait>( &'life0 mut self, location: &'life1 dyn Location ) -> Pin<Box<dyn Future<Output = LunaOrmResult<usize>> + Send + 'async_trait>>
where Self: Send + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

fn change<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, mutation: &'life1 dyn Mutation, location: &'life2 dyn Location ) -> Pin<Box<dyn Future<Output = LunaOrmResult<usize>> + Send + 'async_trait>>
where Self: Send + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

source§

fn execute_by_template<'life0, 'life1, 'async_trait>( &'life0 mut self, template: &'life1 dyn TemplateRecord ) -> Pin<Box<dyn Future<Output = LunaOrmResult<usize>> + Send + 'async_trait>>
where Self: Send + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

fn select_by_template<'life0, 'life1, 'async_trait, SE>( &'life0 mut self, template: &'life1 dyn TemplateRecord ) -> Pin<Box<dyn Future<Output = LunaOrmResult<Option<SE>>> + Send + 'async_trait>>
where SE: SelectedEntity + Send + Unpin + 'async_trait, Self: Send + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

fn search_by_template<'life0, 'life1, 'async_trait, SE>( &'life0 mut self, template: &'life1 dyn TemplateRecord ) -> Pin<Box<dyn Future<Output = LunaOrmResult<Vec<SE>>> + Send + 'async_trait>>
where SE: SelectedEntity + Send + Unpin + 'async_trait, Self: Send + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

fn search_paged_by_template<'life0, 'life1, 'life2, 'async_trait, SE>( &'life0 mut self, template: &'life1 dyn TemplateRecord, page: &'life2 Pagination ) -> Pin<Box<dyn Future<Output = LunaOrmResult<PagedList<SE>>> + Send + 'async_trait>>
where SE: SelectedEntity + Send + Unpin + 'async_trait, Self: Send + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

source§

impl Database for PostgresDatabase

source§

fn get_type(&self) -> &DatabaseType

source§

fn transaction<'a, 'async_trait>( &'a self ) -> Pin<Box<dyn Future<Output = LunaOrmResult<Transaction<'a, Self::G>>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'a: 'async_trait,

source§

fn remove<'life0, 'life1, 'life2, 'async_trait, SE>( &'life0 mut self, primary: &'life1 dyn Primary, selection: &'life2 dyn Selection ) -> Pin<Box<dyn Future<Output = LunaOrmResult<Option<SE>>> + Send + 'async_trait>>
where SE: SelectedEntity + Send + Unpin + 'async_trait, Self: Send + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

source§

fn transact<'life0, 'life1, 'async_trait>( &'life0 mut self, commands: &'life1 [WriteCommand] ) -> Pin<Box<dyn Future<Output = LunaOrmResult<bool>> + Send + 'async_trait>>
where Self: Send + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

impl From<PostgresDatabase> for DB<PostgresDatabase>

source§

fn from(value: PostgresDatabase) -> Self

Converts to this type from the input type.
source§

impl SqlExecutor for PostgresDatabase

source§

fn get_pool(&self) -> LunaOrmResult<&AnyPool>

source§

fn fetch_optional_plain<'life0, 'life1, 'async_trait, SE>( &'life0 mut self, stmt: &'life1 str ) -> Pin<Box<dyn Future<Output = LunaOrmResult<Option<SE>>> + Send + 'async_trait>>
where SE: SelectedEntity + Send + Unpin + 'async_trait, Self: Send + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

fn fetch_optional<'life0, 'life1, 'life2, 'async_trait, SE>( &'life0 mut self, stmt: &'life1 str, args: AnyArguments<'life2> ) -> Pin<Box<dyn Future<Output = LunaOrmResult<Option<SE>>> + Send + 'async_trait>>
where SE: SelectedEntity + Send + Unpin + 'async_trait, Self: Send + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

source§

fn fetch_all_plain<'life0, 'life1, 'async_trait, SE>( &'life0 mut self, stmt: &'life1 str ) -> Pin<Box<dyn Future<Output = LunaOrmResult<Vec<SE>>> + Send + 'async_trait>>
where SE: SelectedEntity + Send + Unpin + 'async_trait, Self: Send + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

fn fetch_all<'life0, 'life1, 'life2, 'async_trait, SE>( &'life0 mut self, stmt: &'life1 str, args: AnyArguments<'life2> ) -> Pin<Box<dyn Future<Output = LunaOrmResult<Vec<SE>>> + Send + 'async_trait>>
where SE: SelectedEntity + Send + Unpin + 'async_trait, Self: Send + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

source§

fn execute<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, stmt: &'life1 str, args: AnyArguments<'life2> ) -> Pin<Box<dyn Future<Output = LunaOrmResult<AnyQueryResult>> + Send + 'async_trait>>
where Self: Send + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

source§

fn execute_plain<'life0, 'life1, 'async_trait>( &'life0 mut self, stmt: &'life1 str ) -> Pin<Box<dyn Future<Output = LunaOrmResult<AnyQueryResult>> + Send + 'async_trait>>
where Self: Send + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

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<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

§

type Output = T

Should always be Self
source§

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

§

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>,

§

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.
§

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

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more