| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
Something I have noticed while doing this is that tables with only one column do not work! E.g. #[derive(Debug, ormx::Table)]
#[ormx(table = "users_with_string_id", id = user_id, insertable, deletable)]
struct UserWithStringId {
// `#[ormx(get_one = ..)]` generates `User::get_by_user_id(db, id: String) -> Result<User>` for us
#[ormx(column = "id", default, get_one = get_by_user_id)] // map this field to the column "id"
user_id: String,
}will raise this error: ERROR: syntax error at or near "WHERE" at character 36 I've narrowed it down to this: UPDATE "users_with_string_id" SET WHERE "id" = $1 See above that between SET and WHERE, there it expects the other columns, but when there are no other columns. This leads to sqlx erroring during marco-expansion, therefore failing to compile. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Meant to implement #43.