A safe, extensible ORM and Query Builder for Rust – For feature requests and longer questions also see https://discourse.diesel.rs
the trait `Queryable<diesel::sql_types::Numeric, Pg>` is not implemented for `BigDecimal`
[dependencies]
diesel = { version = "1.4.5", features = ["postgres","chrono"] }
dotenv = "0.15.0"
chrono = { version = "0.4.19" , features = ["serde"] }
bigdecimal = { version = "0.2.0" , features = ["serde"] }
diesel = { version = "1.4.5", features = ["postgres","chrono","numeric"] }
hello eveyone,
when i run diesel migration run
in workspace_a,
diesel will add contents of all workspaces/migrations to the workspace_a/src/schema.rs
how to avoid this? let workspace_a/src/schema.rs just have the content of workspace_a/migrations?
project
│ migrations --- common global database schemas
│ diesel.toml --- [print_schema] file = "src/schema.rs"
│ │
│ └───src
│ │ schema.rs
│ │ ...
│
└───workspace_a
│ │
│ │ migrations --- workspace_a database schemas
│ │ diesel.toml --- [print_schema] file = "src/schema.rs"
│ └───src
│ │ schema.rs
│ │ ...
│
└───workspace_b
│ │ migrations --- workspace_a database schemas
│ │ diesel.toml --- [print_schema] file = "src/schema.rs"
│ └───src
│ │ schema.rs
│ │ ...
let total_department = department.count().get_result(&connection);
println!("{}", total_department);
Hi ! I've got a problem applying pending migration from the executable directly. The first time the migration are applied, everything is fine and the table __diesel_schema_migrations
is created in the public
schema.
All my table are in a separate schema, when I retry to apply the migration, it fails and creates a new table __diesel_schema_migrations
in the new schema.
I am not using -csearch_path
in the connection string.
How could I force diesel
to use the public
schema for its __diesel_schema_migrations
table ?
ToSql
and FromSql
traits myself for the Timestamp
<-> DateTime<Utc>
diesel_infix_operator!
(and/or _postfix
/_prefix
).ALL_MIGRATIONS
constant part of the public API and move such a functionality to diesel_migrations
itself.
m::measurement
.inner_join(p::plate.on(m::plate_id.eq(p::id)))
.inner_join(e::experiment.on(e::id.eq(p::experiment_id)))
.inner_join(pr::project.on(pr::id.eq(e::project_id)))
.inner_join(pj::pipeline_job.on(pj::measurement_id.eq(m::id)))
.inner_join(wj::worker_job.on(wj::id.eq(pj::job_id)))
.filter(wj::status.eq("Done"))
.select((
pr::default_pipeline_id,
e::default_pipeline_id,
p::default_pipeline_id,
max(pj::step_idx)
))
.load::<(Option<i64>, Option<i64>, Option<i64>, i32)>(&conn)
String
#[derive(Insertable)]
#[table_name = "order_items"]
pub struct NewOrderItem {
pub order_num: i32,
pub ts: chrono::NaiveDateTime,
pub description: String,
pub src_doc: String,
}
table! {
order_items (id) {
id -> Int4,
order_num -> Int4,
ts -> Timestamp,
description -> Text,
src_doc -> Jsonb,
}
}
src_doc
being different caused the compiler error
src_doc
field, I just get an error for the Expression is not implemented for NaiveDateTime
chrono::NaiveDateTime
and Jsonb
?