-module(gleager@types). -compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]). -define(FILEPATH, "src/gleager/types.gleam"). -export_type([migration_error/0, migration/0, migration_op/0, migration_row/0, driver/1]). -if(?OTP_RELEASE >= 27). -define(MODULEDOC(Str), -moduledoc(Str)). -define(DOC(Str), -doc(Str)). -else. -define(MODULEDOC(Str), -compile([])). -define(DOC(Str), -compile([])). -endif. ?MODULEDOC( " Types used by the Gleager migration engine.\n" "\n" " The central type is `Driver(e)`, which abstracts over database backends so\n" " that gleager can work with any Gleam SQL library. The `e` type parameter\n" " represents the database library's native error type, which gets mapped\n" " to `MigrationError` by gleager's internal functions.\n" ). -type migration_error() :: {file_not_found, binary()} | {unable_to_read, binary()} | {invalid_migration_version, binary()} | schema_table_failed | select_migrations_failed | {insert_migration_failed, binary()} | {delete_migration_failed, binary()} | {migration_statement_failed, binary()} | {up_migration_failed, binary()} | {down_migration_failed, binary()}. -type migration() :: {migration, binary(), binary(), binary()}. -type migration_op() :: up | down | {generate, binary()}. -type migration_row() :: {migration_row, binary()}. -type driver(EOR) :: {driver, binary(), fun((binary(), list(binary())) -> {ok, nil} | {error, EOR}), fun((binary(), list(binary()), gleam@dynamic@decode:decoder(migration_row())) -> {ok, list(migration_row())} | {error, EOR})}.