Open billy1624 opened 2 years ago
I'd be happy to help work out the new tutorials as much as time allows 🥳
One general question:
Two specific questions:
warp
et al. later on, after the entire tutorial is published.From my part, I've not worked with gRPC or GraphQL yet. Could use support there.
Hey @nahuakang,
wrap
in the integration tutorial. But yeah, we can focus on first part of the tutorialLet me know your thoughts :)
Hey @nahuakang, @shpun817 and I will take on this task :)
Proposed outline of the revamped tutorial:
Introduction
We still have chapter 3 and more
More tutorials are welcomed! e.g. advanced topics in SeaORM, step-by-step integration example for SeaORM with frameworks such as gRPC, etc.
The new tutorial looks amazing 🥇 (sorry I didn't help out at all). I'll read it as soon as I can and give feedback from the view of a new user :)
Hey @nahuakang, no worries! Please let us know your thoughts on the new SeaORM tutorials :)
I left some edits on Chapter 1: https://github.com/SeaQL/sea-orm-tutorial/pull/18. Overall this chapter gave a very smooth introduction to how to link up sea-orm
with a cargo project and is a significant upgrade for me.
https://www.sea-ql.org/sea-orm-tutorial/ch01-08-sql-with-sea-query.html is perhaps the most confusing to me. Some lines, such as Invoke values_panic() for each row
, seem confusing to me and I struggle to see the benefits of using SeaQuery
over raw SQL or SeaORM
. Maybe we could add some paragraphs on why and when SeaQuery
will shine?
Edit: I think sea-query
README emphasizes the advantage of SeaQuery
very well so maybe a few sentences copied from the README would work already 😄
I think using SeaQuery to construct query statement while executing it on SeaORM gives you flexibility over the query building while ease the difficulty of managing the connection and mapping query result into struct.
Hello! I think you should pay attention to how Relational Query works.
https://www.sea-ql.org/sea-orm-tutorial/ch03-02-query.html
// src/schema.rs
+ #[ComplexObject]
+ impl bakery::Model {
+ async fn chefs(&self, ctx: &Context<'_>) -> Result<Vec<chef::Model>, DbErr> {
+ let db = ctx.data::<DatabaseConnection>().unwrap();
+
+ self.find_related(Chef).all(db).await
+ }
+ }
// src/entities/bakery.rs
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, SimpleObject)]
+ #[graphql(complex, name = "Bakery")]
#[sea_orm(table_name = "bakery")]
pub struct Model {
I get:
Inherent impl
cannot be defined for a type outside its containing crate [E0116]
Obviously, it is necessary to describe a different approach, since we want to move the GraphQl logic to another crate.
When we add a ComplexObject directly to an Entity, we lose context.
Interesting. If you look at the full source code (https://www.sea-ql.org/sea-orm-tutorial/ch03-00-integration-with-graphql.html) The impl
is actually on reside in the same crate where the entity is defined.
We would like to rewrite SeaORM tutorial and align with SeaORM 0.8.0 and beyond.
We're going to have two types of tutorial:
To make the tutorial more realistic and interesting, we could have theme across our tutorial.
The Basics of SeaORM
Table of Content
sea-orm-cli
Integrating with SeaORM
This would be split into multiple tutorials that depend on prior knowledge of "The Basics of SeaORM".
Frameworks to be included
Your comments, suggestions and feedbacks are appreciated! Please leave a comment below and let us know your thoughts :)
CC @tyt2y3