galchemy/schema/introspection/postgres

Types

pub type ColumnRow {
  ColumnRow(
    schema_name: String,
    table_name: String,
    column_name: String,
    ordinal_position: Int,
    is_nullable: Bool,
    data_type: String,
    udt_name: String,
    character_maximum_length: option.Option(Int),
    numeric_precision: option.Option(Int),
    numeric_scale: option.Option(Int),
    datetime_precision: option.Option(Int),
    column_default: option.Option(String),
  )
}

Constructors

  • ColumnRow(
      schema_name: String,
      table_name: String,
      column_name: String,
      ordinal_position: Int,
      is_nullable: Bool,
      data_type: String,
      udt_name: String,
      character_maximum_length: option.Option(Int),
      numeric_precision: option.Option(Int),
      numeric_scale: option.Option(Int),
      datetime_precision: option.Option(Int),
      column_default: option.Option(String),
    )
pub type ConstraintKind {
  PrimaryKeyConstraint
  UniqueConstraint
  ForeignKeyConstraint
}

Constructors

  • PrimaryKeyConstraint
  • UniqueConstraint
  • ForeignKeyConstraint
pub type ConstraintRow {
  ConstraintRow(
    schema_name: String,
    table_name: String,
    constraint_name: String,
    kind: ConstraintKind,
    column_name: String,
    ordinal_position: Int,
    referenced_schema: option.Option(String),
    referenced_table: option.Option(String),
    referenced_column: option.Option(String),
  )
}

Constructors

  • ConstraintRow(
      schema_name: String,
      table_name: String,
      constraint_name: String,
      kind: ConstraintKind,
      column_name: String,
      ordinal_position: Int,
      referenced_schema: option.Option(String),
      referenced_table: option.Option(String),
      referenced_column: option.Option(String),
    )
pub type IndexRow {
  IndexRow(
    schema_name: String,
    table_name: String,
    index_name: String,
    is_unique: Bool,
    definition: String,
  )
}

Constructors

  • IndexRow(
      schema_name: String,
      table_name: String,
      index_name: String,
      is_unique: Bool,
      definition: String,
    )
pub type IntrospectionError {
  ColumnsQueryError(pog.QueryError)
  ConstraintsQueryError(pog.QueryError)
  IndexesQueryError(pog.QueryError)
}

Constructors

pub type IntrospectionOptions {
  IntrospectionOptions(
    schemas: List(String),
    include_system_schemas: Bool,
  )
}

Constructors

  • IntrospectionOptions(
      schemas: List(String),
      include_system_schemas: Bool,
    )

Values

pub fn column_row_decoder() -> decode.Decoder(ColumnRow)
pub fn compile_constraints_query(
  options: IntrospectionOptions,
) -> compiler.CompiledQuery
pub fn default_options() -> IntrospectionOptions
pub fn include_system_schemas(
  options: IntrospectionOptions,
) -> IntrospectionOptions
pub fn index_row_decoder() -> decode.Decoder(IndexRow)
pub fn only_schemas(
  options: IntrospectionOptions,
  schemas: List(String),
) -> IntrospectionOptions
pub fn rows_to_snapshot(
  columns: List(ColumnRow),
  constraints: List(ConstraintRow),
  indexes: List(IndexRow),
) -> model.SchemaSnapshot
pub fn to_columns_query(
  options: IntrospectionOptions,
) -> pog.Query(ColumnRow)
pub fn to_constraints_query(
  options: IntrospectionOptions,
) -> pog.Query(ConstraintRow)
pub fn to_indexes_query(
  options: IntrospectionOptions,
) -> pog.Query(IndexRow)
Search Document