pub struct RelationalSelectBuilder { /* private fields */ }Expand description
Builder for relational SELECT queries.
Implementations§
Source§impl RelationalSelectBuilder
impl RelationalSelectBuilder
Sourcepub fn new(source_table: &str, columns: &[&str]) -> Self
pub fn new(source_table: &str, columns: &[&str]) -> Self
New builder for the given source table and scalar columns.
Sourcepub fn with_many(
self,
field_name: &str,
target_table: &str,
local_key: &str,
foreign_key: &str,
target_columns: &[&str],
) -> Self
pub fn with_many( self, field_name: &str, target_table: &str, local_key: &str, foreign_key: &str, target_columns: &[&str], ) -> Self
Add a has-many relation.
Sourcepub fn with_one(
self,
field_name: &str,
target_table: &str,
local_key: &str,
foreign_key: &str,
target_columns: &[&str],
) -> Self
pub fn with_one( self, field_name: &str, target_table: &str, local_key: &str, foreign_key: &str, target_columns: &[&str], ) -> Self
Add a has-one / belongs-to relation.
Sourcepub fn relation_configs(&self) -> &[RelationConfig]
pub fn relation_configs(&self) -> &[RelationConfig]
Relation configurations in declaration order.
Sourcepub fn source_table(&self) -> &str
pub fn source_table(&self) -> &str
Source table name.
Sourcepub fn source_columns(&self) -> &[String]
pub fn source_columns(&self) -> &[String]
Scalar column names on the source table.
Source§impl RelationalSelectBuilder
impl RelationalSelectBuilder
Sourcepub fn to_sql_postgres(&self) -> String
pub fn to_sql_postgres(&self) -> String
Postgres: LEFT JOIN LATERAL + json_agg / json_build_array.
Auto Trait Implementations§
impl Freeze for RelationalSelectBuilder
impl RefUnwindSafe for RelationalSelectBuilder
impl Send for RelationalSelectBuilder
impl Sync for RelationalSelectBuilder
impl Unpin for RelationalSelectBuilder
impl UnsafeUnpin for RelationalSelectBuilder
impl UnwindSafe for RelationalSelectBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more