Xqlite.PragmaSpec (Xqlite v0.7.0)

View Source

Describes the capabilities and validation rules for a single SQLite PRAGMA.

Used as the value type in the Xqlite.Pragma.schema/0 map. Each struct fully describes how a PRAGMA can be read, written, validated, and post-processed.

Fields

  • return_type — what GET returns: :int, :text, :bool, :list, or :nothing
  • read_arities — which arities support GET: [0], [1], [0, 1], or []
  • schema_prefix — whether PRAGMA db_name.pragma_name is allowed
  • writable — whether SET is supported
  • valid_values — pre-flight validation for SET: Range.t(), [term()], or nil
  • int_mapping — maps raw integer GET results to atoms (e.g. %{0 => :none})

Summary

Types

t()

@type t() :: %Xqlite.PragmaSpec{
  int_mapping: %{required(integer()) => atom() | boolean()} | nil,
  read_arities: [0 | 1],
  return_type: :int | :text | :bool | :list | :nothing,
  schema_prefix: boolean(),
  valid_values: Range.t() | [term()] | nil,
  writable: boolean()
}