fernandomarca / diesel-point

1 stars 0 forks source link

Add `generate_missing_sql_type_definitions = false` to README #1

Open giovanniberti opened 2 weeks ago

giovanniberti commented 2 weeks ago

Hi, I used your library and found necessary to also add generate_missing_sql_type_definitions = false to diesel.toml, otherwise I got the following error, even after redoing diesel migrations

error[E0277]: the trait bound `PointXy: FromSqlRow<schema::sql_types::Point, Pg>` is not satisfied
  --> src/models.rs:35:19
   |
35 |     pub position: PointXy,
   |                   ^^^^^^^ the trait `FromSql<schema::sql_types::Point, Pg>` is not implemented for `PointXy`, which is required by `PointXy: FromSqlRow<schema::sql_types::Point, Pg>`
   |
   = help: the trait `FromSql<diesel_point::sql_types::Point, Pg>` is implemented for `PointXy`
   = help: for that trait implementation, expected `diesel_point::sql_types::Point`, found `schema::sql_types::Point`
   = note: required for `PointXy` to implement `diesel::Queryable<schema::sql_types::Point, Pg>`
   = note: required for `PointXy` to implement `FromSqlRow<schema::sql_types::Point, Pg>`
   = help: see issue #48214

For more information about this error, try `rustc --explain E0277`.
error: could not compile `my-project` (bin "my-project") due to 1 previous error

Thanks again for the library :)

fernandomarca commented 2 weeks ago

@giovanniberti Thanks for the contribution. Can you elaborate further on why the use of:

generate_missing_sql_type_definitions = false

In most cases it is not necessary. Which diesel version? With your explanation I will be able to document it better.