Xqlite.Schema.ColumnInfo (Xqlite v0.7.0)

View Source

Information about a specific column in a table, corresponding to PRAGMA table_info.

Summary

Types

t()

Struct definition.

Types

t()

@type t() :: %Xqlite.Schema.ColumnInfo{
  column_id: integer(),
  declared_type: String.t(),
  default_value: String.t() | nil,
  hidden_kind: Xqlite.Schema.Types.column_hidden_kind(),
  name: String.t(),
  nullable: boolean(),
  primary_key_index: non_neg_integer(),
  type_affinity: Xqlite.Schema.Types.type_affinity()
}

Struct definition.

  • :column_id - The zero-indexed ID of the column within the table.
  • :name - Name of the column.
  • :type_affinity - The resolved data type affinity (see t:Types.type_affinity/0).
  • :declared_type - The original data type string exactly as declared in the CREATE TABLE statement (e.g., "VARCHAR(50)", "INTEGER", "BOOLEAN").
  • :nullable - true if the column allows NULL values, false otherwise (derived from NOT NULL constraint).
  • :default_value - The default value expression as a string literal (e.g., "'default'", "123", "CURRENT_TIMESTAMP"), or nil if no default.
  • :primary_key_index - If this column is part of the primary key, its 1-based index within the key (e.g., 1 for single PK, 1 or 2 for compound PK). 0 if not part of the primary key.
  • :hidden_kind - Indicates if and how a column is hidden/generated (see t:Types.column_hidden_kind/0).