Current section
Files
Jump to
Current section
Files
src/glsql@ast.erl
-module(glsql@ast).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]).
-define(FILEPATH, "src/glsql/ast.gleam").
-export_type([schema_ast/0, table/0, column/0, sql_type/0, column_constraint/0, table_constraint/0]).
-type schema_ast() :: {schema_ast, list(table())}.
-type table() :: {table,
binary(),
gleam@option:option(binary()),
list(column()),
list(table_constraint()),
integer()}.
-type column() :: {column,
binary(),
sql_type(),
list(column_constraint()),
integer()}.
-type sql_type() :: {sql_type, binary(), list(binary()), integer(), integer()}.
-type column_constraint() :: {not_null, integer()} |
{nullable, integer()} |
{primary_key, integer()} |
{unique, integer()} |
{default, binary(), integer()} |
{references, binary(), list(binary()), integer()} |
{check, binary(), integer()}.
-type table_constraint() :: {table_primary_key, list(binary()), integer()} |
{table_unique, list(binary()), integer()} |
{table_foreign_key, list(binary()), binary(), list(binary()), integer()} |
{table_check, binary(), integer()}.