1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
//! Table schema definitions.
//!
//! Use the [`schema!`](crate::schema!) macro to generate a schema type that
//! provides both **typed field constants** for SQL generation and a **value struct**
//! with one public field per column. Alternatively, implement [`Schema`] manually
//! for fully custom definitions.
//!
//! # Example
//!
//! ```ignore
//! use sqlw::schema;
//!
//! schema!(User "users" {
//! ID: i64 "id",
//! NAME: String "name",
//! EMAIL: String "email",
//! });
//!
//! // Generated value struct (field names from column strings):
//! // #[derive(Debug, Default)]
//! // pub struct User {
//! // pub id: i64,
//! // pub name: String,
//! // pub email: String,
//! // }
//!
//! // Generated constants:
//! // User::TABLE -> Def<User> = "users"
//! // User::ID -> Def<User, Typed<i64>> = "id"
//! // User::NAME -> Def<User, Typed<String>> = "name"
//! // User::EMAIL -> Def<User, Typed<String>> = "email"
//! ```
use PhantomData;
use crateValue;
/// Marker trait for schema types.
///
/// Schema types provide `TABLE` and field constants for schema-safe
/// SQL generation. Typically derived via the [`schema!`](crate::schema!) macro.
/// Marker for schema defs without a declared bind type.
;
/// Marker for schema defs with a declared bind type.
;
/// A schema definition entry for a schema type.
///
/// Used for both table and field constants. The wrapped string can be
/// interpreted as either a table name or a column name depending on context.
/// Access the underlying identifier with [`desc`](Self::desc).
/// Binding behavior attached to a schema field definition kind.
/// Binds a value using the expected type carried by a schema field definition.