// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { ConstraintModifiers } from "./ConstraintModifiers";
import type { ExcludeElement } from "./ExcludeElement";
import type { Expression } from "./Expression";
import type { ForeignKeyRef } from "./ForeignKeyRef";
import type { Identifier } from "./Identifier";
import type { LikeOptionAction } from "./LikeOptionAction";
import type { ReferentialAction } from "./ReferentialAction";
import type { TableRef } from "./TableRef";
import type { Tags } from "./Tags";

/**
 * Table-level constraint
 */
export type TableConstraint = { "PrimaryKey": { name: Identifier | null, columns: Array<Identifier>, 
/**
 * INCLUDE (columns) - non-key columns included in the index (PostgreSQL)
 */
include_columns: Array<Identifier>, modifiers: ConstraintModifiers, 
/**
 * Whether the CONSTRAINT keyword was used (vs MySQL's `PRIMARY KEY name (cols)` syntax)
 */
has_constraint_keyword: boolean, } } | { "Unique": { name: Identifier | null, columns: Array<Identifier>, 
/**
 * Whether columns are parenthesized (false for UNIQUE idx_name without parens)
 */
columns_parenthesized: boolean, modifiers: ConstraintModifiers, 
/**
 * Whether the CONSTRAINT keyword was used (vs MySQL's `UNIQUE name (cols)` syntax)
 */
has_constraint_keyword: boolean, 
/**
 * PostgreSQL 15+: NULLS NOT DISTINCT
 */
nulls_not_distinct: boolean, } } | { "ForeignKey": { name: Identifier | null, columns: Array<Identifier>, references: ForeignKeyRef | null, 
/**
 * ON DELETE action when REFERENCES is absent
 */
on_delete: ReferentialAction | null, 
/**
 * ON UPDATE action when REFERENCES is absent
 */
on_update: ReferentialAction | null, modifiers: ConstraintModifiers, } } | { "Check": { name: Identifier | null, expression: Expression, modifiers: ConstraintModifiers, } } | { "Index": { name: Identifier | null, columns: Array<Identifier>, 
/**
 * Index kind: UNIQUE, FULLTEXT, SPATIAL, etc.
 */
kind: string | null, modifiers: ConstraintModifiers, 
/**
 * True if KEY keyword was used instead of INDEX
 */
use_key_keyword: boolean, 
/**
 * ClickHouse: indexed expression (instead of columns)
 */
expression?: Expression | null, 
/**
 * ClickHouse: TYPE type_func(args)
 */
index_type?: Expression | null, 
/**
 * ClickHouse: GRANULARITY n
 */
granularity?: Expression | null, } } | { "Projection": { name: Identifier, expression: Expression, } } | { "Like": { source: TableRef, 
/**
 * Options as (INCLUDING|EXCLUDING, property) pairs
 */
options: Array<[LikeOptionAction, string]>, } } | { "PeriodForSystemTime": { start_col: Identifier, end_col: Identifier, } } | { "Exclude": { name: Identifier | null, 
/**
 * Index access method (gist, btree, etc.)
 */
using: string | null, 
/**
 * Elements: (expression, operator) pairs
 */
elements: Array<ExcludeElement>, 
/**
 * INCLUDE columns
 */
include_columns: Array<Identifier>, 
/**
 * WHERE predicate
 */
where_clause: Expression | null, 
/**
 * WITH (storage_parameters)
 */
with_params: Array<[string, string]>, 
/**
 * USING INDEX TABLESPACE tablespace_name
 */
using_index_tablespace: string | null, modifiers: ConstraintModifiers, } } | { "Tags": Tags } | { "InitiallyDeferred": { 
/**
 * true = INITIALLY DEFERRED, false = INITIALLY IMMEDIATE
 */
deferred: boolean, } };
