Skip to content

user_dao

User data access object (DAO) module.

Classes

UserDao

UserDao(session: Session)

Bases: BaseDao

Human user data access object (DAO)

Attributes

model_class property
model_class: Type[User]

Functions

get_in_namespace
get_in_namespace(
    *,
    namespace_key: str,
    resource_key: str,
    filter_deleted: bool = True,
    filter_disabled: bool = True
) -> User | None

Retrieve an User in a specified namespace by its primary key ID or name.

Parameters:

  • namespace_key (str) –

    The primary key ID of the namespace.

  • resource_key (str) –

    The primary key ID or name of the user.

  • filter_deleted (bool, default: True ) –

    Whether to filter out deleted activity sessions. Defaults to True.

  • filter_disabled (bool, default: True ) –

    Whether to filter out disabled activity sessions. Defaults to True.

Returns:

  • User | None

    User | None: The matching User or None if not found.

hard_delete_by_user_pkid
hard_delete_by_user_pkid(user_pkid: str) -> int

Hard delete a specific agent.

Parameters:

  • agent_pkid (str) –

    The pkid of the agent.

Returns:

  • int ( int ) –

    The number of deleted rows.