Changelog

v2.2.1 — Upcoming

Fix table: name now validated at parse time

Table names were interpolated straight into generated Rust source (migration files, Alias::new("...")) via format! with no validation. A stray " in a copy-pasted name could corrupt the generated file — or, worst case, inject into it — instead of failing where the mistake was made. table: is now validated against a plain SQL-identifier shape (^[A-Za-z_][A-Za-z0-9_]*$, ≤63 chars) as soon as it's parsed, with a syn::Error pointing at the literal.

Fix Duplicate field and enum names caught at parse time

{ name: text, name: text }, or two Status: [...] entries under enums:, used to parse cleanly and only fail later as a cryptic field name is already declared compile error on the generated code. Both loops now track seen names and reject a duplicate immediately, with a syn::Error on the offending identifier.

Fix Typos in table: / pk keywords no longer panic

assert_eq!(table_kw.to_string(), "table") (and the pk equivalent) aborted the proc-macro with a raw assertion-failure message and no useful span on a misspelled keyword. Replaced with an explicit check returning a syn::Error.

Fix default: literal checked against the field kind

age: int [default: "abc"] parsed without complaint and only surfaced much later as a confusing SeaORM/SQL type mismatch. The literal is now validated against the field kind right after parsing: bool literal for bool, integer for integer kinds, integer or float for float / decimal / percent, string otherwise.

Fix max: 0 rejected on string fields

0 was accepted silently, producing a VARCHAR(0)-shaped column with no meaningful capacity. Now rejected at parse time.

← Newer 1 / 26 Older →