diff --git a/sqlx-core/src/from_row.rs b/sqlx-core/src/from_row.rs index 5b390401..b96801cb 100644 --- a/sqlx-core/src/from_row.rs +++ b/sqlx-core/src/from_row.rs @@ -65,6 +65,14 @@ use crate::{error::Error, row::Row}; /// reason), `lowercase`, `UPPERCASE`, `camelCase`, `PascalCase`, `SCREAMING_SNAKE_CASE` and `kebab-case`. /// The styling of each option is intended to be an example of its behavior. /// +/// Case conversion is handled by the `heck` crate. +/// See [its documentation](https://docs.rs/heck/0.5.0/heck/#definition-of-a-word-boundary) +/// for details. +/// +/// Note that numbers are *not* considered separate words. +/// For example, `Foo1` to snake case would be `foo1`, *not* `foo_1`. +/// See [this issue](https://github.com/launchbadge/sqlx/issues/3864) for discussion. +/// /// #### `default` /// /// When your struct contains a field that is not present in your query, diff --git a/sqlx-core/src/types/mod.rs b/sqlx-core/src/types/mod.rs index b00427da..b45fa2fa 100644 --- a/sqlx-core/src/types/mod.rs +++ b/sqlx-core/src/types/mod.rs @@ -99,8 +99,11 @@ pub use bstr::{BStr, BString}; /// /// ## Compile-time verification /// -/// With compile-time verification, the use of type overrides is currently required to make -/// use of any user-defined types. +/// Type definitions are *not* verified against the database at compile-time. +/// The [`query!()`](macro.query.html) macros have no implicit knowledge of user-defined types. +/// +/// When using custom types in query parameters or output columns with `query!()`, +/// the use of [type overrides](macro.query.html#type-overrides-bind-parameters-postgres-only) is required. /// /// ```rust,ignore /// struct MyUser { id: UserId, name: String } diff --git a/src/macros/mod.rs b/src/macros/mod.rs index 7f8ff747..9e819358 100644 --- a/src/macros/mod.rs +++ b/src/macros/mod.rs @@ -249,7 +249,7 @@ /// /// ##### Force a Different/Custom Type /// Selecting a column `foo as "foo: T"` (Postgres / SQLite) or `` foo as `foo: T` `` (MySQL) -/// overrides the inferred type which is useful when selecting user-defined custom types +/// overrides the inferred type which is useful when selecting user-defined [custom types][crate::Type#compile-time-verification] /// (dynamic type checking is still done so if the types are incompatible this will be an error /// at runtime instead of compile-time). Note that this syntax alone doesn't override inferred nullability, /// but it is compatible with the forced not-null and forced nullable annotations: