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//! ```rust
8//! # extern crate self as drizzle;
9//! # mod _drizzle {
10//! # pub mod core { pub use drizzle_core::*; }
11//! # pub mod error { pub use drizzle_core::error::*; }
12//! # pub mod types { pub use drizzle_types::*; }
13//! # pub mod migrations { pub use drizzle_migrations::*; }
14//! # pub use drizzle_types::Dialect;
15//! # pub use drizzle_types as ddl;
16//! # pub mod postgres {
17//! # pub mod values { pub use drizzle_postgres::values::*; }
18//! # pub mod traits { pub use drizzle_postgres::traits::*; }
19//! # pub mod common { pub use drizzle_postgres::common::*; }
20//! # pub mod attrs { pub use drizzle_postgres::attrs::*; }
21//! # pub mod builder { pub use drizzle_postgres::builder::*; }
22//! # pub mod helpers { pub use drizzle_postgres::helpers::*; }
23//! # pub mod expr { pub use drizzle_postgres::expr::*; }
24//! # pub mod types { pub use drizzle_postgres::types::*; }
25//! # pub struct Row;
26//! # impl Row {
27//! # pub fn get<'a, I, T>(&'a self, _: I) -> T { unimplemented!() }
28//! # pub fn try_get<'a, I, T>(&'a self, _: I) -> Result<T, Box<dyn std::error::Error + Sync + Send>> { unimplemented!() }
29//! # }
30//! # pub mod prelude {
31//! # pub use drizzle_macros::{PostgresTable, PostgresSchema, PostgresIndex};
32//! # pub use drizzle_postgres::attrs::*;
33//! # pub use drizzle_postgres::common::PostgresSchemaType;
34//! # pub use drizzle_postgres::traits::{PostgresColumn, PostgresTable};
35//! # pub use drizzle_postgres::values::{PostgresInsertValue, PostgresUpdateValue, PostgresValue};
36//! # pub use drizzle_core::*;
37//! # }
38//! # }
39//! # }
40//! # pub use _drizzle::*;
41//! # pub use const_format;
42//! fn main() {
43//! use drizzle::postgres::prelude::*;
44//!
45//! #[PostgresTable(
46//! NAME = "users",
47//! UNLOGGED,
48//! RLS,
49//! UNIQUE(columns(email, tenant_id)),
50//! CHECK(name = "users_score_check", expr = "score >= 0")
51//! )]
52//! struct User {
53//! #[column(PRIMARY, SERIAL)]
54//! id: i32,
55//! #[column(UNIQUE)]
56//! email: String,
57//! tenant_id: i32,
58//! score: i32,
59//! metadata: String,
60//! }
61//! }
62//! ```
63
64/// Marker struct for column constraint attributes.
65#[derive(Debug, Clone, Copy)]
66pub struct ColumnMarker;
67
68//------------------------------------------------------------------------------
69// Primary Key Constraints
70//------------------------------------------------------------------------------
71
72/// Marks this column as the PRIMARY KEY.
73///
74/// ## Example
75/// ```rust
76/// # let _ = r####"
77/// #[column(PRIMARY)]
78/// id: i32,
79/// # "####;
80/// ```
81///
82/// See: <https://www.postgresql.org/docs/current/ddl-constraints.html#DDL-CONSTRAINTS-PRIMARY-KEYS>
83pub const PRIMARY: ColumnMarker = ColumnMarker;
84
85/// Alias for [`PRIMARY`].
86pub const PRIMARY_KEY: ColumnMarker = ColumnMarker;
87
88//------------------------------------------------------------------------------
89// Auto-increment Types
90//------------------------------------------------------------------------------
91
92/// Creates a SERIAL column (auto-incrementing 32-bit integer).
93///
94/// ## Example
95/// ```rust
96/// # let _ = r####"
97/// #[column(PRIMARY, SERIAL)]
98/// id: i32,
99/// # "####;
100/// ```
101///
102/// See: <https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-SERIAL>
103pub const SERIAL: ColumnMarker = ColumnMarker;
104
105/// Creates a BIGSERIAL column (auto-incrementing 64-bit integer).
106///
107/// ## Example
108/// ```rust
109/// # let _ = r####"
110/// #[column(PRIMARY, BIGSERIAL)]
111/// id: i64,
112/// # "####;
113/// ```
114///
115/// See: <https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-SERIAL>
116pub const BIGSERIAL: ColumnMarker = ColumnMarker;
117
118/// Creates a SMALLSERIAL column (auto-incrementing 16-bit integer).
119///
120/// ## Example
121/// ```rust
122/// # let _ = r####"
123/// #[column(PRIMARY, SMALLSERIAL)]
124/// id: i16,
125/// # "####;
126/// ```
127///
128/// See: <https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-SERIAL>
129pub const SMALLSERIAL: ColumnMarker = ColumnMarker;
130
131//------------------------------------------------------------------------------
132// Uniqueness Constraints
133//------------------------------------------------------------------------------
134
135/// Adds a UNIQUE constraint to a column, table, or index.
136///
137/// ## Examples
138/// ```rust
139/// # let _ = r####"
140/// #[column(UNIQUE)]
141/// email: String,
142///
143/// #[PostgresTable(UNIQUE(columns(email, tenant_id), deferrable))]
144/// struct Users {
145/// email: String,
146/// tenant_id: i32,
147/// }
148///
149/// #[PostgresIndex(unique)]
150/// struct UsersEmailIdx(Users::email);
151/// # "####;
152/// ```
153///
154/// See: <https://www.postgresql.org/docs/current/ddl-constraints.html#DDL-CONSTRAINTS-UNIQUE-CONSTRAINTS>
155pub const UNIQUE: ColumnMarker = ColumnMarker;
156
157//------------------------------------------------------------------------------
158// Identity Columns
159//------------------------------------------------------------------------------
160
161/// Creates a GENERATED IDENTITY column with configurable mode.
162///
163/// ## Syntax
164/// - `identity(always)` - User values rejected unless OVERRIDING SYSTEM VALUE
165/// - `identity(by_default)` - User values take precedence
166///
167/// ## Example
168/// ```rust
169/// # let _ = r####"
170/// // GENERATED ALWAYS AS IDENTITY - strictest mode
171/// #[column(identity(always), primary)]
172/// id: i64,
173///
174/// // GENERATED BY DEFAULT AS IDENTITY - allows override
175/// #[column(identity(by_default), primary)]
176/// id: i64,
177/// # "####;
178/// ```
179///
180/// ## Technical Details
181/// `PostgreSQL`'s identity columns are SQL-standard compliant, unlike SERIAL.
182/// Use ALWAYS for auto-generated IDs, BY DEFAULT when you need to occasionally set values.
183///
184/// See: <https://www.postgresql.org/docs/current/ddl-identity-columns.html>
185pub const IDENTITY: ColumnMarker = ColumnMarker;
186
187/// Marks a column as a GENERATED AS (expression) column.
188///
189/// ## Syntax
190/// - `generated(stored, "expression")` - Computed on write, stored on disk
191/// - `generated(virtual, "expression")` - Computed on read, not stored (`PostgreSQL` 18+)
192///
193/// ## Example
194/// ```rust
195/// # let _ = r####"
196/// #[column(generated(stored, "price * quantity"))]
197/// total: i32,
198///
199/// #[column(generated(virtual, "first_name || ' ' || last_name"))]
200/// full_name: String,
201/// # "####;
202/// ```
203///
204/// ## Technical Details
205/// Generated columns cannot be written to directly.
206/// STORED columns are computed and stored on write.
207/// VIRTUAL columns are computed on read (`PostgreSQL` 18+).
208///
209/// See: <https://www.postgresql.org/docs/current/ddl-generated-columns.html>
210pub const GENERATED: ColumnMarker = ColumnMarker;
211
212//------------------------------------------------------------------------------
213// Serialization Modes
214//------------------------------------------------------------------------------
215
216/// Enables JSON serialization with JSON type storage.
217///
218/// ## Example
219/// ```rust
220/// # let _ = r####"
221/// #[column(JSON)]
222/// metadata: UserMetadata,
223/// # "####;
224/// ```
225///
226/// Requires the `serde` feature. The field type must implement `Serialize` and `Deserialize`.
227///
228/// See: <https://www.postgresql.org/docs/current/datatype-json.html>
229pub const JSON: ColumnMarker = ColumnMarker;
230
231/// Enables JSON serialization with JSONB storage.
232///
233/// ## Example
234/// ```rust
235/// # let _ = r####"
236/// #[column(JSONB)]
237/// config: AppConfig,
238/// # "####;
239/// ```
240///
241/// JSONB is the recommended JSON storage format for most use cases.
242/// It supports indexing and efficient querying.
243///
244/// Requires the `serde` feature. The field type must implement `Serialize` and `Deserialize`.
245///
246/// See: <https://www.postgresql.org/docs/current/datatype-json.html>
247pub const JSONB: ColumnMarker = ColumnMarker;
248
249/// Marks this column as storing an enum type.
250///
251/// ## Example
252/// ```rust
253/// # let _ = r####"
254/// #[column(ENUM)]
255/// role: Role,
256/// # "####;
257/// ```
258///
259/// For `PostgreSQL` native ENUM types or text-based enum storage.
260///
261/// See: <https://www.postgresql.org/docs/current/datatype-enum.html>
262pub const ENUM: ColumnMarker = ColumnMarker;
263
264//------------------------------------------------------------------------------
265// Collation Markers
266//------------------------------------------------------------------------------
267
268/// Specifies a collation for a text column.
269///
270/// PostgreSQL collation identifiers are quoted names; the DDL emitter
271/// wraps whatever you supply here in double quotes, so write the bare
272/// name (`"en_US"`, `"C"`, `"POSIX"`, or any `CREATE COLLATION` value).
273///
274/// ## Example
275/// ```rust
276/// # let _ = r####"
277/// #[column(COLLATE = "en_US")]
278/// name: String,
279/// # "####;
280/// ```
281///
282/// See: <https://www.postgresql.org/docs/current/collation.html>
283pub const COLLATE: ColumnMarker = ColumnMarker;
284
285//------------------------------------------------------------------------------
286// Default Value Parameters
287//------------------------------------------------------------------------------
288
289/// Specifies a function to generate default values at runtime.
290///
291/// The function is called for each insert when no value is provided.
292///
293/// ## Example
294/// ```rust
295/// # let _ = r####"
296/// #[column(DEFAULT_FN = Uuid::new_v4)]
297/// id: Uuid,
298/// # "####;
299/// ```
300///
301/// ## Difference from DEFAULT
302/// - `DEFAULT_FN`: Calls the function at runtime for each insert (e.g., UUID generation)
303/// - `DEFAULT`: Uses a fixed compile-time value
304pub const DEFAULT_FN: ColumnMarker = ColumnMarker;
305
306/// Specifies a raw SQL default expression emitted directly in DDL.
307///
308/// ## Example
309/// ```rust
310/// # let _ = r####"
311/// #[column(DEFAULT_SQL = "now()")]
312/// created_at: String,
313/// # "####;
314/// ```
315///
316/// Use [`DEFAULT`] for literal Rust values and `DEFAULT_SQL` when the default
317/// must be a database expression.
318///
319/// See: <https://www.postgresql.org/docs/current/ddl-default.html>
320pub const DEFAULT_SQL: ColumnMarker = ColumnMarker;
321
322/// Specifies a fixed default value for new rows.
323///
324/// ## Example
325/// ```rust
326/// # let _ = r####"
327/// #[column(DEFAULT = 0)]
328/// count: i32,
329///
330/// #[column(DEFAULT = "guest")]
331/// role: String,
332/// # "####;
333/// ```
334///
335/// For runtime-generated values (UUIDs, timestamps), use [`DEFAULT_FN`] instead.
336///
337/// See: <https://www.postgresql.org/docs/current/ddl-default.html>
338pub const DEFAULT: ColumnMarker = ColumnMarker;
339
340/// Establishes a foreign key reference to another table's column.
341///
342/// ## Example
343/// ```rust
344/// # let _ = r####"
345/// #[column(REFERENCES = User::id)]
346/// user_id: i32,
347/// # "####;
348/// ```
349///
350/// See: <https://www.postgresql.org/docs/current/ddl-constraints.html#DDL-CONSTRAINTS-FK>
351pub const REFERENCES: ColumnMarker = ColumnMarker;
352
353/// Specifies the ON DELETE action for foreign key references.
354///
355/// ## Example
356/// ```rust
357/// # let _ = r####"
358/// #[column(REFERENCES = User::id, ON_DELETE = CASCADE)]
359/// user_id: i32,
360/// # "####;
361/// ```
362///
363/// ## Supported Actions
364/// - `CASCADE`: Delete rows that reference the deleted row
365/// - `SET_NULL`: Set the column to NULL when referenced row is deleted
366/// - `SET_DEFAULT`: Set the column to its default value
367/// - `RESTRICT`: Prevent deletion if referenced
368/// - `NO_ACTION`: Similar to RESTRICT (default)
369///
370/// See: <https://www.postgresql.org/docs/current/ddl-constraints.html#DDL-CONSTRAINTS-FK>
371pub const ON_DELETE: ColumnMarker = ColumnMarker;
372
373/// Specifies the ON UPDATE action for foreign key references.
374///
375/// ## Example
376/// ```rust
377/// # let _ = r####"
378/// #[column(REFERENCES = User::id, ON_UPDATE = CASCADE)]
379/// user_id: i32,
380/// # "####;
381/// ```
382///
383/// ## Supported Actions
384/// - `CASCADE`: Update referencing rows when referenced row is updated
385/// - `SET_NULL`: Set the column to NULL when referenced row is updated
386/// - `SET_DEFAULT`: Set the column to its default value
387/// - `RESTRICT`: Prevent update if referenced
388/// - `NO_ACTION`: Similar to RESTRICT (default)
389///
390/// See: <https://www.postgresql.org/docs/current/ddl-constraints.html#DDL-CONSTRAINTS-FK>
391pub const ON_UPDATE: ColumnMarker = ColumnMarker;
392
393/// Marks a foreign key or table-level UNIQUE constraint as DEFERRABLE.
394///
395/// ## Example
396/// ```rust
397/// # let _ = r####"
398/// #[column(REFERENCES = Users::id, DEFERRABLE)]
399/// user_id: i32,
400///
401/// #[PostgresTable(UNIQUE(columns(email, tenant_id), deferrable))]
402/// struct Users {
403/// email: String,
404/// tenant_id: i32,
405/// }
406/// # "####;
407/// ```
408///
409/// See: <https://www.postgresql.org/docs/current/sql-createtable.html>
410pub const DEFERRABLE: ColumnMarker = ColumnMarker;
411
412/// Marks a foreign key or table-level UNIQUE constraint as DEFERRABLE INITIALLY DEFERRED.
413///
414/// ## Example
415/// ```rust
416/// # let _ = r####"
417/// #[column(REFERENCES = Users::id, INITIALLY_DEFERRED)]
418/// user_id: i32,
419///
420/// #[PostgresTable(UNIQUE(columns(email, tenant_id), initially_deferred))]
421/// struct Users {
422/// email: String,
423/// tenant_id: i32,
424/// }
425/// # "####;
426/// ```
427///
428/// See: <https://www.postgresql.org/docs/current/sql-createtable.html>
429pub const INITIALLY_DEFERRED: ColumnMarker = ColumnMarker;
430
431//------------------------------------------------------------------------------
432// Referential Action Values
433//------------------------------------------------------------------------------
434
435/// Type alias for referential action markers (uses `ColumnMarker` for macro compatibility).
436pub type ReferentialAction = ColumnMarker;
437
438/// CASCADE action: Propagate the delete/update to referencing rows.
439///
440/// ## Example
441/// ```rust
442/// # let _ = r####"
443/// #[column(REFERENCES = User::id, ON_DELETE = CASCADE)]
444/// user_id: i32,
445/// # "####;
446/// ```
447///
448/// See: <https://www.postgresql.org/docs/current/ddl-constraints.html#DDL-CONSTRAINTS-FK>
449pub const CASCADE: ColumnMarker = ColumnMarker;
450
451/// SET NULL action: Set referencing columns to NULL.
452///
453/// ## Example
454/// ```rust
455/// # let _ = r####"
456/// #[column(REFERENCES = User::id, ON_DELETE = SET_NULL)]
457/// user_id: Option<i32>,
458/// # "####;
459/// ```
460///
461/// See: <https://www.postgresql.org/docs/current/ddl-constraints.html#DDL-CONSTRAINTS-FK>
462pub const SET_NULL: ColumnMarker = ColumnMarker;
463
464/// SET DEFAULT action: Set referencing columns to their default values.
465///
466/// ## Example
467/// ```rust
468/// # let _ = r####"
469/// #[column(REFERENCES = User::id, ON_DELETE = SET_DEFAULT, DEFAULT = 0)]
470/// user_id: i32,
471/// # "####;
472/// ```
473///
474/// See: <https://www.postgresql.org/docs/current/ddl-constraints.html#DDL-CONSTRAINTS-FK>
475pub const SET_DEFAULT: ColumnMarker = ColumnMarker;
476
477/// RESTRICT action: Prevent delete/update if referenced.
478///
479/// ## Example
480/// ```rust
481/// # let _ = r####"
482/// #[column(REFERENCES = User::id, ON_DELETE = RESTRICT)]
483/// user_id: i32,
484/// # "####;
485/// ```
486///
487/// See: <https://www.postgresql.org/docs/current/ddl-constraints.html#DDL-CONSTRAINTS-FK>
488pub const RESTRICT: ColumnMarker = ColumnMarker;
489
490/// NO ACTION action: Similar to RESTRICT (default behavior).
491///
492/// ## Example
493/// ```rust
494/// # let _ = r####"
495/// #[column(REFERENCES = User::id, ON_DELETE = NO_ACTION)]
496/// user_id: i32,
497/// # "####;
498/// ```
499///
500/// See: <https://www.postgresql.org/docs/current/ddl-constraints.html#DDL-CONSTRAINTS-FK>
501pub const NO_ACTION: ColumnMarker = ColumnMarker;
502
503/// Adds a CHECK constraint to a column or table.
504///
505/// ## Examples
506/// ```rust
507/// # let _ = r####"
508/// #[column(CHECK = "age >= 0")]
509/// age: i32,
510///
511/// #[PostgresTable(CHECK(name = "valid_score", expr = "score >= 0 AND score <= 100"))]
512/// struct Scores {
513/// score: i32,
514/// }
515/// # "####;
516/// ```
517///
518/// See: <https://www.postgresql.org/docs/current/ddl-constraints.html#DDL-CONSTRAINTS-CHECK-CONSTRAINTS>
519pub const CHECK: ColumnMarker = ColumnMarker;
520
521//------------------------------------------------------------------------------
522// Name Marker (shared by column and table attributes)
523//------------------------------------------------------------------------------
524
525/// Marker struct for the NAME attribute.
526#[derive(Debug, Clone, Copy)]
527pub struct NameMarker;
528
529/// Specifies a custom name in the database.
530///
531/// By default, table, view, and column names are automatically converted to `snake_case`
532/// from the Rust struct/field name. Use NAME to override this behavior.
533///
534/// ## Column Example
535/// ```rust
536/// # let _ = r####"
537/// // Field `createdAt` becomes `created_at` by default
538/// created_at: DateTime<Utc>,
539///
540/// // Override with custom name:
541/// #[column(NAME = "creation_timestamp")]
542/// created_at: DateTime<Utc>,
543/// # "####;
544/// ```
545///
546/// ## Table Example
547/// ```rust
548/// # let _ = r####"
549/// // Struct `UserAccount` becomes table `user_account` by default
550/// struct UserAccount { ... }
551///
552/// // Override with custom name:
553/// #[PostgresTable(NAME = "user_accounts")]
554/// struct UserAccount { ... }
555/// # "####;
556/// ```
557///
558/// ## View Example
559/// ```rust
560/// # let _ = r####"
561/// #[PostgresView(NAME = "active_users")]
562/// struct ActiveUsers { ... }
563/// # "####;
564/// ```
565pub const NAME: NameMarker = NameMarker;
566
567//------------------------------------------------------------------------------
568// View Attribute Markers
569//------------------------------------------------------------------------------
570
571/// Marker struct for view attributes.
572#[derive(Debug, Clone, Copy)]
573pub struct ViewMarker;
574
575/// Specifies a view definition SQL string or expression.
576///
577/// ## Examples
578/// ```rust
579/// # let _ = r####"
580/// #[PostgresView(DEFINITION = "SELECT id, name FROM users")]
581/// struct UserNames { id: i32, name: String }
582/// # "####;
583/// ```
584///
585/// ```rust
586/// # let _ = r####"
587/// #[PostgresView(
588/// DEFINITION = {
589/// let builder = drizzle::postgres::QueryBuilder::new::<Schema>();
590/// let Schema { user } = Schema::new();
591/// builder.select((user.id, user.name)).from(user)
592/// }
593/// )]
594/// struct UserNames { id: i32, name: String }
595/// # "####;
596/// ```
597pub const DEFINITION: ViewMarker = ViewMarker;
598
599/// Specifies a table or view schema name.
600///
601/// ## Examples
602/// ```rust
603/// # let _ = r####"
604/// #[PostgresView(SCHEMA = "auth")]
605/// struct AuthUsers { ... }
606///
607/// #[PostgresTable(SCHEMA = "auth")]
608/// struct AuthUsersTable { id: i32 }
609/// # "####;
610/// ```
611pub const SCHEMA: ViewMarker = ViewMarker;
612
613/// Marks the view as materialized.
614///
615/// ## Example
616/// ```rust
617/// # let _ = r####"
618/// #[PostgresView(MATERIALIZED)]
619/// struct ActiveUsers { ... }
620/// # "####;
621/// ```
622pub const MATERIALIZED: ViewMarker = ViewMarker;
623
624/// Sets WITH options for a view definition.
625///
626/// ## Example
627/// ```rust
628/// # let _ = r####"
629/// #[PostgresView(WITH = ViewWithOptionDef::new().security_barrier())]
630/// struct ActiveUsers { ... }
631/// # "####;
632/// ```
633pub const WITH: ViewMarker = ViewMarker;
634
635/// Alias for [`WITH`].
636pub const WITH_OPTIONS: ViewMarker = ViewMarker;
637
638/// Create a materialized view WITH NO DATA.
639///
640/// ## Example
641/// ```rust
642/// # let _ = r####"
643/// #[PostgresView(MATERIALIZED, WITH_NO_DATA)]
644/// struct ActiveUsers { ... }
645/// # "####;
646/// ```
647pub const WITH_NO_DATA: ViewMarker = ViewMarker;
648
649/// Specifies a USING clause for materialized views or row-level security policies.
650///
651/// ## Examples
652/// ```rust
653/// # let _ = r####"
654/// #[PostgresView(USING = "heap")]
655/// struct ActiveUsers { ... }
656///
657/// #[PostgresPolicy(USING = "tenant_id = current_setting('app.tenant_id')::int")]
658/// struct TenantPolicy(Users);
659/// # "####;
660/// ```
661pub const USING: ViewMarker = ViewMarker;
662
663/// Marks the view as existing (skip creation).
664///
665/// ## Example
666/// ```rust
667/// # let _ = r####"
668/// #[PostgresView(EXISTING)]
669/// struct ExistingView { ... }
670/// # "####;
671/// ```
672pub const EXISTING: ViewMarker = ViewMarker;
673
674//------------------------------------------------------------------------------
675// Table Attribute Markers
676//------------------------------------------------------------------------------
677
678/// Marker struct for table-level attributes.
679#[derive(Debug, Clone, Copy)]
680pub struct TableMarker;
681
682/// Adds a table-level composite foreign key constraint.
683///
684/// ## Example
685/// ```rust
686/// # let _ = r####"
687/// #[PostgresTable(FOREIGN_KEY(
688/// columns(tenant_id, user_id),
689/// references(Users, tenant_id, id),
690/// on_delete = "CASCADE",
691/// deferrable
692/// ))]
693/// struct Posts {
694/// tenant_id: i32,
695/// user_id: i32,
696/// }
697/// # "####;
698/// ```
699///
700/// See: <https://www.postgresql.org/docs/current/ddl-constraints.html#DDL-CONSTRAINTS-FK>
701pub const FOREIGN_KEY: TableMarker = TableMarker;
702
703/// Creates an UNLOGGED table.
704///
705/// ## Example
706/// ```rust
707/// # mod drizzle {
708/// # pub mod core { pub use drizzle_core::*; }
709/// # pub mod error { pub use drizzle_core::error::*; }
710/// # pub mod types { pub use drizzle_types::*; }
711/// # pub mod migrations { pub use drizzle_migrations::*; }
712/// # pub use drizzle_types::Dialect;
713/// # pub use drizzle_types as ddl;
714/// # pub mod postgres {
715/// # pub mod values { pub use drizzle_postgres::values::*; }
716/// # pub mod traits { pub use drizzle_postgres::traits::*; }
717/// # pub mod common { pub use drizzle_postgres::common::*; }
718/// # pub mod attrs { pub use drizzle_postgres::attrs::*; }
719/// # pub mod builder { pub use drizzle_postgres::builder::*; }
720/// # pub mod helpers { pub use drizzle_postgres::helpers::*; }
721/// # pub mod expr { pub use drizzle_postgres::expr::*; }
722/// # pub mod types { pub use drizzle_postgres::types::*; }
723/// # pub struct Row;
724/// # impl Row {
725/// # pub fn get<'a, I, T>(&'a self, _: I) -> T { unimplemented!() }
726/// # pub fn try_get<'a, I, T>(&'a self, _: I) -> Result<T, Box<dyn std::error::Error + Sync + Send>> { unimplemented!() }
727/// # }
728/// # pub mod prelude {
729/// # pub use drizzle_macros::{PostgresTable, PostgresSchema, PostgresIndex};
730/// # pub use drizzle_postgres::attrs::*;
731/// # pub use drizzle_postgres::common::PostgresSchemaType;
732/// # pub use drizzle_postgres::traits::{PostgresColumn, PostgresTable};
733/// # pub use drizzle_postgres::values::{PostgresInsertValue, PostgresUpdateValue, PostgresValue};
734/// # pub use drizzle_core::*;
735/// # }
736/// # }
737/// # }
738/// use drizzle::postgres::prelude::*;
739///
740/// #[PostgresTable(UNLOGGED)]
741/// struct SessionCache {
742/// #[column(PRIMARY)]
743/// key: String,
744/// data: String,
745/// }
746/// ```
747///
748/// Unlogged tables are faster but data is not crash-safe.
749///
750/// See: <https://www.postgresql.org/docs/current/sql-createtable.html#SQL-CREATETABLE-UNLOGGED>
751pub const UNLOGGED: TableMarker = TableMarker;
752
753/// Creates a TEMPORARY table.
754///
755/// ## Example
756/// ```rust
757/// # mod drizzle {
758/// # pub mod core { pub use drizzle_core::*; }
759/// # pub mod error { pub use drizzle_core::error::*; }
760/// # pub mod types { pub use drizzle_types::*; }
761/// # pub mod migrations { pub use drizzle_migrations::*; }
762/// # pub use drizzle_types::Dialect;
763/// # pub use drizzle_types as ddl;
764/// # pub mod postgres {
765/// # pub mod values { pub use drizzle_postgres::values::*; }
766/// # pub mod traits { pub use drizzle_postgres::traits::*; }
767/// # pub mod common { pub use drizzle_postgres::common::*; }
768/// # pub mod attrs { pub use drizzle_postgres::attrs::*; }
769/// # pub mod builder { pub use drizzle_postgres::builder::*; }
770/// # pub mod helpers { pub use drizzle_postgres::helpers::*; }
771/// # pub mod expr { pub use drizzle_postgres::expr::*; }
772/// # pub mod types { pub use drizzle_postgres::types::*; }
773/// # pub struct Row;
774/// # impl Row {
775/// # pub fn get<'a, I, T>(&'a self, _: I) -> T { unimplemented!() }
776/// # pub fn try_get<'a, I, T>(&'a self, _: I) -> Result<T, Box<dyn std::error::Error + Sync + Send>> { unimplemented!() }
777/// # }
778/// # pub mod prelude {
779/// # pub use drizzle_macros::{PostgresTable, PostgresSchema, PostgresIndex};
780/// # pub use drizzle_postgres::attrs::*;
781/// # pub use drizzle_postgres::common::PostgresSchemaType;
782/// # pub use drizzle_postgres::traits::{PostgresColumn, PostgresTable};
783/// # pub use drizzle_postgres::values::{PostgresInsertValue, PostgresUpdateValue, PostgresValue};
784/// # pub use drizzle_core::*;
785/// # }
786/// # }
787/// # }
788/// use drizzle::postgres::prelude::*;
789///
790/// #[PostgresTable(TEMPORARY)]
791/// struct TempData {
792/// id: i32,
793/// value: String,
794/// }
795/// ```
796///
797/// Temporary tables exist only for the current session.
798///
799/// See: <https://www.postgresql.org/docs/current/sql-createtable.html#SQL-CREATETABLE-TEMPORARY>
800pub const TEMPORARY: TableMarker = TableMarker;
801
802/// Specifies inheritance from a parent table.
803///
804/// ## Example
805/// ```rust
806/// # mod drizzle {
807/// # pub mod core { pub use drizzle_core::*; }
808/// # pub mod error { pub use drizzle_core::error::*; }
809/// # pub mod types { pub use drizzle_types::*; }
810/// # pub mod migrations { pub use drizzle_migrations::*; }
811/// # pub use drizzle_types::Dialect;
812/// # pub use drizzle_types as ddl;
813/// # pub mod postgres {
814/// # pub mod values { pub use drizzle_postgres::values::*; }
815/// # pub mod traits { pub use drizzle_postgres::traits::*; }
816/// # pub mod common { pub use drizzle_postgres::common::*; }
817/// # pub mod attrs { pub use drizzle_postgres::attrs::*; }
818/// # pub mod builder { pub use drizzle_postgres::builder::*; }
819/// # pub mod helpers { pub use drizzle_postgres::helpers::*; }
820/// # pub mod expr { pub use drizzle_postgres::expr::*; }
821/// # pub mod types { pub use drizzle_postgres::types::*; }
822/// # pub struct Row;
823/// # impl Row {
824/// # pub fn get<'a, I, T>(&'a self, _: I) -> T { unimplemented!() }
825/// # pub fn try_get<'a, I, T>(&'a self, _: I) -> Result<T, Box<dyn std::error::Error + Sync + Send>> { unimplemented!() }
826/// # }
827/// # pub mod prelude {
828/// # pub use drizzle_macros::{PostgresTable, PostgresSchema, PostgresIndex};
829/// # pub use drizzle_postgres::attrs::*;
830/// # pub use drizzle_postgres::common::PostgresSchemaType;
831/// # pub use drizzle_postgres::traits::{PostgresColumn, PostgresTable};
832/// # pub use drizzle_postgres::values::{PostgresInsertValue, PostgresUpdateValue, PostgresValue};
833/// # pub use drizzle_core::*;
834/// # }
835/// # }
836/// # }
837/// use drizzle::postgres::prelude::*;
838///
839/// #[PostgresTable(INHERITS = "base_table")]
840/// struct ChildTable {
841/// extra_field: String,
842/// }
843/// ```
844///
845/// See: <https://www.postgresql.org/docs/current/ddl-inherit.html>
846pub const INHERITS: TableMarker = TableMarker;
847
848/// Specifies a tablespace for the table.
849///
850/// ## Example
851/// ```rust
852/// # mod drizzle {
853/// # pub mod core { pub use drizzle_core::*; }
854/// # pub mod error { pub use drizzle_core::error::*; }
855/// # pub mod types { pub use drizzle_types::*; }
856/// # pub mod migrations { pub use drizzle_migrations::*; }
857/// # pub use drizzle_types::Dialect;
858/// # pub use drizzle_types as ddl;
859/// # pub mod postgres {
860/// # pub mod values { pub use drizzle_postgres::values::*; }
861/// # pub mod traits { pub use drizzle_postgres::traits::*; }
862/// # pub mod common { pub use drizzle_postgres::common::*; }
863/// # pub mod attrs { pub use drizzle_postgres::attrs::*; }
864/// # pub mod builder { pub use drizzle_postgres::builder::*; }
865/// # pub mod helpers { pub use drizzle_postgres::helpers::*; }
866/// # pub mod expr { pub use drizzle_postgres::expr::*; }
867/// # pub mod types { pub use drizzle_postgres::types::*; }
868/// # pub struct Row;
869/// # impl Row {
870/// # pub fn get<'a, I, T>(&'a self, _: I) -> T { unimplemented!() }
871/// # pub fn try_get<'a, I, T>(&'a self, _: I) -> Result<T, Box<dyn std::error::Error + Sync + Send>> { unimplemented!() }
872/// # }
873/// # pub mod prelude {
874/// # pub use drizzle_macros::{PostgresTable, PostgresSchema, PostgresIndex};
875/// # pub use drizzle_postgres::attrs::*;
876/// # pub use drizzle_postgres::common::PostgresSchemaType;
877/// # pub use drizzle_postgres::traits::{PostgresColumn, PostgresTable};
878/// # pub use drizzle_postgres::values::{PostgresInsertValue, PostgresUpdateValue, PostgresValue};
879/// # pub use drizzle_core::*;
880/// # }
881/// # }
882/// # }
883/// use drizzle::postgres::prelude::*;
884///
885/// #[PostgresTable(TABLESPACE = "fast_storage")]
886/// struct HighPerfTable {
887/// #[column(PRIMARY)]
888/// id: i32,
889/// }
890///
891/// // Views also support TABLESPACE:
892/// // #[PostgresView(MATERIALIZED, TABLESPACE = "fast_storage")]
893/// // struct ActiveUsers { id: i32 }
894/// ```
895///
896/// See: <https://www.postgresql.org/docs/current/sql-createtable.html#SQL-CREATETABLE-TABLESPACE>
897pub const TABLESPACE: TableMarker = TableMarker;
898
899/// Enables row-level security for the table.
900///
901/// ## Example
902/// ```rust
903/// # let _ = r####"
904/// #[PostgresTable(RLS)]
905/// struct Users {
906/// id: i32,
907/// }
908/// # "####;
909/// ```
910///
911/// See: <https://www.postgresql.org/docs/current/ddl-rowsecurity.html>
912pub const RLS: TableMarker = TableMarker;
913
914//------------------------------------------------------------------------------
915// Index Attribute Markers
916//------------------------------------------------------------------------------
917
918/// Marker struct for index attributes.
919#[derive(Debug, Clone, Copy)]
920pub struct IndexMarker;
921
922/// Creates or drops an index CONCURRENTLY.
923///
924/// ## Example
925/// ```rust
926/// # let _ = r####"
927/// #[PostgresIndex(concurrent)]
928/// struct UsersEmailIdx(Users::email);
929/// # "####;
930/// ```
931///
932/// See: <https://www.postgresql.org/docs/current/sql-createindex.html>
933pub const CONCURRENT: IndexMarker = IndexMarker;
934
935/// Specifies the index access method.
936///
937/// ## Example
938/// ```rust
939/// # let _ = r####"
940/// #[PostgresIndex(method = "gin")]
941/// struct DocumentsSearchIdx(Documents::search_vector);
942/// # "####;
943/// ```
944///
945/// See: <https://www.postgresql.org/docs/current/indexes-types.html>
946pub const METHOD: IndexMarker = IndexMarker;
947
948/// Specifies a partial-index predicate.
949///
950/// ## Example
951/// ```rust
952/// # let _ = r####"
953/// #[PostgresIndex(where = "deleted_at IS NULL")]
954/// struct ActiveUsersEmailIdx(Users::email);
955/// # "####;
956/// ```
957///
958/// See: <https://www.postgresql.org/docs/current/indexes-partial.html>
959pub const WHERE: IndexMarker = IndexMarker;
960
961//------------------------------------------------------------------------------
962// Policy Attribute Markers
963//------------------------------------------------------------------------------
964
965/// Marker struct for row-level security policy attributes.
966#[derive(Debug, Clone, Copy)]
967pub struct PolicyMarker;
968
969/// Specifies whether a policy is PERMISSIVE or RESTRICTIVE.
970///
971/// ## Example
972/// ```rust
973/// # let _ = r####"
974/// #[PostgresPolicy(AS = "RESTRICTIVE")]
975/// struct TenantPolicy(Users);
976/// # "####;
977/// ```
978///
979/// See: <https://www.postgresql.org/docs/current/sql-createpolicy.html>
980pub const AS: PolicyMarker = PolicyMarker;
981
982/// Alias for [`AS`].
983pub const AS_CLAUSE: PolicyMarker = PolicyMarker;
984
985/// Specifies the command a policy applies to.
986///
987/// ## Example
988/// ```rust
989/// # let _ = r####"
990/// #[PostgresPolicy(FOR = "SELECT")]
991/// struct ReadPolicy(Users);
992/// # "####;
993/// ```
994///
995/// See: <https://www.postgresql.org/docs/current/sql-createpolicy.html>
996pub const FOR: PolicyMarker = PolicyMarker;
997
998/// Alias for [`FOR`].
999pub const FOR_CLAUSE: PolicyMarker = PolicyMarker;
1000
1001/// Specifies roles the policy applies to.
1002///
1003/// ## Example
1004/// ```rust
1005/// # let _ = r####"
1006/// #[PostgresPolicy(TO("app_user", public))]
1007/// struct TenantPolicy(Users);
1008/// # "####;
1009/// ```
1010///
1011/// See: <https://www.postgresql.org/docs/current/sql-createpolicy.html>
1012pub const TO: PolicyMarker = PolicyMarker;
1013
1014/// Specifies a WITH CHECK expression for INSERT/UPDATE policies.
1015///
1016/// ## Example
1017/// ```rust
1018/// # let _ = r####"
1019/// #[PostgresPolicy(WITH_CHECK = "tenant_id = current_setting('app.tenant_id')::int")]
1020/// struct TenantWritePolicy(Users);
1021/// # "####;
1022/// ```
1023///
1024/// See: <https://www.postgresql.org/docs/current/sql-createpolicy.html>
1025pub const WITH_CHECK: PolicyMarker = PolicyMarker;
1026
1027//------------------------------------------------------------------------------
1028// Column Type Markers
1029//------------------------------------------------------------------------------
1030
1031/// Marker struct for column type attributes.
1032#[derive(Debug, Clone, Copy)]
1033pub struct TypeMarker;
1034
1035//--- Character Types ---
1036
1037/// Specifies a TEXT column type.
1038///
1039/// TEXT stores variable-length character strings with no length limit.
1040///
1041/// See: <https://www.postgresql.org/docs/current/datatype-character.html>
1042pub const TEXT: TypeMarker = TypeMarker;
1043
1044/// Specifies a VARCHAR column type.
1045///
1046/// VARCHAR stores variable-length character strings.
1047/// In `PostgreSQL`, VARCHAR without length limit is equivalent to TEXT.
1048///
1049/// See: <https://www.postgresql.org/docs/current/datatype-character.html>
1050pub const VARCHAR: TypeMarker = TypeMarker;
1051
1052/// Alias for VARCHAR.
1053pub const CHARACTER_VARYING: TypeMarker = TypeMarker;
1054
1055/// Specifies a CHAR column type.
1056///
1057/// CHAR stores fixed-length character strings.
1058///
1059/// See: <https://www.postgresql.org/docs/current/datatype-character.html>
1060pub const CHAR: TypeMarker = TypeMarker;
1061
1062/// Alias for CHAR.
1063pub const CHARACTER: TypeMarker = TypeMarker;
1064
1065//--- Integer Types ---
1066
1067/// Specifies an INTEGER column type (32-bit).
1068///
1069/// INTEGER (or INT4) stores 32-bit signed integers.
1070///
1071/// See: <https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-INT>
1072pub const INTEGER: TypeMarker = TypeMarker;
1073
1074/// Alias for INTEGER.
1075pub const INT: TypeMarker = TypeMarker;
1076
1077/// Alias for INTEGER.
1078pub const INT4: TypeMarker = TypeMarker;
1079
1080/// Specifies a BIGINT column type (64-bit).
1081///
1082/// BIGINT (or INT8) stores 64-bit signed integers.
1083///
1084/// See: <https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-INT>
1085pub const BIGINT: TypeMarker = TypeMarker;
1086
1087/// Alias for BIGINT.
1088pub const INT8: TypeMarker = TypeMarker;
1089
1090/// Specifies a SMALLINT column type (16-bit).
1091///
1092/// SMALLINT (or INT2) stores 16-bit signed integers.
1093///
1094/// See: <https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-INT>
1095pub const SMALLINT: TypeMarker = TypeMarker;
1096
1097/// Alias for SMALLINT.
1098pub const INT2: TypeMarker = TypeMarker;
1099
1100//--- Floating Point Types ---
1101
1102/// Specifies a REAL column type (32-bit float).
1103///
1104/// REAL (or FLOAT4) stores 32-bit floating point numbers.
1105///
1106/// See: <https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-FLOAT>
1107pub const REAL: TypeMarker = TypeMarker;
1108
1109/// Alias for REAL.
1110pub const FLOAT4: TypeMarker = TypeMarker;
1111
1112/// Specifies a DOUBLE PRECISION column type (64-bit float).
1113///
1114/// DOUBLE PRECISION (or FLOAT8) stores 64-bit floating point numbers.
1115///
1116/// See: <https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-FLOAT>
1117pub const DOUBLE_PRECISION: TypeMarker = TypeMarker;
1118
1119/// Alias for DOUBLE PRECISION.
1120pub const FLOAT8: TypeMarker = TypeMarker;
1121
1122/// Alias for DOUBLE PRECISION.
1123pub const DOUBLE: TypeMarker = TypeMarker;
1124
1125/// Specifies a NUMERIC column type (arbitrary precision).
1126///
1127/// NUMERIC stores exact numbers with arbitrary precision.
1128///
1129/// See: <https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-NUMERIC-DECIMAL>
1130pub const NUMERIC: TypeMarker = TypeMarker;
1131
1132/// Alias for NUMERIC.
1133pub const DECIMAL: TypeMarker = TypeMarker;
1134
1135//--- Boolean Type ---
1136
1137/// Specifies a BOOLEAN column type.
1138///
1139/// BOOLEAN stores true/false values.
1140///
1141/// See: <https://www.postgresql.org/docs/current/datatype-boolean.html>
1142pub const BOOLEAN: TypeMarker = TypeMarker;
1143
1144/// Alias for BOOLEAN.
1145pub const BOOL: TypeMarker = TypeMarker;
1146
1147//--- Binary Type ---
1148
1149/// Specifies a BYTEA column type (binary data).
1150///
1151/// BYTEA stores variable-length binary strings.
1152///
1153/// See: <https://www.postgresql.org/docs/current/datatype-binary.html>
1154pub const BYTEA: TypeMarker = TypeMarker;
1155
1156//--- UUID Type ---
1157
1158/// Specifies a UUID column type.
1159///
1160/// UUID stores universally unique identifiers.
1161/// Requires the `uuid` feature.
1162///
1163/// See: <https://www.postgresql.org/docs/current/datatype-uuid.html>
1164pub const UUID: TypeMarker = TypeMarker;
1165
1166//--- Date/Time Types ---
1167
1168/// Specifies a TIMESTAMP column type (without timezone).
1169///
1170/// TIMESTAMP stores date and time without timezone.
1171///
1172/// See: <https://www.postgresql.org/docs/current/datatype-datetime.html>
1173pub const TIMESTAMP: TypeMarker = TypeMarker;
1174
1175/// Alias for TIMESTAMP.
1176pub const TIMESTAMP_WITHOUT_TIME_ZONE: TypeMarker = TypeMarker;
1177
1178/// Specifies a TIMESTAMPTZ column type (with timezone).
1179///
1180/// TIMESTAMPTZ stores date and time with timezone.
1181///
1182/// See: <https://www.postgresql.org/docs/current/datatype-datetime.html>
1183pub const TIMESTAMPTZ: TypeMarker = TypeMarker;
1184
1185/// Alias for TIMESTAMPTZ.
1186pub const TIMESTAMP_WITH_TIME_ZONE: TypeMarker = TypeMarker;
1187
1188/// Specifies a DATE column type.
1189///
1190/// DATE stores calendar dates without time.
1191///
1192/// See: <https://www.postgresql.org/docs/current/datatype-datetime.html>
1193pub const DATE: TypeMarker = TypeMarker;
1194
1195/// Specifies a TIME column type (without timezone).
1196///
1197/// TIME stores time of day without date or timezone.
1198///
1199/// See: <https://www.postgresql.org/docs/current/datatype-datetime.html>
1200pub const TIME: TypeMarker = TypeMarker;
1201
1202/// Alias for TIME.
1203pub const TIME_WITHOUT_TIME_ZONE: TypeMarker = TypeMarker;
1204
1205/// Specifies a TIMETZ column type (with timezone).
1206///
1207/// TIMETZ stores time of day with timezone.
1208///
1209/// See: <https://www.postgresql.org/docs/current/datatype-datetime.html>
1210pub const TIMETZ: TypeMarker = TypeMarker;
1211
1212/// Alias for TIMETZ.
1213pub const TIME_WITH_TIME_ZONE: TypeMarker = TypeMarker;
1214
1215/// Specifies an INTERVAL column type.
1216///
1217/// INTERVAL stores time intervals.
1218/// Requires the `chrono` feature.
1219///
1220/// See: <https://www.postgresql.org/docs/current/datatype-datetime.html>
1221pub const INTERVAL: TypeMarker = TypeMarker;
1222
1223//--- Network Address Types ---
1224
1225/// Specifies an INET column type.
1226///
1227/// INET stores IPv4 or IPv6 host addresses.
1228/// Requires the `cidr` feature.
1229///
1230/// See: <https://www.postgresql.org/docs/current/datatype-net-types.html>
1231pub const INET: TypeMarker = TypeMarker;
1232
1233/// Specifies a CIDR column type.
1234///
1235/// CIDR stores IPv4 or IPv6 network addresses.
1236/// Requires the `cidr` feature.
1237///
1238/// See: <https://www.postgresql.org/docs/current/datatype-net-types.html>
1239pub const CIDR: TypeMarker = TypeMarker;
1240
1241/// Specifies a MACADDR column type.
1242///
1243/// MACADDR stores MAC addresses.
1244/// Requires the `cidr` feature.
1245///
1246/// See: <https://www.postgresql.org/docs/current/datatype-net-types.html>
1247pub const MACADDR: TypeMarker = TypeMarker;
1248
1249/// Specifies a MACADDR8 column type.
1250///
1251/// MACADDR8 stores EUI-64 MAC addresses.
1252/// Requires the `cidr` feature.
1253///
1254/// See: <https://www.postgresql.org/docs/current/datatype-net-types.html>
1255pub const MACADDR8: TypeMarker = TypeMarker;
1256
1257//--- Geometric Types ---
1258
1259/// Specifies a POINT column type.
1260///
1261/// POINT stores geometric points.
1262/// Requires the `geo-types` feature.
1263///
1264/// See: <https://www.postgresql.org/docs/current/datatype-geometric.html>
1265pub const POINT: TypeMarker = TypeMarker;
1266
1267/// Specifies a LINE column type.
1268///
1269/// LINE stores infinite geometric lines.
1270/// Requires the `geo-types` feature.
1271///
1272/// See: <https://www.postgresql.org/docs/current/datatype-geometric.html>
1273pub const LINE: TypeMarker = TypeMarker;
1274
1275/// Specifies a LSEG column type.
1276///
1277/// LSEG stores geometric line segments.
1278/// Requires the `geo-types` feature.
1279///
1280/// See: <https://www.postgresql.org/docs/current/datatype-geometric.html>
1281pub const LSEG: TypeMarker = TypeMarker;
1282
1283/// Specifies a BOX column type.
1284///
1285/// BOX stores geometric boxes.
1286/// Requires the `geo-types` feature.
1287///
1288/// See: <https://www.postgresql.org/docs/current/datatype-geometric.html>
1289pub const BOX: TypeMarker = TypeMarker;
1290
1291/// Specifies a PATH column type.
1292///
1293/// PATH stores geometric paths.
1294/// Requires the `geo-types` feature.
1295///
1296/// See: <https://www.postgresql.org/docs/current/datatype-geometric.html>
1297pub const PATH: TypeMarker = TypeMarker;
1298
1299/// Specifies a POLYGON column type.
1300///
1301/// POLYGON stores geometric polygons.
1302/// Requires the `geo-types` feature.
1303///
1304/// See: <https://www.postgresql.org/docs/current/datatype-geometric.html>
1305pub const POLYGON: TypeMarker = TypeMarker;
1306
1307/// Specifies a CIRCLE column type.
1308///
1309/// CIRCLE stores geometric circles.
1310/// Requires the `geo-types` feature.
1311///
1312/// See: <https://www.postgresql.org/docs/current/datatype-geometric.html>
1313pub const CIRCLE: TypeMarker = TypeMarker;
1314
1315//--- Bit String Types ---
1316
1317/// Specifies a BIT column type.
1318///
1319/// BIT stores fixed-length bit strings.
1320/// Requires the `bit-vec` feature.
1321///
1322/// See: <https://www.postgresql.org/docs/current/datatype-bit.html>
1323pub const BIT: TypeMarker = TypeMarker;
1324
1325/// Specifies a VARBIT column type.
1326///
1327/// VARBIT (BIT VARYING) stores variable-length bit strings.
1328/// Requires the `bit-vec` feature.
1329///
1330/// See: <https://www.postgresql.org/docs/current/datatype-bit.html>
1331pub const VARBIT: TypeMarker = TypeMarker;
1332
1333/// Alias for VARBIT.
1334pub const BIT_VARYING: TypeMarker = TypeMarker;