[][src]Trait city_time_zone_sqlite::repos::TraitRepoD01

pub trait TraitRepoD01 {
    fn d01_insert(
        &self,
        country: &str,
        name: &str,
        lat: f32,
        lng: f32
    ) -> Result<String, AppError>;
fn d01_search(&self, search: &str) -> Result<Vec<DtoCitys>, AppError>;
fn d01_search_compact(
        &self,
        search: &str
    ) -> Result<Vec<DtoCitysCompact>, AppError>; }

Required methods

fn d01_insert(
    &self,
    country: &str,
    name: &str,
    lat: f32,
    lng: f32
) -> Result<String, AppError>

fn d01_search_compact(
    &self,
    search: &str
) -> Result<Vec<DtoCitysCompact>, AppError>

Loading content...

Implementors

impl TraitRepoD01 for Repo[src]

Search

let d05_recs special because :

https://docs.diesel.rs/diesel/associations/index.html

Associations in Diesel are always child-to-parent. You can declare an association between two records with #[belongs_to]. Unlike other ORMs, Diesel has no concept of #[has_many] -------- Other technics for join belonging_to resut

let d01_rec = d01_citys .limit(5) .load::(&self.connection) .expect("Error query d01_city"); let d05_rec = D05LinkD01D02::belonging_to(&d01_rec) .load::(&self.connection) .expect("Error query d01_city -> d05_link_d01_d02") .grouped_by(&d01_rec); let res = d01_rec.clone().into_iter().zip(d05_rec).collect::<Vec<_>>();

fn d01_search_compact(
    &self,
    search: &str
) -> Result<Vec<DtoCitysCompact>, AppError>
[src]

Search for web speed query without unececary field like id -> uuid

Loading content...