Tag: sea-orm
-
Is there anyway to store related 1-m entities in sea orm for quering with graphql?
0 so, for example i have user entity which has related adverts (one user -> many adverts) use async_graphql::{self, SimpleObject}; use chrono::NaiveDateTime; use sea_orm::entity::prelude::*; #[derive(Clone, Debug, PartialEq, DeriveEntityModel, SimpleObject)] #[sea_orm(table_name = "user")] #[graphql(name = "User")] pub struct Model { #[sea_orm(primary_key)] pub id: i32, pub created_at: NaiveDateTime, pub updated_at: NaiveDateTime, pub name: String, pub surname: String,…
-
Query Error: error returned from database: relation “adverts” does not exist
0 so i have 2 entities in my database use async_graphql::{self, SimpleObject}; use chrono::NaiveDateTime; use sea_orm::entity::prelude::*; #[derive(Clone, Debug, PartialEq, DeriveEntityModel, SimpleObject)] #[sea_orm(table_name = "adverts")] #[graphql(name = "Advert")] pub struct Model { #[sea_orm(primary_key)] pub id: i32, pub created_at: NaiveDateTime, pub updated_at: NaiveDateTime, pub available: bool, pub price: f32, pub location: String, pub user_id: i32, // pub…