Questions tagged [rust-diesel]

This tag should be used for questions related to the diesel Rust ORM.

Diesel is an object relational mapper written in Rust. Diesel makes it easy to interact with SQL databases such as PostgreSQL and SQLite in a type-safe way.

Producing a Minimal, Reproducible Example (MRE) for Diesel

All of the general rules for a MRE apply, as do those for creating a Rust-specific MRE (see "Producing a Minimal, Reproducible Example (MRE) for Rust code").

You should include information like:

  • What database system you are using (e.g. Postgres, MySQL, SQLite, etc.)
  • Your schema definition(s)
  • Your model definition(s)

You can combine all of your code into a single file, like this:

#[macro_use]
extern crate diesel;

mod schema {
    table! {
        users (user_id) {
            user_id -> Int4,
            email -> Text,
        }
    }

    #[derive(Debug, Identifiable)]
    #[primary_key(email)]
    pub struct User {
        pub user_id: i32,
        pub email: String,
    }
}

fn main() {}
392 questions
-2
votes
1 answer

how can I fix sql type error with diesel and juniper for mysql in graphQL mutation?

I confronted the error logs below when I try to create mutation with graphGL and mysql via diesel. currently the type of enum is just diesel's type but I want to make that with graphQl's type. I implemented Customer Structure for graphQL like…
ryosukemitake
  • 49
  • 1
  • 6
1 2 3
26
27