BlogEngine.Tags (blog_engine v0.1.0)

Copy Markdown View Source

Race-safe tenant tag normalization and lookup.

Summary

Functions

Fetches tenant tags strictly in first-occurrence input order.

Finds or atomically creates a normalized tenant tag.

Lists tenant tags ordered by name and ID.

Searches tenant tag names literally with a deterministic 20-row limit.

Functions

fetch_many(context, ids)

@spec fetch_many(BlogEngine.Context.t(), [term()]) ::
  {:ok, [BlogEngine.Schema.Tag.t()]} | {:error, BlogEngine.Error.t()}

Fetches tenant tags strictly in first-occurrence input order.

find_or_create(context, name)

@spec find_or_create(BlogEngine.Context.t(), String.t()) ::
  {:ok, BlogEngine.Schema.Tag.t()}
  | {:error, BlogEngine.Error.t() | Ecto.Changeset.t()}

Finds or atomically creates a normalized tenant tag.

list(context)

Lists tenant tags ordered by name and ID.

search(context, search)

Searches tenant tag names literally with a deterministic 20-row limit.