Bonfire.Me.Accounts.Queries (Bonfire v1.0.1-social-alpha.9)

View Source

Queries for Bonfire.Me.Accounts

Summary

Functions

Finds an account by email confirmation token.

Finds an account by email address.

Counts the total number of accounts, or counts the number of records in the provided query.

Retrieves the current account by ID.

Lists all accounts with their email addresses and associated user details. Useful for admin purposes to see all registered emails and usernames. Only includes accounts that have an email address. Returns only the first created user per account (based on user ID/ULID).

Find an account by ID, preloading email and credential information.

Find an account by email address, preloading email and credential information.

Find an account by username, preloading the user (with character, and profile information).

Functions

by_confirm_token(token)

Finds an account by email confirmation token.

Examples

iex> by_confirm_token("some_token")
#Ecto.Query<...>

by_email(email)

Finds an account by email address.

Examples

iex> Bonfire.Me.Accounts.Queries.by_email("example@example.com")
#Ecto.Query<...>

count(q \\ Account)

Counts the total number of accounts, or counts the number of records in the provided query.

Examples

iex> Bonfire.Me.Accounts.Queries.count()

iex> Bonfire.Me.Accounts.Queries.count(from(a in Account, where: a.active == true))

current(id)

Retrieves the current account by ID.

Examples

iex> Bonfire.Me.Accounts.Queries.current("some_id")

list_with_emails()

Lists all accounts with their email addresses and associated user details. Useful for admin purposes to see all registered emails and usernames. Only includes accounts that have an email address. Returns only the first created user per account (based on user ID/ULID).

Examples

iex> Bonfire.Me.Accounts.Queries.list_with_emails()
#Ecto.Query<...>

login_by_account_id(id)

Find an account by ID, preloading email and credential information.

login_by_email(email)

Find an account by email address, preloading email and credential information.

login_by_username(username)

Find an account by username, preloading the user (with character, and profile information).