Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions sqlx-core/src/from_row.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
7 changes: 5 additions & 2 deletions sqlx-core/src/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Comment thread
abonander marked this conversation as resolved.
///
/// ```rust,ignore
/// struct MyUser { id: UserId, name: String }
Expand Down
2 changes: 1 addition & 1 deletion src/macros/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down