Khafra.Serialize (khafra_search v0.3.3)
Handle serialization needs of schemas and search tables.
Much of the functionality will depend on schema having implemented Khafra.SearchBehaviour
Link to this section Summary
Functions
Extract the bare field name from a column definition.
Extract bare field names from a list of column definitions.
Normalizes atom | {atom, role} | {atom, role, opts} → atom.
Return a flat list of string keys that map to search values. Accepts a full SQL query; a row result (ecto schema struct) or a keyword list row return from SQL
Return a list of search table fields derived from a database schema
A schema mapped to a search table name. If a non-schema is passed its assumed to already be a valid table name
Return a flat list of value from an entity
Link to this section Functions
field_name(name)
Extract the bare field name from a column definition.
field_names(index_defs)
Extract bare field names from a list of column definitions.
Normalizes atom | {atom, role} | {atom, role, opts} → atom.
keys(entity)
Return a flat list of string keys that map to search values. Accepts a full SQL query; a row result (ecto schema struct) or a keyword list row return from SQL
search_table_schema(arg1)
Return a list of search table fields derived from a database schema
table_name(schema)
A schema mapped to a search table name. If a non-schema is passed its assumed to already be a valid table name
values(entity)
Return a flat list of value from an entity