drizzle_postgres/
attrs.rs

1//! Attribute markers for PostgresTable derive macro.
2//!
3//! These const markers are used within `#[column(...)]` and `#[PostgresTable(...)]`
4//! attributes. Import them from the prelude to get IDE hover documentation.
5//!
6//! # Example
7//! ```ignore
8//! # use drizzle::postgres::prelude::*;
9//!
10//! #[PostgresTable(NAME = "users")]
11//! struct User {
12//!     #[column(PRIMARY, SERIAL)]
13//!     id: i32,
14//!     #[column(UNIQUE)]
15//!     email: String,
16//!     metadata: String,
17//! }
18//! ```
19
20/// Marker struct for column constraint attributes.
21#[derive(Debug, Clone, Copy)]
22pub struct ColumnMarker;
23
24//------------------------------------------------------------------------------
25// Primary Key Constraints
26//------------------------------------------------------------------------------
27
28/// Marks this column as the PRIMARY KEY.
29///
30/// ## Example
31/// ```ignore
32/// #[column(PRIMARY)]
33/// id: i32,
34/// ```
35///
36/// See: <https://www.postgresql.org/docs/current/ddl-constraints.html#DDL-CONSTRAINTS-PRIMARY-KEYS>
37pub const PRIMARY: ColumnMarker = ColumnMarker;
38
39/// Alias for [`PRIMARY`].
40pub const PRIMARY_KEY: ColumnMarker = ColumnMarker;
41
42//------------------------------------------------------------------------------
43// Auto-increment Types
44//------------------------------------------------------------------------------
45
46/// Creates a SERIAL column (auto-incrementing 32-bit integer).
47///
48/// ## Example
49/// ```ignore
50/// #[column(PRIMARY, SERIAL)]
51/// id: i32,
52/// ```
53///
54/// See: <https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-SERIAL>
55pub const SERIAL: ColumnMarker = ColumnMarker;
56
57/// Creates a BIGSERIAL column (auto-incrementing 64-bit integer).
58///
59/// ## Example
60/// ```ignore
61/// #[column(PRIMARY, BIGSERIAL)]
62/// id: i64,
63/// ```
64///
65/// See: <https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-SERIAL>
66pub const BIGSERIAL: ColumnMarker = ColumnMarker;
67
68/// Creates a SMALLSERIAL column (auto-incrementing 16-bit integer).
69///
70/// ## Example
71/// ```ignore
72/// #[column(PRIMARY, SMALLSERIAL)]
73/// id: i16,
74/// ```
75///
76/// See: <https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-SERIAL>
77pub const SMALLSERIAL: ColumnMarker = ColumnMarker;
78
79//------------------------------------------------------------------------------
80// Uniqueness Constraints
81//------------------------------------------------------------------------------
82
83/// Adds a UNIQUE constraint to this column.
84///
85/// ## Example
86/// ```ignore
87/// #[column(UNIQUE)]
88/// email: String,
89/// ```
90///
91/// See: <https://www.postgresql.org/docs/current/ddl-constraints.html#DDL-CONSTRAINTS-UNIQUE-CONSTRAINTS>
92pub const UNIQUE: ColumnMarker = ColumnMarker;
93
94//------------------------------------------------------------------------------
95// Identity Columns
96//------------------------------------------------------------------------------
97
98/// Creates a GENERATED IDENTITY column with configurable mode.
99///
100/// ## Syntax
101/// - `identity(always)` - User values rejected unless OVERRIDING SYSTEM VALUE
102/// - `identity(by_default)` - User values take precedence
103///
104/// ## Example
105/// ```ignore
106/// // GENERATED ALWAYS AS IDENTITY - strictest mode
107/// #[column(identity(always), primary)]
108/// id: i64,
109///
110/// // GENERATED BY DEFAULT AS IDENTITY - allows override
111/// #[column(identity(by_default), primary)]
112/// id: i64,
113/// ```
114///
115/// ## Technical Details
116/// PostgreSQL's identity columns are SQL-standard compliant, unlike SERIAL.
117/// Use ALWAYS for auto-generated IDs, BY DEFAULT when you need to occasionally set values.
118///
119/// See: <https://www.postgresql.org/docs/current/ddl-identity-columns.html>
120pub const IDENTITY: ColumnMarker = ColumnMarker;
121
122/// Marks a column as a GENERATED AS (expression) column.
123///
124/// ## Syntax
125/// - `generated(stored, "expression")` - Computed on write, stored on disk
126/// - `generated(virtual, "expression")` - Computed on read, not stored (PostgreSQL 17+)
127///
128/// ## Example
129/// ```ignore
130/// #[column(generated(stored, "price * quantity"))]
131/// total: i32,
132///
133/// #[column(generated(virtual, "first_name || ' ' || last_name"))]
134/// full_name: String,
135/// ```
136///
137/// ## Technical Details
138/// Generated columns cannot be written to directly.
139/// STORED columns are computed and stored on write.
140/// VIRTUAL columns are computed on read (PostgreSQL 17+).
141///
142/// See: <https://www.postgresql.org/docs/current/ddl-generated-columns.html>
143pub const GENERATED: ColumnMarker = ColumnMarker;
144
145//------------------------------------------------------------------------------
146// Serialization Modes
147//------------------------------------------------------------------------------
148
149/// Enables JSON serialization with JSON type storage.
150///
151/// ## Example
152/// ```ignore
153/// #[column(JSON)]
154/// metadata: UserMetadata,
155/// ```
156///
157/// Requires the `serde` feature. The field type must implement `Serialize` and `Deserialize`.
158///
159/// See: <https://www.postgresql.org/docs/current/datatype-json.html>
160pub const JSON: ColumnMarker = ColumnMarker;
161
162/// Enables JSON serialization with JSONB storage.
163///
164/// ## Example
165/// ```ignore
166/// #[column(JSONB)]
167/// config: AppConfig,
168/// ```
169///
170/// JSONB is the recommended JSON storage format for most use cases.
171/// It supports indexing and efficient querying.
172///
173/// Requires the `serde` feature. The field type must implement `Serialize` and `Deserialize`.
174///
175/// See: <https://www.postgresql.org/docs/current/datatype-json.html>
176pub const JSONB: ColumnMarker = ColumnMarker;
177
178/// Marks this column as storing an enum type.
179///
180/// ## Example
181/// ```ignore
182/// #[column(ENUM)]
183/// role: Role,
184/// ```
185///
186/// For PostgreSQL native ENUM types or text-based enum storage.
187///
188/// See: <https://www.postgresql.org/docs/current/datatype-enum.html>
189pub const ENUM: ColumnMarker = ColumnMarker;
190
191//------------------------------------------------------------------------------
192// Default Value Parameters
193//------------------------------------------------------------------------------
194
195/// Specifies a function to generate default values at runtime.
196///
197/// The function is called for each insert when no value is provided.
198///
199/// ## Example
200/// ```ignore
201/// #[column(DEFAULT_FN = Uuid::new_v4)]
202/// id: Uuid,
203/// ```
204///
205/// ## Difference from DEFAULT
206/// - `DEFAULT_FN`: Calls the function at runtime for each insert (e.g., UUID generation)
207/// - `DEFAULT`: Uses a fixed compile-time value
208pub const DEFAULT_FN: ColumnMarker = ColumnMarker;
209
210/// Specifies a fixed default value for new rows.
211///
212/// ## Example
213/// ```ignore
214/// #[column(DEFAULT = 0)]
215/// count: i32,
216///
217/// #[column(DEFAULT = "guest")]
218/// role: String,
219/// ```
220///
221/// For runtime-generated values (UUIDs, timestamps), use [`DEFAULT_FN`] instead.
222///
223/// See: <https://www.postgresql.org/docs/current/ddl-default.html>
224pub const DEFAULT: ColumnMarker = ColumnMarker;
225
226/// Establishes a foreign key reference to another table's column.
227///
228/// ## Example
229/// ```ignore
230/// #[column(REFERENCES = User::id)]
231/// user_id: i32,
232/// ```
233///
234/// See: <https://www.postgresql.org/docs/current/ddl-constraints.html#DDL-CONSTRAINTS-FK>
235pub const REFERENCES: ColumnMarker = ColumnMarker;
236
237/// Specifies the ON DELETE action for foreign key references.
238///
239/// ## Example
240/// ```ignore
241/// #[column(REFERENCES = User::id, ON_DELETE = CASCADE)]
242/// user_id: i32,
243/// ```
244///
245/// ## Supported Actions
246/// - `CASCADE`: Delete rows that reference the deleted row
247/// - `SET_NULL`: Set the column to NULL when referenced row is deleted
248/// - `SET_DEFAULT`: Set the column to its default value
249/// - `RESTRICT`: Prevent deletion if referenced
250/// - `NO_ACTION`: Similar to RESTRICT (default)
251///
252/// See: <https://www.postgresql.org/docs/current/ddl-constraints.html#DDL-CONSTRAINTS-FK>
253pub const ON_DELETE: ColumnMarker = ColumnMarker;
254
255/// Specifies the ON UPDATE action for foreign key references.
256///
257/// ## Example
258/// ```ignore
259/// #[column(REFERENCES = User::id, ON_UPDATE = CASCADE)]
260/// user_id: i32,
261/// ```
262///
263/// ## Supported Actions
264/// - `CASCADE`: Update referencing rows when referenced row is updated
265/// - `SET_NULL`: Set the column to NULL when referenced row is updated
266/// - `SET_DEFAULT`: Set the column to its default value
267/// - `RESTRICT`: Prevent update if referenced
268/// - `NO_ACTION`: Similar to RESTRICT (default)
269///
270/// See: <https://www.postgresql.org/docs/current/ddl-constraints.html#DDL-CONSTRAINTS-FK>
271pub const ON_UPDATE: ColumnMarker = ColumnMarker;
272
273//------------------------------------------------------------------------------
274// Referential Action Values
275//------------------------------------------------------------------------------
276
277/// Type alias for referential action markers (uses ColumnMarker for macro compatibility).
278pub type ReferentialAction = ColumnMarker;
279
280/// CASCADE action: Propagate the delete/update to referencing rows.
281///
282/// ## Example
283/// ```ignore
284/// #[column(REFERENCES = User::id, ON_DELETE = CASCADE)]
285/// user_id: i32,
286/// ```
287///
288/// See: <https://www.postgresql.org/docs/current/ddl-constraints.html#DDL-CONSTRAINTS-FK>
289pub const CASCADE: ColumnMarker = ColumnMarker;
290
291/// SET NULL action: Set referencing columns to NULL.
292///
293/// ## Example
294/// ```ignore
295/// #[column(REFERENCES = User::id, ON_DELETE = SET_NULL)]
296/// user_id: Option<i32>,
297/// ```
298///
299/// See: <https://www.postgresql.org/docs/current/ddl-constraints.html#DDL-CONSTRAINTS-FK>
300pub const SET_NULL: ColumnMarker = ColumnMarker;
301
302/// SET DEFAULT action: Set referencing columns to their default values.
303///
304/// ## Example
305/// ```ignore
306/// #[column(REFERENCES = User::id, ON_DELETE = SET_DEFAULT, DEFAULT = 0)]
307/// user_id: i32,
308/// ```
309///
310/// See: <https://www.postgresql.org/docs/current/ddl-constraints.html#DDL-CONSTRAINTS-FK>
311pub const SET_DEFAULT: ColumnMarker = ColumnMarker;
312
313/// RESTRICT action: Prevent delete/update if referenced.
314///
315/// ## Example
316/// ```ignore
317/// #[column(REFERENCES = User::id, ON_DELETE = RESTRICT)]
318/// user_id: i32,
319/// ```
320///
321/// See: <https://www.postgresql.org/docs/current/ddl-constraints.html#DDL-CONSTRAINTS-FK>
322pub const RESTRICT: ColumnMarker = ColumnMarker;
323
324/// NO ACTION action: Similar to RESTRICT (default behavior).
325///
326/// ## Example
327/// ```ignore
328/// #[column(REFERENCES = User::id, ON_DELETE = NO_ACTION)]
329/// user_id: i32,
330/// ```
331///
332/// See: <https://www.postgresql.org/docs/current/ddl-constraints.html#DDL-CONSTRAINTS-FK>
333pub const NO_ACTION: ColumnMarker = ColumnMarker;
334
335/// Adds a CHECK constraint to this column.
336///
337/// ## Example
338/// ```ignore
339/// #[column(CHECK = "age >= 0")]
340/// age: i32,
341/// ```
342///
343/// See: <https://www.postgresql.org/docs/current/ddl-constraints.html#DDL-CONSTRAINTS-CHECK-CONSTRAINTS>
344pub const CHECK: ColumnMarker = ColumnMarker;
345
346//------------------------------------------------------------------------------
347// Name Marker (shared by column and table attributes)
348//------------------------------------------------------------------------------
349
350/// Marker struct for the NAME attribute.
351#[derive(Debug, Clone, Copy)]
352pub struct NameMarker;
353
354/// Specifies a custom name in the database.
355///
356/// By default, table, view, and column names are automatically converted to snake_case
357/// from the Rust struct/field name. Use NAME to override this behavior.
358///
359/// ## Column Example
360/// ```ignore
361/// // Field `createdAt` becomes `created_at` by default
362/// created_at: DateTime<Utc>,
363///
364/// // Override with custom name:
365/// #[column(NAME = "creation_timestamp")]
366/// created_at: DateTime<Utc>,
367/// ```
368///
369/// ## Table Example
370/// ```ignore
371/// // Struct `UserAccount` becomes table `user_account` by default
372/// struct UserAccount { ... }
373///
374/// // Override with custom name:
375/// #[PostgresTable(NAME = "user_accounts")]
376/// struct UserAccount { ... }
377/// ```
378///
379/// ## View Example
380/// ```ignore
381/// #[PostgresView(NAME = "active_users")]
382/// struct ActiveUsers { ... }
383/// ```
384pub const NAME: NameMarker = NameMarker;
385
386//------------------------------------------------------------------------------
387// View Attribute Markers
388//------------------------------------------------------------------------------
389
390/// Marker struct for view attributes.
391#[derive(Debug, Clone, Copy)]
392pub struct ViewMarker;
393
394/// Specifies a view definition SQL string or expression.
395///
396/// ## Examples
397/// ```ignore
398/// #[PostgresView(DEFINITION = "SELECT id, name FROM users")]
399/// struct UserNames { id: i32, name: String }
400/// ```
401///
402/// ```ignore
403/// #[PostgresView(
404///     DEFINITION = {
405///         let builder = drizzle::postgres::QueryBuilder::new::<Schema>();
406///         let Schema { user } = Schema::new();
407///         builder.select((user.id, user.name)).from(user)
408///     }
409/// )]
410/// struct UserNames { id: i32, name: String }
411/// ```
412pub const DEFINITION: ViewMarker = ViewMarker;
413
414/// Specifies a view schema name.
415///
416/// ## Example
417/// ```ignore
418/// #[PostgresView(SCHEMA = "auth")]
419/// struct AuthUsers { ... }
420/// ```
421pub const SCHEMA: ViewMarker = ViewMarker;
422
423/// Marks the view as materialized.
424///
425/// ## Example
426/// ```ignore
427/// #[PostgresView(MATERIALIZED)]
428/// struct ActiveUsers { ... }
429/// ```
430pub const MATERIALIZED: ViewMarker = ViewMarker;
431
432/// Sets WITH options for a view definition.
433///
434/// ## Example
435/// ```ignore
436/// #[PostgresView(WITH = ViewWithOptionDef::new().security_barrier())]
437/// struct ActiveUsers { ... }
438/// ```
439pub const WITH: ViewMarker = ViewMarker;
440
441/// Alias for [`WITH`].
442pub const WITH_OPTIONS: ViewMarker = ViewMarker;
443
444/// Create a materialized view WITH NO DATA.
445///
446/// ## Example
447/// ```ignore
448/// #[PostgresView(MATERIALIZED, WITH_NO_DATA)]
449/// struct ActiveUsers { ... }
450/// ```
451pub const WITH_NO_DATA: ViewMarker = ViewMarker;
452
453/// Specifies a USING clause for materialized views.
454///
455/// ## Example
456/// ```ignore
457/// #[PostgresView(USING = "heap")]
458/// struct ActiveUsers { ... }
459/// ```
460pub const USING: ViewMarker = ViewMarker;
461
462/// Marks the view as existing (skip creation).
463///
464/// ## Example
465/// ```ignore
466/// #[PostgresView(EXISTING)]
467/// struct ExistingView { ... }
468/// ```
469pub const EXISTING: ViewMarker = ViewMarker;
470
471//------------------------------------------------------------------------------
472// Table Attribute Markers
473//------------------------------------------------------------------------------
474
475/// Marker struct for table-level attributes.
476#[derive(Debug, Clone, Copy)]
477pub struct TableMarker;
478
479/// Creates an UNLOGGED table.
480///
481/// ## Example
482/// ```ignore
483/// # use drizzle::postgres::prelude::*;
484///
485/// #[PostgresTable(UNLOGGED)]
486/// struct SessionCache {
487///     #[column(PRIMARY)]
488///     key: String,
489///     data: String,
490/// }
491/// ```
492///
493/// Unlogged tables are faster but data is not crash-safe.
494///
495/// See: <https://www.postgresql.org/docs/current/sql-createtable.html#SQL-CREATETABLE-UNLOGGED>
496pub const UNLOGGED: TableMarker = TableMarker;
497
498/// Creates a TEMPORARY table.
499///
500/// ## Example
501/// ```ignore
502/// # use drizzle::postgres::prelude::*;
503///
504/// #[PostgresTable(TEMPORARY)]
505/// struct TempData {
506///     id: i32,
507///     value: String,
508/// }
509/// ```
510///
511/// Temporary tables exist only for the current session.
512///
513/// See: <https://www.postgresql.org/docs/current/sql-createtable.html#SQL-CREATETABLE-TEMPORARY>
514pub const TEMPORARY: TableMarker = TableMarker;
515
516/// Specifies inheritance from a parent table.
517///
518/// ## Example
519/// ```ignore
520/// # use drizzle::postgres::prelude::*;
521///
522/// #[PostgresTable(INHERITS = "base_table")]
523/// struct ChildTable {
524///     extra_field: String,
525/// }
526/// ```
527///
528/// See: <https://www.postgresql.org/docs/current/ddl-inherit.html>
529pub const INHERITS: TableMarker = TableMarker;
530
531/// Specifies a tablespace for the table.
532///
533/// ## Example
534/// ```ignore
535/// # use drizzle::postgres::prelude::*;
536///
537/// #[PostgresTable(TABLESPACE = "fast_storage")]
538/// struct HighPerfTable {
539///     #[column(PRIMARY)]
540///     id: i32,
541/// }
542///
543/// #[PostgresView(MATERIALIZED, TABLESPACE = "fast_storage")]
544/// struct ActiveUsers { id: i32 }
545/// ```
546///
547/// See: <https://www.postgresql.org/docs/current/sql-createtable.html#SQL-CREATETABLE-TABLESPACE>
548pub const TABLESPACE: TableMarker = TableMarker;
549
550//------------------------------------------------------------------------------
551// Column Type Markers
552//------------------------------------------------------------------------------
553
554/// Marker struct for column type attributes.
555#[derive(Debug, Clone, Copy)]
556pub struct TypeMarker;
557
558//--- Character Types ---
559
560/// Specifies a TEXT column type.
561///
562/// TEXT stores variable-length character strings with no length limit.
563///
564/// See: <https://www.postgresql.org/docs/current/datatype-character.html>
565pub const TEXT: TypeMarker = TypeMarker;
566
567/// Specifies a VARCHAR column type.
568///
569/// VARCHAR stores variable-length character strings.
570/// In PostgreSQL, VARCHAR without length limit is equivalent to TEXT.
571///
572/// See: <https://www.postgresql.org/docs/current/datatype-character.html>
573pub const VARCHAR: TypeMarker = TypeMarker;
574
575/// Alias for VARCHAR.
576pub const CHARACTER_VARYING: TypeMarker = TypeMarker;
577
578/// Specifies a CHAR column type.
579///
580/// CHAR stores fixed-length character strings.
581///
582/// See: <https://www.postgresql.org/docs/current/datatype-character.html>
583pub const CHAR: TypeMarker = TypeMarker;
584
585/// Alias for CHAR.
586pub const CHARACTER: TypeMarker = TypeMarker;
587
588//--- Integer Types ---
589
590/// Specifies an INTEGER column type (32-bit).
591///
592/// INTEGER (or INT4) stores 32-bit signed integers.
593///
594/// See: <https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-INT>
595pub const INTEGER: TypeMarker = TypeMarker;
596
597/// Alias for INTEGER.
598pub const INT: TypeMarker = TypeMarker;
599
600/// Alias for INTEGER.
601pub const INT4: TypeMarker = TypeMarker;
602
603/// Specifies a BIGINT column type (64-bit).
604///
605/// BIGINT (or INT8) stores 64-bit signed integers.
606///
607/// See: <https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-INT>
608pub const BIGINT: TypeMarker = TypeMarker;
609
610/// Alias for BIGINT.
611pub const INT8: TypeMarker = TypeMarker;
612
613/// Specifies a SMALLINT column type (16-bit).
614///
615/// SMALLINT (or INT2) stores 16-bit signed integers.
616///
617/// See: <https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-INT>
618pub const SMALLINT: TypeMarker = TypeMarker;
619
620/// Alias for SMALLINT.
621pub const INT2: TypeMarker = TypeMarker;
622
623//--- Floating Point Types ---
624
625/// Specifies a REAL column type (32-bit float).
626///
627/// REAL (or FLOAT4) stores 32-bit floating point numbers.
628///
629/// See: <https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-FLOAT>
630pub const REAL: TypeMarker = TypeMarker;
631
632/// Alias for REAL.
633pub const FLOAT4: TypeMarker = TypeMarker;
634
635/// Specifies a DOUBLE PRECISION column type (64-bit float).
636///
637/// DOUBLE PRECISION (or FLOAT8) stores 64-bit floating point numbers.
638///
639/// See: <https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-FLOAT>
640pub const DOUBLE_PRECISION: TypeMarker = TypeMarker;
641
642/// Alias for DOUBLE PRECISION.
643pub const FLOAT8: TypeMarker = TypeMarker;
644
645/// Alias for DOUBLE PRECISION.
646pub const DOUBLE: TypeMarker = TypeMarker;
647
648/// Specifies a NUMERIC column type (arbitrary precision).
649///
650/// NUMERIC stores exact numbers with arbitrary precision.
651///
652/// See: <https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-NUMERIC-DECIMAL>
653pub const NUMERIC: TypeMarker = TypeMarker;
654
655/// Alias for NUMERIC.
656pub const DECIMAL: TypeMarker = TypeMarker;
657
658//--- Boolean Type ---
659
660/// Specifies a BOOLEAN column type.
661///
662/// BOOLEAN stores true/false values.
663///
664/// See: <https://www.postgresql.org/docs/current/datatype-boolean.html>
665pub const BOOLEAN: TypeMarker = TypeMarker;
666
667/// Alias for BOOLEAN.
668pub const BOOL: TypeMarker = TypeMarker;
669
670//--- Binary Type ---
671
672/// Specifies a BYTEA column type (binary data).
673///
674/// BYTEA stores variable-length binary strings.
675///
676/// See: <https://www.postgresql.org/docs/current/datatype-binary.html>
677pub const BYTEA: TypeMarker = TypeMarker;
678
679//--- UUID Type ---
680
681/// Specifies a UUID column type.
682///
683/// UUID stores universally unique identifiers.
684/// Requires the `uuid` feature.
685///
686/// See: <https://www.postgresql.org/docs/current/datatype-uuid.html>
687pub const UUID: TypeMarker = TypeMarker;
688
689//--- Date/Time Types ---
690
691/// Specifies a TIMESTAMP column type (without timezone).
692///
693/// TIMESTAMP stores date and time without timezone.
694///
695/// See: <https://www.postgresql.org/docs/current/datatype-datetime.html>
696pub const TIMESTAMP: TypeMarker = TypeMarker;
697
698/// Alias for TIMESTAMP.
699pub const TIMESTAMP_WITHOUT_TIME_ZONE: TypeMarker = TypeMarker;
700
701/// Specifies a TIMESTAMPTZ column type (with timezone).
702///
703/// TIMESTAMPTZ stores date and time with timezone.
704///
705/// See: <https://www.postgresql.org/docs/current/datatype-datetime.html>
706pub const TIMESTAMPTZ: TypeMarker = TypeMarker;
707
708/// Alias for TIMESTAMPTZ.
709pub const TIMESTAMP_WITH_TIME_ZONE: TypeMarker = TypeMarker;
710
711/// Specifies a DATE column type.
712///
713/// DATE stores calendar dates without time.
714///
715/// See: <https://www.postgresql.org/docs/current/datatype-datetime.html>
716pub const DATE: TypeMarker = TypeMarker;
717
718/// Specifies a TIME column type (without timezone).
719///
720/// TIME stores time of day without date or timezone.
721///
722/// See: <https://www.postgresql.org/docs/current/datatype-datetime.html>
723pub const TIME: TypeMarker = TypeMarker;
724
725/// Alias for TIME.
726pub const TIME_WITHOUT_TIME_ZONE: TypeMarker = TypeMarker;
727
728/// Specifies a TIMETZ column type (with timezone).
729///
730/// TIMETZ stores time of day with timezone.
731///
732/// See: <https://www.postgresql.org/docs/current/datatype-datetime.html>
733pub const TIMETZ: TypeMarker = TypeMarker;
734
735/// Alias for TIMETZ.
736pub const TIME_WITH_TIME_ZONE: TypeMarker = TypeMarker;
737
738/// Specifies an INTERVAL column type.
739///
740/// INTERVAL stores time intervals.
741/// Requires the `chrono` feature.
742///
743/// See: <https://www.postgresql.org/docs/current/datatype-datetime.html>
744pub const INTERVAL: TypeMarker = TypeMarker;
745
746//--- Network Address Types ---
747
748/// Specifies an INET column type.
749///
750/// INET stores IPv4 or IPv6 host addresses.
751/// Requires the `cidr` feature.
752///
753/// See: <https://www.postgresql.org/docs/current/datatype-net-types.html>
754pub const INET: TypeMarker = TypeMarker;
755
756/// Specifies a CIDR column type.
757///
758/// CIDR stores IPv4 or IPv6 network addresses.
759/// Requires the `cidr` feature.
760///
761/// See: <https://www.postgresql.org/docs/current/datatype-net-types.html>
762pub const CIDR: TypeMarker = TypeMarker;
763
764/// Specifies a MACADDR column type.
765///
766/// MACADDR stores MAC addresses.
767/// Requires the `cidr` feature.
768///
769/// See: <https://www.postgresql.org/docs/current/datatype-net-types.html>
770pub const MACADDR: TypeMarker = TypeMarker;
771
772/// Specifies a MACADDR8 column type.
773///
774/// MACADDR8 stores EUI-64 MAC addresses.
775/// Requires the `cidr` feature.
776///
777/// See: <https://www.postgresql.org/docs/current/datatype-net-types.html>
778pub const MACADDR8: TypeMarker = TypeMarker;
779
780//--- Geometric Types ---
781
782/// Specifies a POINT column type.
783///
784/// POINT stores geometric points.
785/// Requires the `geo-types` feature.
786///
787/// See: <https://www.postgresql.org/docs/current/datatype-geometric.html>
788pub const POINT: TypeMarker = TypeMarker;
789
790/// Specifies a LINE column type.
791///
792/// LINE stores infinite geometric lines.
793/// Requires the `geo-types` feature.
794///
795/// See: <https://www.postgresql.org/docs/current/datatype-geometric.html>
796pub const LINE: TypeMarker = TypeMarker;
797
798/// Specifies a LSEG column type.
799///
800/// LSEG stores geometric line segments.
801/// Requires the `geo-types` feature.
802///
803/// See: <https://www.postgresql.org/docs/current/datatype-geometric.html>
804pub const LSEG: TypeMarker = TypeMarker;
805
806/// Specifies a BOX column type.
807///
808/// BOX stores geometric boxes.
809/// Requires the `geo-types` feature.
810///
811/// See: <https://www.postgresql.org/docs/current/datatype-geometric.html>
812pub const BOX: TypeMarker = TypeMarker;
813
814/// Specifies a PATH column type.
815///
816/// PATH stores geometric paths.
817/// Requires the `geo-types` feature.
818///
819/// See: <https://www.postgresql.org/docs/current/datatype-geometric.html>
820pub const PATH: TypeMarker = TypeMarker;
821
822/// Specifies a POLYGON column type.
823///
824/// POLYGON stores geometric polygons.
825/// Requires the `geo-types` feature.
826///
827/// See: <https://www.postgresql.org/docs/current/datatype-geometric.html>
828pub const POLYGON: TypeMarker = TypeMarker;
829
830/// Specifies a CIRCLE column type.
831///
832/// CIRCLE stores geometric circles.
833/// Requires the `geo-types` feature.
834///
835/// See: <https://www.postgresql.org/docs/current/datatype-geometric.html>
836pub const CIRCLE: TypeMarker = TypeMarker;
837
838//--- Bit String Types ---
839
840/// Specifies a BIT column type.
841///
842/// BIT stores fixed-length bit strings.
843/// Requires the `bit-vec` feature.
844///
845/// See: <https://www.postgresql.org/docs/current/datatype-bit.html>
846pub const BIT: TypeMarker = TypeMarker;
847
848/// Specifies a VARBIT column type.
849///
850/// VARBIT (BIT VARYING) stores variable-length bit strings.
851/// Requires the `bit-vec` feature.
852///
853/// See: <https://www.postgresql.org/docs/current/datatype-bit.html>
854pub const VARBIT: TypeMarker = TypeMarker;
855
856/// Alias for VARBIT.
857pub const BIT_VARYING: TypeMarker = TypeMarker;