View Source AshPostgres.DataLayer.Info (ash_postgres v2.4.16)

Introspection functions for

Summary

Functions

A stringified version of the base_filter, to be used in a where clause when generating unique indexes

A keyword list of calculations to their sql representation

The configured check_constraints for a resource

The configured custom_indexes for a resource

The configured custom_statements for a resource

The configured exclusion_constraint_names

The configured foreign_key_names

A list of keys to always include in upserts.

The configured identity_index_names

Returns the literal SQL for the where clause given a resource and an identity name.

A keyword list of identity names to the literal SQL string representation of the where clause portion of identity's partial unique index.

Whether or not to create a tenant for a given resource

The template for a managed tenant

Whether or not to update a tenant for a given resource

Whether or not the resource should be included when generating migrations

A keyword list of customized migration defaults

A list of attributes to be ignored when generating migrations

A keyword list of customized migration types

Gets the resource's repo's postgres version

Checks a version requirement against the resource's repo's postgres version

The configured polymorphic? for a resource

The configured polymorphic_reference_name for a resource

The configured polymorphic_reference_on_delete for a resource

The configured polymorphic_reference_on_update for a resource

The configured reference for a given relationship of a resource

The configured references for a resource

The configured repo for a resource

The configured schema for a resource

Identities not to include in the migrations

Skip generating unique indexes when generating migrations

A keyword list of customized storage types

The configured table for a resource

The configured unique_index_names

Functions

base_filter_sql(resource)

A stringified version of the base_filter, to be used in a where clause when generating unique indexes

calculation_to_sql(resource, calc)

calculations_to_sql(resource)

A keyword list of calculations to their sql representation

check_constraints(resource)

The configured check_constraints for a resource

custom_indexes(resource)

The configured custom_indexes for a resource

custom_statements(resource)

The configured custom_statements for a resource

exclusion_constraint_names(resource)

The configured exclusion_constraint_names

foreign_key_names(resource)

The configured foreign_key_names

global_upsert_keys(resource)

A list of keys to always include in upserts.

identity_index_names(resource)

The configured identity_index_names

identity_where_to_sql(resource, identity)

@spec identity_where_to_sql(Ash.Resource.t(), atom()) :: String.t() | nil

Returns the literal SQL for the where clause given a resource and an identity name.

See identity_wheres_to_sql/1 for more details.

identity_wheres_to_sql(resource)

@spec identity_wheres_to_sql(Ash.Resource.t()) :: keyword(String.t())

A keyword list of identity names to the literal SQL string representation of the where clause portion of identity's partial unique index.

For example, given the following identity for a resource:

identities do
  identity :active, [:status] do
    where expr(status == "active")
  end
end

An appropriate identity_wheres_to_sql would need to be made to generate the correct migration for the partial index used by the identity:

postgres do
  ...

  identity_wheres_to_sql active: "status = 'active'"
end

manage_tenant_create?(resource)

Whether or not to create a tenant for a given resource

manage_tenant_template(resource)

The template for a managed tenant

manage_tenant_update?(resource)

Whether or not to update a tenant for a given resource

migrate?(resource)

Whether or not the resource should be included when generating migrations

migration_defaults(resource)

A keyword list of customized migration defaults

migration_ignore_attributes(resource)

A list of attributes to be ignored when generating migrations

migration_types(resource)

A keyword list of customized migration types

min_pg_version(resource)

Gets the resource's repo's postgres version

pg_version_matches?(resource, requirement)

Checks a version requirement against the resource's repo's postgres version

polymorphic?(resource)

The configured polymorphic? for a resource

polymorphic_name(resource)

The configured polymorphic_reference_name for a resource

polymorphic_on_delete(resource)

The configured polymorphic_reference_on_delete for a resource

polymorphic_on_update(resource)

The configured polymorphic_reference_on_update for a resource

reference(resource, relationship)

The configured reference for a given relationship of a resource

references(resource)

The configured references for a resource

repo(resource, type \\ :mutate)

The configured repo for a resource

schema(resource)

The configured schema for a resource

simple_join_first_aggregates(resource)

skip_identities(resource)

Identities not to include in the migrations

skip_unique_indexes(resource)

Skip generating unique indexes when generating migrations

storage_types(resource)

A keyword list of customized storage types

table(resource)

The configured table for a resource

unique_index_names(resource)

The configured unique_index_names