drizzle-postgres 0.1.13

A type-safe SQL query builder for Rust
Documentation
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
//! Attribute markers for `PostgresTable` derive macro.
//!
//! These const markers are used within `#[column(...)]` and `#[PostgresTable(...)]`
//! attributes. Import them from the prelude to get IDE hover documentation.
//!
//! # Example
//! ```rust
//! # extern crate self as drizzle;
//! # mod _drizzle {
//! #     pub mod core { pub use drizzle_core::*; }
//! #     pub mod error { pub use drizzle_core::error::*; }
//! #     pub mod types { pub use drizzle_types::*; }
//! #     pub mod migrations { pub use drizzle_migrations::*; }
//! #     pub use drizzle_types::Dialect;
//! #     pub use drizzle_types as ddl;
//! #     pub mod postgres {
//! #         pub mod values { pub use drizzle_postgres::values::*; }
//! #         pub mod traits { pub use drizzle_postgres::traits::*; }
//! #         pub mod common { pub use drizzle_postgres::common::*; }
//! #         pub mod attrs { pub use drizzle_postgres::attrs::*; }
//! #         pub mod builder { pub use drizzle_postgres::builder::*; }
//! #         pub mod helpers { pub use drizzle_postgres::helpers::*; }
//! #         pub mod expr { pub use drizzle_postgres::expr::*; }
//! #         pub mod types { pub use drizzle_postgres::types::*; }
//! #         pub struct Row;
//! #         impl Row {
//! #             pub fn get<'a, I, T>(&'a self, _: I) -> T { unimplemented!() }
//! #             pub fn try_get<'a, I, T>(&'a self, _: I) -> Result<T, Box<dyn std::error::Error + Sync + Send>> { unimplemented!() }
//! #         }
//! #         pub mod prelude {
//! #             pub use drizzle_macros::{PostgresTable, PostgresSchema, PostgresIndex};
//! #             pub use drizzle_postgres::attrs::*;
//! #             pub use drizzle_postgres::common::PostgresSchemaType;
//! #             pub use drizzle_postgres::traits::{PostgresColumn, PostgresTable};
//! #             pub use drizzle_postgres::values::{PostgresInsertValue, PostgresUpdateValue, PostgresValue};
//! #             pub use drizzle_core::*;
//! #         }
//! #     }
//! # }
//! # pub use _drizzle::*;
//! # pub use const_format;
//! fn main() {
//! use drizzle::postgres::prelude::*;
//!
//! #[PostgresTable(
//!     NAME = "users",
//!     UNLOGGED,
//!     RLS,
//!     UNIQUE(columns(email, tenant_id)),
//!     CHECK(name = "users_score_check", expr = "score >= 0")
//! )]
//! struct User {
//!     #[column(PRIMARY, SERIAL)]
//!     id: i32,
//!     #[column(UNIQUE)]
//!     email: String,
//!     tenant_id: i32,
//!     score: i32,
//!     metadata: String,
//! }
//! }
//! ```

/// Marker struct for column constraint attributes.
#[derive(Debug, Clone, Copy)]
pub struct ColumnMarker;

//------------------------------------------------------------------------------
// Primary Key Constraints
//------------------------------------------------------------------------------

/// Marks this column as the PRIMARY KEY.
///
/// ## Example
/// ```rust
/// # let _ = r####"
/// #[column(PRIMARY)]
/// id: i32,
/// # "####;
/// ```
///
/// See: <https://www.postgresql.org/docs/current/ddl-constraints.html#DDL-CONSTRAINTS-PRIMARY-KEYS>
pub const PRIMARY: ColumnMarker = ColumnMarker;

/// Alias for [`PRIMARY`].
pub const PRIMARY_KEY: ColumnMarker = ColumnMarker;

//------------------------------------------------------------------------------
// Auto-increment Types
//------------------------------------------------------------------------------

/// Creates a SERIAL column (auto-incrementing 32-bit integer).
///
/// ## Example
/// ```rust
/// # let _ = r####"
/// #[column(PRIMARY, SERIAL)]
/// id: i32,
/// # "####;
/// ```
///
/// See: <https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-SERIAL>
pub const SERIAL: ColumnMarker = ColumnMarker;

/// Creates a BIGSERIAL column (auto-incrementing 64-bit integer).
///
/// ## Example
/// ```rust
/// # let _ = r####"
/// #[column(PRIMARY, BIGSERIAL)]
/// id: i64,
/// # "####;
/// ```
///
/// See: <https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-SERIAL>
pub const BIGSERIAL: ColumnMarker = ColumnMarker;

/// Creates a SMALLSERIAL column (auto-incrementing 16-bit integer).
///
/// ## Example
/// ```rust
/// # let _ = r####"
/// #[column(PRIMARY, SMALLSERIAL)]
/// id: i16,
/// # "####;
/// ```
///
/// See: <https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-SERIAL>
pub const SMALLSERIAL: ColumnMarker = ColumnMarker;

//------------------------------------------------------------------------------
// Uniqueness Constraints
//------------------------------------------------------------------------------

/// Adds a UNIQUE constraint to a column, table, or index.
///
/// ## Examples
/// ```rust
/// # let _ = r####"
/// #[column(UNIQUE)]
/// email: String,
///
/// #[PostgresTable(UNIQUE(columns(email, tenant_id), deferrable))]
/// struct Users {
///     email: String,
///     tenant_id: i32,
/// }
///
/// #[PostgresIndex(unique)]
/// struct UsersEmailIdx(Users::email);
/// # "####;
/// ```
///
/// See: <https://www.postgresql.org/docs/current/ddl-constraints.html#DDL-CONSTRAINTS-UNIQUE-CONSTRAINTS>
pub const UNIQUE: ColumnMarker = ColumnMarker;

//------------------------------------------------------------------------------
// Identity Columns
//------------------------------------------------------------------------------

/// Creates a GENERATED IDENTITY column with configurable mode.
///
/// ## Syntax
/// - `identity(always)` - User values rejected unless OVERRIDING SYSTEM VALUE
/// - `identity(by_default)` - User values take precedence
///
/// ## Example
/// ```rust
/// # let _ = r####"
/// // GENERATED ALWAYS AS IDENTITY - strictest mode
/// #[column(identity(always), primary)]
/// id: i64,
///
/// // GENERATED BY DEFAULT AS IDENTITY - allows override
/// #[column(identity(by_default), primary)]
/// id: i64,
/// # "####;
/// ```
///
/// ## Technical Details
/// `PostgreSQL`'s identity columns are SQL-standard compliant, unlike SERIAL.
/// Use ALWAYS for auto-generated IDs, BY DEFAULT when you need to occasionally set values.
///
/// See: <https://www.postgresql.org/docs/current/ddl-identity-columns.html>
pub const IDENTITY: ColumnMarker = ColumnMarker;

/// Marks a column as a GENERATED AS (expression) column.
///
/// ## Syntax
/// - `generated(stored, "expression")` - Computed on write, stored on disk
/// - `generated(virtual, "expression")` - Computed on read, not stored (`PostgreSQL` 18+)
///
/// ## Example
/// ```rust
/// # let _ = r####"
/// #[column(generated(stored, "price * quantity"))]
/// total: i32,
///
/// #[column(generated(virtual, "first_name || ' ' || last_name"))]
/// full_name: String,
/// # "####;
/// ```
///
/// ## Technical Details
/// Generated columns cannot be written to directly.
/// STORED columns are computed and stored on write.
/// VIRTUAL columns are computed on read (`PostgreSQL` 18+).
///
/// See: <https://www.postgresql.org/docs/current/ddl-generated-columns.html>
pub const GENERATED: ColumnMarker = ColumnMarker;

//------------------------------------------------------------------------------
// Serialization Modes
//------------------------------------------------------------------------------

/// Enables JSON serialization with JSON type storage.
///
/// ## Example
/// ```rust
/// # let _ = r####"
/// #[column(JSON)]
/// metadata: UserMetadata,
/// # "####;
/// ```
///
/// Requires the `serde` feature. The field type must implement `Serialize` and `Deserialize`.
///
/// See: <https://www.postgresql.org/docs/current/datatype-json.html>
pub const JSON: ColumnMarker = ColumnMarker;

/// Enables JSON serialization with JSONB storage.
///
/// ## Example
/// ```rust
/// # let _ = r####"
/// #[column(JSONB)]
/// config: AppConfig,
/// # "####;
/// ```
///
/// JSONB is the recommended JSON storage format for most use cases.
/// It supports indexing and efficient querying.
///
/// Requires the `serde` feature. The field type must implement `Serialize` and `Deserialize`.
///
/// See: <https://www.postgresql.org/docs/current/datatype-json.html>
pub const JSONB: ColumnMarker = ColumnMarker;

/// Marks this column as storing an enum type.
///
/// ## Example
/// ```rust
/// # let _ = r####"
/// #[column(ENUM)]
/// role: Role,
/// # "####;
/// ```
///
/// For `PostgreSQL` native ENUM types or text-based enum storage.
///
/// See: <https://www.postgresql.org/docs/current/datatype-enum.html>
pub const ENUM: ColumnMarker = ColumnMarker;

//------------------------------------------------------------------------------
// Collation Markers
//------------------------------------------------------------------------------

/// Specifies a collation for a text column.
///
/// PostgreSQL collation identifiers are quoted names; the DDL emitter
/// wraps whatever you supply here in double quotes, so write the bare
/// name (`"en_US"`, `"C"`, `"POSIX"`, or any `CREATE COLLATION` value).
///
/// ## Example
/// ```rust
/// # let _ = r####"
/// #[column(COLLATE = "en_US")]
/// name: String,
/// # "####;
/// ```
///
/// See: <https://www.postgresql.org/docs/current/collation.html>
pub const COLLATE: ColumnMarker = ColumnMarker;

//------------------------------------------------------------------------------
// Default Value Parameters
//------------------------------------------------------------------------------

/// Specifies a function to generate default values at runtime.
///
/// The function is called for each insert when no value is provided.
///
/// ## Example
/// ```rust
/// # let _ = r####"
/// #[column(DEFAULT_FN = Uuid::new_v4)]
/// id: Uuid,
/// # "####;
/// ```
///
/// ## Difference from DEFAULT
/// - `DEFAULT_FN`: Calls the function at runtime for each insert (e.g., UUID generation)
/// - `DEFAULT`: Uses a fixed compile-time value
pub const DEFAULT_FN: ColumnMarker = ColumnMarker;

/// Specifies a raw SQL default expression emitted directly in DDL.
///
/// ## Example
/// ```rust
/// # let _ = r####"
/// #[column(DEFAULT_SQL = "now()")]
/// created_at: String,
/// # "####;
/// ```
///
/// Use [`DEFAULT`] for literal Rust values and `DEFAULT_SQL` when the default
/// must be a database expression.
///
/// See: <https://www.postgresql.org/docs/current/ddl-default.html>
pub const DEFAULT_SQL: ColumnMarker = ColumnMarker;

/// Specifies a fixed default value for new rows.
///
/// ## Example
/// ```rust
/// # let _ = r####"
/// #[column(DEFAULT = 0)]
/// count: i32,
///
/// #[column(DEFAULT = "guest")]
/// role: String,
/// # "####;
/// ```
///
/// For runtime-generated values (UUIDs, timestamps), use [`DEFAULT_FN`] instead.
///
/// See: <https://www.postgresql.org/docs/current/ddl-default.html>
pub const DEFAULT: ColumnMarker = ColumnMarker;

/// Establishes a foreign key reference to another table's column.
///
/// ## Example
/// ```rust
/// # let _ = r####"
/// #[column(REFERENCES = User::id)]
/// user_id: i32,
/// # "####;
/// ```
///
/// See: <https://www.postgresql.org/docs/current/ddl-constraints.html#DDL-CONSTRAINTS-FK>
pub const REFERENCES: ColumnMarker = ColumnMarker;

/// Specifies the ON DELETE action for foreign key references.
///
/// ## Example
/// ```rust
/// # let _ = r####"
/// #[column(REFERENCES = User::id, ON_DELETE = CASCADE)]
/// user_id: i32,
/// # "####;
/// ```
///
/// ## Supported Actions
/// - `CASCADE`: Delete rows that reference the deleted row
/// - `SET_NULL`: Set the column to NULL when referenced row is deleted
/// - `SET_DEFAULT`: Set the column to its default value
/// - `RESTRICT`: Prevent deletion if referenced
/// - `NO_ACTION`: Similar to RESTRICT (default)
///
/// See: <https://www.postgresql.org/docs/current/ddl-constraints.html#DDL-CONSTRAINTS-FK>
pub const ON_DELETE: ColumnMarker = ColumnMarker;

/// Specifies the ON UPDATE action for foreign key references.
///
/// ## Example
/// ```rust
/// # let _ = r####"
/// #[column(REFERENCES = User::id, ON_UPDATE = CASCADE)]
/// user_id: i32,
/// # "####;
/// ```
///
/// ## Supported Actions
/// - `CASCADE`: Update referencing rows when referenced row is updated
/// - `SET_NULL`: Set the column to NULL when referenced row is updated
/// - `SET_DEFAULT`: Set the column to its default value
/// - `RESTRICT`: Prevent update if referenced
/// - `NO_ACTION`: Similar to RESTRICT (default)
///
/// See: <https://www.postgresql.org/docs/current/ddl-constraints.html#DDL-CONSTRAINTS-FK>
pub const ON_UPDATE: ColumnMarker = ColumnMarker;

/// Marks a foreign key or table-level UNIQUE constraint as DEFERRABLE.
///
/// ## Example
/// ```rust
/// # let _ = r####"
/// #[column(REFERENCES = Users::id, DEFERRABLE)]
/// user_id: i32,
///
/// #[PostgresTable(UNIQUE(columns(email, tenant_id), deferrable))]
/// struct Users {
///     email: String,
///     tenant_id: i32,
/// }
/// # "####;
/// ```
///
/// See: <https://www.postgresql.org/docs/current/sql-createtable.html>
pub const DEFERRABLE: ColumnMarker = ColumnMarker;

/// Marks a foreign key or table-level UNIQUE constraint as DEFERRABLE INITIALLY DEFERRED.
///
/// ## Example
/// ```rust
/// # let _ = r####"
/// #[column(REFERENCES = Users::id, INITIALLY_DEFERRED)]
/// user_id: i32,
///
/// #[PostgresTable(UNIQUE(columns(email, tenant_id), initially_deferred))]
/// struct Users {
///     email: String,
///     tenant_id: i32,
/// }
/// # "####;
/// ```
///
/// See: <https://www.postgresql.org/docs/current/sql-createtable.html>
pub const INITIALLY_DEFERRED: ColumnMarker = ColumnMarker;

//------------------------------------------------------------------------------
// Referential Action Values
//------------------------------------------------------------------------------

/// Type alias for referential action markers (uses `ColumnMarker` for macro compatibility).
pub type ReferentialAction = ColumnMarker;

/// CASCADE action: Propagate the delete/update to referencing rows.
///
/// ## Example
/// ```rust
/// # let _ = r####"
/// #[column(REFERENCES = User::id, ON_DELETE = CASCADE)]
/// user_id: i32,
/// # "####;
/// ```
///
/// See: <https://www.postgresql.org/docs/current/ddl-constraints.html#DDL-CONSTRAINTS-FK>
pub const CASCADE: ColumnMarker = ColumnMarker;

/// SET NULL action: Set referencing columns to NULL.
///
/// ## Example
/// ```rust
/// # let _ = r####"
/// #[column(REFERENCES = User::id, ON_DELETE = SET_NULL)]
/// user_id: Option<i32>,
/// # "####;
/// ```
///
/// See: <https://www.postgresql.org/docs/current/ddl-constraints.html#DDL-CONSTRAINTS-FK>
pub const SET_NULL: ColumnMarker = ColumnMarker;

/// SET DEFAULT action: Set referencing columns to their default values.
///
/// ## Example
/// ```rust
/// # let _ = r####"
/// #[column(REFERENCES = User::id, ON_DELETE = SET_DEFAULT, DEFAULT = 0)]
/// user_id: i32,
/// # "####;
/// ```
///
/// See: <https://www.postgresql.org/docs/current/ddl-constraints.html#DDL-CONSTRAINTS-FK>
pub const SET_DEFAULT: ColumnMarker = ColumnMarker;

/// RESTRICT action: Prevent delete/update if referenced.
///
/// ## Example
/// ```rust
/// # let _ = r####"
/// #[column(REFERENCES = User::id, ON_DELETE = RESTRICT)]
/// user_id: i32,
/// # "####;
/// ```
///
/// See: <https://www.postgresql.org/docs/current/ddl-constraints.html#DDL-CONSTRAINTS-FK>
pub const RESTRICT: ColumnMarker = ColumnMarker;

/// NO ACTION action: Similar to RESTRICT (default behavior).
///
/// ## Example
/// ```rust
/// # let _ = r####"
/// #[column(REFERENCES = User::id, ON_DELETE = NO_ACTION)]
/// user_id: i32,
/// # "####;
/// ```
///
/// See: <https://www.postgresql.org/docs/current/ddl-constraints.html#DDL-CONSTRAINTS-FK>
pub const NO_ACTION: ColumnMarker = ColumnMarker;

/// Adds a CHECK constraint to a column or table.
///
/// ## Examples
/// ```rust
/// # let _ = r####"
/// #[column(CHECK = "age >= 0")]
/// age: i32,
///
/// #[PostgresTable(CHECK(name = "valid_score", expr = "score >= 0 AND score <= 100"))]
/// struct Scores {
///     score: i32,
/// }
/// # "####;
/// ```
///
/// See: <https://www.postgresql.org/docs/current/ddl-constraints.html#DDL-CONSTRAINTS-CHECK-CONSTRAINTS>
pub const CHECK: ColumnMarker = ColumnMarker;

//------------------------------------------------------------------------------
// Name Marker (shared by column and table attributes)
//------------------------------------------------------------------------------

/// Marker struct for the NAME attribute.
#[derive(Debug, Clone, Copy)]
pub struct NameMarker;

/// Specifies a custom name in the database.
///
/// By default, table, view, and column names are automatically converted to `snake_case`
/// from the Rust struct/field name. Use NAME to override this behavior.
///
/// ## Column Example
/// ```rust
/// # let _ = r####"
/// // Field `createdAt` becomes `created_at` by default
/// created_at: DateTime<Utc>,
///
/// // Override with custom name:
/// #[column(NAME = "creation_timestamp")]
/// created_at: DateTime<Utc>,
/// # "####;
/// ```
///
/// ## Table Example
/// ```rust
/// # let _ = r####"
/// // Struct `UserAccount` becomes table `user_account` by default
/// struct UserAccount { ... }
///
/// // Override with custom name:
/// #[PostgresTable(NAME = "user_accounts")]
/// struct UserAccount { ... }
/// # "####;
/// ```
///
/// ## View Example
/// ```rust
/// # let _ = r####"
/// #[PostgresView(NAME = "active_users")]
/// struct ActiveUsers { ... }
/// # "####;
/// ```
pub const NAME: NameMarker = NameMarker;

//------------------------------------------------------------------------------
// View Attribute Markers
//------------------------------------------------------------------------------

/// Marker struct for view attributes.
#[derive(Debug, Clone, Copy)]
pub struct ViewMarker;

/// Specifies a view definition SQL string or expression.
///
/// ## Examples
/// ```rust
/// # let _ = r####"
/// #[PostgresView(DEFINITION = "SELECT id, name FROM users")]
/// struct UserNames { id: i32, name: String }
/// # "####;
/// ```
///
/// ```rust
/// # let _ = r####"
/// #[PostgresView(
///     DEFINITION = {
///         let builder = drizzle::postgres::QueryBuilder::new::<Schema>();
///         let Schema { user } = Schema::new();
///         builder.select((user.id, user.name)).from(user)
///     }
/// )]
/// struct UserNames { id: i32, name: String }
/// # "####;
/// ```
pub const DEFINITION: ViewMarker = ViewMarker;

/// Specifies a table or view schema name.
///
/// ## Examples
/// ```rust
/// # let _ = r####"
/// #[PostgresView(SCHEMA = "auth")]
/// struct AuthUsers { ... }
///
/// #[PostgresTable(SCHEMA = "auth")]
/// struct AuthUsersTable { id: i32 }
/// # "####;
/// ```
pub const SCHEMA: ViewMarker = ViewMarker;

/// Marks the view as materialized.
///
/// ## Example
/// ```rust
/// # let _ = r####"
/// #[PostgresView(MATERIALIZED)]
/// struct ActiveUsers { ... }
/// # "####;
/// ```
pub const MATERIALIZED: ViewMarker = ViewMarker;

/// Sets WITH options for a view definition.
///
/// ## Example
/// ```rust
/// # let _ = r####"
/// #[PostgresView(WITH = ViewWithOptionDef::new().security_barrier())]
/// struct ActiveUsers { ... }
/// # "####;
/// ```
pub const WITH: ViewMarker = ViewMarker;

/// Alias for [`WITH`].
pub const WITH_OPTIONS: ViewMarker = ViewMarker;

/// Create a materialized view WITH NO DATA.
///
/// ## Example
/// ```rust
/// # let _ = r####"
/// #[PostgresView(MATERIALIZED, WITH_NO_DATA)]
/// struct ActiveUsers { ... }
/// # "####;
/// ```
pub const WITH_NO_DATA: ViewMarker = ViewMarker;

/// Specifies a USING clause for materialized views or row-level security policies.
///
/// ## Examples
/// ```rust
/// # let _ = r####"
/// #[PostgresView(USING = "heap")]
/// struct ActiveUsers { ... }
///
/// #[PostgresPolicy(USING = "tenant_id = current_setting('app.tenant_id')::int")]
/// struct TenantPolicy(Users);
/// # "####;
/// ```
pub const USING: ViewMarker = ViewMarker;

/// Marks the view as existing (skip creation).
///
/// ## Example
/// ```rust
/// # let _ = r####"
/// #[PostgresView(EXISTING)]
/// struct ExistingView { ... }
/// # "####;
/// ```
pub const EXISTING: ViewMarker = ViewMarker;

//------------------------------------------------------------------------------
// Table Attribute Markers
//------------------------------------------------------------------------------

/// Marker struct for table-level attributes.
#[derive(Debug, Clone, Copy)]
pub struct TableMarker;

/// Adds a table-level composite foreign key constraint.
///
/// ## Example
/// ```rust
/// # let _ = r####"
/// #[PostgresTable(FOREIGN_KEY(
///     columns(tenant_id, user_id),
///     references(Users, tenant_id, id),
///     on_delete = "CASCADE",
///     deferrable
/// ))]
/// struct Posts {
///     tenant_id: i32,
///     user_id: i32,
/// }
/// # "####;
/// ```
///
/// See: <https://www.postgresql.org/docs/current/ddl-constraints.html#DDL-CONSTRAINTS-FK>
pub const FOREIGN_KEY: TableMarker = TableMarker;

/// Creates an UNLOGGED table.
///
/// ## Example
/// ```rust
/// # mod drizzle {
/// #     pub mod core { pub use drizzle_core::*; }
/// #     pub mod error { pub use drizzle_core::error::*; }
/// #     pub mod types { pub use drizzle_types::*; }
/// #     pub mod migrations { pub use drizzle_migrations::*; }
/// #     pub use drizzle_types::Dialect;
/// #     pub use drizzle_types as ddl;
/// #     pub mod postgres {
/// #         pub mod values { pub use drizzle_postgres::values::*; }
/// #         pub mod traits { pub use drizzle_postgres::traits::*; }
/// #         pub mod common { pub use drizzle_postgres::common::*; }
/// #         pub mod attrs { pub use drizzle_postgres::attrs::*; }
/// #         pub mod builder { pub use drizzle_postgres::builder::*; }
/// #         pub mod helpers { pub use drizzle_postgres::helpers::*; }
/// #         pub mod expr { pub use drizzle_postgres::expr::*; }
/// #         pub mod types { pub use drizzle_postgres::types::*; }
/// #         pub struct Row;
/// #         impl Row {
/// #             pub fn get<'a, I, T>(&'a self, _: I) -> T { unimplemented!() }
/// #             pub fn try_get<'a, I, T>(&'a self, _: I) -> Result<T, Box<dyn std::error::Error + Sync + Send>> { unimplemented!() }
/// #         }
/// #         pub mod prelude {
/// #             pub use drizzle_macros::{PostgresTable, PostgresSchema, PostgresIndex};
/// #             pub use drizzle_postgres::attrs::*;
/// #             pub use drizzle_postgres::common::PostgresSchemaType;
/// #             pub use drizzle_postgres::traits::{PostgresColumn, PostgresTable};
/// #             pub use drizzle_postgres::values::{PostgresInsertValue, PostgresUpdateValue, PostgresValue};
/// #             pub use drizzle_core::*;
/// #         }
/// #     }
/// # }
/// use drizzle::postgres::prelude::*;
///
/// #[PostgresTable(UNLOGGED)]
/// struct SessionCache {
///     #[column(PRIMARY)]
///     key: String,
///     data: String,
/// }
/// ```
///
/// Unlogged tables are faster but data is not crash-safe.
///
/// See: <https://www.postgresql.org/docs/current/sql-createtable.html#SQL-CREATETABLE-UNLOGGED>
pub const UNLOGGED: TableMarker = TableMarker;

/// Creates a TEMPORARY table.
///
/// ## Example
/// ```rust
/// # mod drizzle {
/// #     pub mod core { pub use drizzle_core::*; }
/// #     pub mod error { pub use drizzle_core::error::*; }
/// #     pub mod types { pub use drizzle_types::*; }
/// #     pub mod migrations { pub use drizzle_migrations::*; }
/// #     pub use drizzle_types::Dialect;
/// #     pub use drizzle_types as ddl;
/// #     pub mod postgres {
/// #         pub mod values { pub use drizzle_postgres::values::*; }
/// #         pub mod traits { pub use drizzle_postgres::traits::*; }
/// #         pub mod common { pub use drizzle_postgres::common::*; }
/// #         pub mod attrs { pub use drizzle_postgres::attrs::*; }
/// #         pub mod builder { pub use drizzle_postgres::builder::*; }
/// #         pub mod helpers { pub use drizzle_postgres::helpers::*; }
/// #         pub mod expr { pub use drizzle_postgres::expr::*; }
/// #         pub mod types { pub use drizzle_postgres::types::*; }
/// #         pub struct Row;
/// #         impl Row {
/// #             pub fn get<'a, I, T>(&'a self, _: I) -> T { unimplemented!() }
/// #             pub fn try_get<'a, I, T>(&'a self, _: I) -> Result<T, Box<dyn std::error::Error + Sync + Send>> { unimplemented!() }
/// #         }
/// #         pub mod prelude {
/// #             pub use drizzle_macros::{PostgresTable, PostgresSchema, PostgresIndex};
/// #             pub use drizzle_postgres::attrs::*;
/// #             pub use drizzle_postgres::common::PostgresSchemaType;
/// #             pub use drizzle_postgres::traits::{PostgresColumn, PostgresTable};
/// #             pub use drizzle_postgres::values::{PostgresInsertValue, PostgresUpdateValue, PostgresValue};
/// #             pub use drizzle_core::*;
/// #         }
/// #     }
/// # }
/// use drizzle::postgres::prelude::*;
///
/// #[PostgresTable(TEMPORARY)]
/// struct TempData {
///     id: i32,
///     value: String,
/// }
/// ```
///
/// Temporary tables exist only for the current session.
///
/// See: <https://www.postgresql.org/docs/current/sql-createtable.html#SQL-CREATETABLE-TEMPORARY>
pub const TEMPORARY: TableMarker = TableMarker;

/// Specifies inheritance from a parent table.
///
/// ## Example
/// ```rust
/// # mod drizzle {
/// #     pub mod core { pub use drizzle_core::*; }
/// #     pub mod error { pub use drizzle_core::error::*; }
/// #     pub mod types { pub use drizzle_types::*; }
/// #     pub mod migrations { pub use drizzle_migrations::*; }
/// #     pub use drizzle_types::Dialect;
/// #     pub use drizzle_types as ddl;
/// #     pub mod postgres {
/// #         pub mod values { pub use drizzle_postgres::values::*; }
/// #         pub mod traits { pub use drizzle_postgres::traits::*; }
/// #         pub mod common { pub use drizzle_postgres::common::*; }
/// #         pub mod attrs { pub use drizzle_postgres::attrs::*; }
/// #         pub mod builder { pub use drizzle_postgres::builder::*; }
/// #         pub mod helpers { pub use drizzle_postgres::helpers::*; }
/// #         pub mod expr { pub use drizzle_postgres::expr::*; }
/// #         pub mod types { pub use drizzle_postgres::types::*; }
/// #         pub struct Row;
/// #         impl Row {
/// #             pub fn get<'a, I, T>(&'a self, _: I) -> T { unimplemented!() }
/// #             pub fn try_get<'a, I, T>(&'a self, _: I) -> Result<T, Box<dyn std::error::Error + Sync + Send>> { unimplemented!() }
/// #         }
/// #         pub mod prelude {
/// #             pub use drizzle_macros::{PostgresTable, PostgresSchema, PostgresIndex};
/// #             pub use drizzle_postgres::attrs::*;
/// #             pub use drizzle_postgres::common::PostgresSchemaType;
/// #             pub use drizzle_postgres::traits::{PostgresColumn, PostgresTable};
/// #             pub use drizzle_postgres::values::{PostgresInsertValue, PostgresUpdateValue, PostgresValue};
/// #             pub use drizzle_core::*;
/// #         }
/// #     }
/// # }
/// use drizzle::postgres::prelude::*;
///
/// #[PostgresTable(INHERITS = "base_table")]
/// struct ChildTable {
///     extra_field: String,
/// }
/// ```
///
/// See: <https://www.postgresql.org/docs/current/ddl-inherit.html>
pub const INHERITS: TableMarker = TableMarker;

/// Specifies a tablespace for the table.
///
/// ## Example
/// ```rust
/// # mod drizzle {
/// #     pub mod core { pub use drizzle_core::*; }
/// #     pub mod error { pub use drizzle_core::error::*; }
/// #     pub mod types { pub use drizzle_types::*; }
/// #     pub mod migrations { pub use drizzle_migrations::*; }
/// #     pub use drizzle_types::Dialect;
/// #     pub use drizzle_types as ddl;
/// #     pub mod postgres {
/// #         pub mod values { pub use drizzle_postgres::values::*; }
/// #         pub mod traits { pub use drizzle_postgres::traits::*; }
/// #         pub mod common { pub use drizzle_postgres::common::*; }
/// #         pub mod attrs { pub use drizzle_postgres::attrs::*; }
/// #         pub mod builder { pub use drizzle_postgres::builder::*; }
/// #         pub mod helpers { pub use drizzle_postgres::helpers::*; }
/// #         pub mod expr { pub use drizzle_postgres::expr::*; }
/// #         pub mod types { pub use drizzle_postgres::types::*; }
/// #         pub struct Row;
/// #         impl Row {
/// #             pub fn get<'a, I, T>(&'a self, _: I) -> T { unimplemented!() }
/// #             pub fn try_get<'a, I, T>(&'a self, _: I) -> Result<T, Box<dyn std::error::Error + Sync + Send>> { unimplemented!() }
/// #         }
/// #         pub mod prelude {
/// #             pub use drizzle_macros::{PostgresTable, PostgresSchema, PostgresIndex};
/// #             pub use drizzle_postgres::attrs::*;
/// #             pub use drizzle_postgres::common::PostgresSchemaType;
/// #             pub use drizzle_postgres::traits::{PostgresColumn, PostgresTable};
/// #             pub use drizzle_postgres::values::{PostgresInsertValue, PostgresUpdateValue, PostgresValue};
/// #             pub use drizzle_core::*;
/// #         }
/// #     }
/// # }
/// use drizzle::postgres::prelude::*;
///
/// #[PostgresTable(TABLESPACE = "fast_storage")]
/// struct HighPerfTable {
///     #[column(PRIMARY)]
///     id: i32,
/// }
///
/// // Views also support TABLESPACE:
/// // #[PostgresView(MATERIALIZED, TABLESPACE = "fast_storage")]
/// // struct ActiveUsers { id: i32 }
/// ```
///
/// See: <https://www.postgresql.org/docs/current/sql-createtable.html#SQL-CREATETABLE-TABLESPACE>
pub const TABLESPACE: TableMarker = TableMarker;

/// Enables row-level security for the table.
///
/// ## Example
/// ```rust
/// # let _ = r####"
/// #[PostgresTable(RLS)]
/// struct Users {
///     id: i32,
/// }
/// # "####;
/// ```
///
/// See: <https://www.postgresql.org/docs/current/ddl-rowsecurity.html>
pub const RLS: TableMarker = TableMarker;

//------------------------------------------------------------------------------
// Index Attribute Markers
//------------------------------------------------------------------------------

/// Marker struct for index attributes.
#[derive(Debug, Clone, Copy)]
pub struct IndexMarker;

/// Creates or drops an index CONCURRENTLY.
///
/// ## Example
/// ```rust
/// # let _ = r####"
/// #[PostgresIndex(concurrent)]
/// struct UsersEmailIdx(Users::email);
/// # "####;
/// ```
///
/// See: <https://www.postgresql.org/docs/current/sql-createindex.html>
pub const CONCURRENT: IndexMarker = IndexMarker;

/// Specifies the index access method.
///
/// ## Example
/// ```rust
/// # let _ = r####"
/// #[PostgresIndex(method = "gin")]
/// struct DocumentsSearchIdx(Documents::search_vector);
/// # "####;
/// ```
///
/// See: <https://www.postgresql.org/docs/current/indexes-types.html>
pub const METHOD: IndexMarker = IndexMarker;

/// Specifies a partial-index predicate.
///
/// ## Example
/// ```rust
/// # let _ = r####"
/// #[PostgresIndex(where = "deleted_at IS NULL")]
/// struct ActiveUsersEmailIdx(Users::email);
/// # "####;
/// ```
///
/// See: <https://www.postgresql.org/docs/current/indexes-partial.html>
pub const WHERE: IndexMarker = IndexMarker;

//------------------------------------------------------------------------------
// Policy Attribute Markers
//------------------------------------------------------------------------------

/// Marker struct for row-level security policy attributes.
#[derive(Debug, Clone, Copy)]
pub struct PolicyMarker;

/// Specifies whether a policy is PERMISSIVE or RESTRICTIVE.
///
/// ## Example
/// ```rust
/// # let _ = r####"
/// #[PostgresPolicy(AS = "RESTRICTIVE")]
/// struct TenantPolicy(Users);
/// # "####;
/// ```
///
/// See: <https://www.postgresql.org/docs/current/sql-createpolicy.html>
pub const AS: PolicyMarker = PolicyMarker;

/// Alias for [`AS`].
pub const AS_CLAUSE: PolicyMarker = PolicyMarker;

/// Specifies the command a policy applies to.
///
/// ## Example
/// ```rust
/// # let _ = r####"
/// #[PostgresPolicy(FOR = "SELECT")]
/// struct ReadPolicy(Users);
/// # "####;
/// ```
///
/// See: <https://www.postgresql.org/docs/current/sql-createpolicy.html>
pub const FOR: PolicyMarker = PolicyMarker;

/// Alias for [`FOR`].
pub const FOR_CLAUSE: PolicyMarker = PolicyMarker;

/// Specifies roles the policy applies to.
///
/// ## Example
/// ```rust
/// # let _ = r####"
/// #[PostgresPolicy(TO("app_user", public))]
/// struct TenantPolicy(Users);
/// # "####;
/// ```
///
/// See: <https://www.postgresql.org/docs/current/sql-createpolicy.html>
pub const TO: PolicyMarker = PolicyMarker;

/// Specifies a WITH CHECK expression for INSERT/UPDATE policies.
///
/// ## Example
/// ```rust
/// # let _ = r####"
/// #[PostgresPolicy(WITH_CHECK = "tenant_id = current_setting('app.tenant_id')::int")]
/// struct TenantWritePolicy(Users);
/// # "####;
/// ```
///
/// See: <https://www.postgresql.org/docs/current/sql-createpolicy.html>
pub const WITH_CHECK: PolicyMarker = PolicyMarker;

//------------------------------------------------------------------------------
// Column Type Markers
//------------------------------------------------------------------------------

/// Marker struct for column type attributes.
#[derive(Debug, Clone, Copy)]
pub struct TypeMarker;

//--- Character Types ---

/// Specifies a TEXT column type.
///
/// TEXT stores variable-length character strings with no length limit.
///
/// See: <https://www.postgresql.org/docs/current/datatype-character.html>
pub const TEXT: TypeMarker = TypeMarker;

/// Specifies a VARCHAR column type.
///
/// VARCHAR stores variable-length character strings.
/// In `PostgreSQL`, VARCHAR without length limit is equivalent to TEXT.
///
/// See: <https://www.postgresql.org/docs/current/datatype-character.html>
pub const VARCHAR: TypeMarker = TypeMarker;

/// Alias for VARCHAR.
pub const CHARACTER_VARYING: TypeMarker = TypeMarker;

/// Specifies a CHAR column type.
///
/// CHAR stores fixed-length character strings.
///
/// See: <https://www.postgresql.org/docs/current/datatype-character.html>
pub const CHAR: TypeMarker = TypeMarker;

/// Alias for CHAR.
pub const CHARACTER: TypeMarker = TypeMarker;

//--- Integer Types ---

/// Specifies an INTEGER column type (32-bit).
///
/// INTEGER (or INT4) stores 32-bit signed integers.
///
/// See: <https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-INT>
pub const INTEGER: TypeMarker = TypeMarker;

/// Alias for INTEGER.
pub const INT: TypeMarker = TypeMarker;

/// Alias for INTEGER.
pub const INT4: TypeMarker = TypeMarker;

/// Specifies a BIGINT column type (64-bit).
///
/// BIGINT (or INT8) stores 64-bit signed integers.
///
/// See: <https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-INT>
pub const BIGINT: TypeMarker = TypeMarker;

/// Alias for BIGINT.
pub const INT8: TypeMarker = TypeMarker;

/// Specifies a SMALLINT column type (16-bit).
///
/// SMALLINT (or INT2) stores 16-bit signed integers.
///
/// See: <https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-INT>
pub const SMALLINT: TypeMarker = TypeMarker;

/// Alias for SMALLINT.
pub const INT2: TypeMarker = TypeMarker;

//--- Floating Point Types ---

/// Specifies a REAL column type (32-bit float).
///
/// REAL (or FLOAT4) stores 32-bit floating point numbers.
///
/// See: <https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-FLOAT>
pub const REAL: TypeMarker = TypeMarker;

/// Alias for REAL.
pub const FLOAT4: TypeMarker = TypeMarker;

/// Specifies a DOUBLE PRECISION column type (64-bit float).
///
/// DOUBLE PRECISION (or FLOAT8) stores 64-bit floating point numbers.
///
/// See: <https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-FLOAT>
pub const DOUBLE_PRECISION: TypeMarker = TypeMarker;

/// Alias for DOUBLE PRECISION.
pub const FLOAT8: TypeMarker = TypeMarker;

/// Alias for DOUBLE PRECISION.
pub const DOUBLE: TypeMarker = TypeMarker;

/// Specifies a NUMERIC column type (arbitrary precision).
///
/// NUMERIC stores exact numbers with arbitrary precision.
///
/// See: <https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-NUMERIC-DECIMAL>
pub const NUMERIC: TypeMarker = TypeMarker;

/// Alias for NUMERIC.
pub const DECIMAL: TypeMarker = TypeMarker;

//--- Boolean Type ---

/// Specifies a BOOLEAN column type.
///
/// BOOLEAN stores true/false values.
///
/// See: <https://www.postgresql.org/docs/current/datatype-boolean.html>
pub const BOOLEAN: TypeMarker = TypeMarker;

/// Alias for BOOLEAN.
pub const BOOL: TypeMarker = TypeMarker;

//--- Binary Type ---

/// Specifies a BYTEA column type (binary data).
///
/// BYTEA stores variable-length binary strings.
///
/// See: <https://www.postgresql.org/docs/current/datatype-binary.html>
pub const BYTEA: TypeMarker = TypeMarker;

//--- UUID Type ---

/// Specifies a UUID column type.
///
/// UUID stores universally unique identifiers.
/// Requires the `uuid` feature.
///
/// See: <https://www.postgresql.org/docs/current/datatype-uuid.html>
pub const UUID: TypeMarker = TypeMarker;

//--- Date/Time Types ---

/// Specifies a TIMESTAMP column type (without timezone).
///
/// TIMESTAMP stores date and time without timezone.
///
/// See: <https://www.postgresql.org/docs/current/datatype-datetime.html>
pub const TIMESTAMP: TypeMarker = TypeMarker;

/// Alias for TIMESTAMP.
pub const TIMESTAMP_WITHOUT_TIME_ZONE: TypeMarker = TypeMarker;

/// Specifies a TIMESTAMPTZ column type (with timezone).
///
/// TIMESTAMPTZ stores date and time with timezone.
///
/// See: <https://www.postgresql.org/docs/current/datatype-datetime.html>
pub const TIMESTAMPTZ: TypeMarker = TypeMarker;

/// Alias for TIMESTAMPTZ.
pub const TIMESTAMP_WITH_TIME_ZONE: TypeMarker = TypeMarker;

/// Specifies a DATE column type.
///
/// DATE stores calendar dates without time.
///
/// See: <https://www.postgresql.org/docs/current/datatype-datetime.html>
pub const DATE: TypeMarker = TypeMarker;

/// Specifies a TIME column type (without timezone).
///
/// TIME stores time of day without date or timezone.
///
/// See: <https://www.postgresql.org/docs/current/datatype-datetime.html>
pub const TIME: TypeMarker = TypeMarker;

/// Alias for TIME.
pub const TIME_WITHOUT_TIME_ZONE: TypeMarker = TypeMarker;

/// Specifies a TIMETZ column type (with timezone).
///
/// TIMETZ stores time of day with timezone.
///
/// See: <https://www.postgresql.org/docs/current/datatype-datetime.html>
pub const TIMETZ: TypeMarker = TypeMarker;

/// Alias for TIMETZ.
pub const TIME_WITH_TIME_ZONE: TypeMarker = TypeMarker;

/// Specifies an INTERVAL column type.
///
/// INTERVAL stores time intervals.
/// Requires the `chrono` feature.
///
/// See: <https://www.postgresql.org/docs/current/datatype-datetime.html>
pub const INTERVAL: TypeMarker = TypeMarker;

//--- Network Address Types ---

/// Specifies an INET column type.
///
/// INET stores IPv4 or IPv6 host addresses.
/// Requires the `cidr` feature.
///
/// See: <https://www.postgresql.org/docs/current/datatype-net-types.html>
pub const INET: TypeMarker = TypeMarker;

/// Specifies a CIDR column type.
///
/// CIDR stores IPv4 or IPv6 network addresses.
/// Requires the `cidr` feature.
///
/// See: <https://www.postgresql.org/docs/current/datatype-net-types.html>
pub const CIDR: TypeMarker = TypeMarker;

/// Specifies a MACADDR column type.
///
/// MACADDR stores MAC addresses.
/// Requires the `cidr` feature.
///
/// See: <https://www.postgresql.org/docs/current/datatype-net-types.html>
pub const MACADDR: TypeMarker = TypeMarker;

/// Specifies a MACADDR8 column type.
///
/// MACADDR8 stores EUI-64 MAC addresses.
/// Requires the `cidr` feature.
///
/// See: <https://www.postgresql.org/docs/current/datatype-net-types.html>
pub const MACADDR8: TypeMarker = TypeMarker;

//--- Geometric Types ---

/// Specifies a POINT column type.
///
/// POINT stores geometric points.
/// Requires the `geo-types` feature.
///
/// See: <https://www.postgresql.org/docs/current/datatype-geometric.html>
pub const POINT: TypeMarker = TypeMarker;

/// Specifies a LINE column type.
///
/// LINE stores infinite geometric lines.
/// Requires the `geo-types` feature.
///
/// See: <https://www.postgresql.org/docs/current/datatype-geometric.html>
pub const LINE: TypeMarker = TypeMarker;

/// Specifies a LSEG column type.
///
/// LSEG stores geometric line segments.
/// Requires the `geo-types` feature.
///
/// See: <https://www.postgresql.org/docs/current/datatype-geometric.html>
pub const LSEG: TypeMarker = TypeMarker;

/// Specifies a BOX column type.
///
/// BOX stores geometric boxes.
/// Requires the `geo-types` feature.
///
/// See: <https://www.postgresql.org/docs/current/datatype-geometric.html>
pub const BOX: TypeMarker = TypeMarker;

/// Specifies a PATH column type.
///
/// PATH stores geometric paths.
/// Requires the `geo-types` feature.
///
/// See: <https://www.postgresql.org/docs/current/datatype-geometric.html>
pub const PATH: TypeMarker = TypeMarker;

/// Specifies a POLYGON column type.
///
/// POLYGON stores geometric polygons.
/// Requires the `geo-types` feature.
///
/// See: <https://www.postgresql.org/docs/current/datatype-geometric.html>
pub const POLYGON: TypeMarker = TypeMarker;

/// Specifies a CIRCLE column type.
///
/// CIRCLE stores geometric circles.
/// Requires the `geo-types` feature.
///
/// See: <https://www.postgresql.org/docs/current/datatype-geometric.html>
pub const CIRCLE: TypeMarker = TypeMarker;

//--- Bit String Types ---

/// Specifies a BIT column type.
///
/// BIT stores fixed-length bit strings.
/// Requires the `bit-vec` feature.
///
/// See: <https://www.postgresql.org/docs/current/datatype-bit.html>
pub const BIT: TypeMarker = TypeMarker;

/// Specifies a VARBIT column type.
///
/// VARBIT (BIT VARYING) stores variable-length bit strings.
/// Requires the `bit-vec` feature.
///
/// See: <https://www.postgresql.org/docs/current/datatype-bit.html>
pub const VARBIT: TypeMarker = TypeMarker;

/// Alias for VARBIT.
pub const BIT_VARYING: TypeMarker = TypeMarker;