Liking cljdoc? Tell your friends :D

boundary.user.shell.persistence

Shell layer for user module - implements user ports using database storage.

This namespace contains the SHELL (I/O) implementation that handles database persistence. In FC/IS architecture, this is the SHELL that:

  • Handles all I/O operations (database reads/writes)
  • Manages external system interactions
  • Contains side effects and impure operations
  • Implements boundary.user.ports interfaces
  • Transforms between domain entities and database records

Key FC/IS principles:

  • ALL business logic stays in boundary.user.core.*
  • This is ONLY for I/O and persistence concerns
  • No business decisions made here - only data transformation
  • Shell coordinates with core for business logic

This provides proper FC/IS separation where:

  • Core contains pure business logic (no I/O)
  • Shell handles all I/O and external systems
  • Clean boundary between functional and imperative code
Shell layer for user module - implements user ports using database storage.

This namespace contains the SHELL (I/O) implementation that handles database persistence.
In FC/IS architecture, this is the SHELL that:
- Handles all I/O operations (database reads/writes)
- Manages external system interactions
- Contains side effects and impure operations
- Implements boundary.user.ports interfaces
- Transforms between domain entities and database records

Key FC/IS principles:
- ALL business logic stays in boundary.user.core.*
- This is ONLY for I/O and persistence concerns
- No business decisions made here - only data transformation
- Shell coordinates with core for business logic

This provides proper FC/IS separation where:
- Core contains pure business logic (no I/O)
- Shell handles all I/O and external systems
- Clean boundary between functional and imperative code
raw docstring

create-audit-repositoryclj

(create-audit-repository ctx pagination-config)

Create a user audit log repository instance using database storage.

Args: ctx: Database context from boundary.platform.shell.adapters.database.factory pagination-config: Pagination configuration map with :default-limit

Returns: DatabaseUserAuditRepository implementing IUserAuditRepository

Example: (create-audit-repository ctx pagination-config)

Create a user audit log repository instance using database storage.

Args:
  ctx: Database context from boundary.platform.shell.adapters.database.factory
  pagination-config: Pagination configuration map with :default-limit
  
Returns:
  DatabaseUserAuditRepository implementing IUserAuditRepository
  
Example:
  (create-audit-repository ctx pagination-config)
sourceraw docstring

create-session-repositoryclj

(create-session-repository ctx)

Create a user session repository instance using database storage.

Args: ctx: Database context from boundary.platform.shell.adapters.database.factory

Returns: DatabaseUserSessionRepository implementing IUserSessionRepository

Example: (create-session-repository ctx)

Create a user session repository instance using database storage.

Args:
  ctx: Database context from boundary.platform.shell.adapters.database.factory
  
Returns:
  DatabaseUserSessionRepository implementing IUserSessionRepository
  
Example:
  (create-session-repository ctx)
sourceraw docstring

create-user-repositoryclj

(create-user-repository ctx)

Create a user repository instance using database storage.

Args: ctx: Database context from boundary.platform.shell.adapters.database.factory

Returns: DatabaseUserRepository implementing IUserRepository

Example: (create-user-repository ctx)

Create a user repository instance using database storage.

Args:
  ctx: Database context from boundary.platform.shell.adapters.database.factory
  
Returns:
  DatabaseUserRepository implementing IUserRepository
  
Example:
  (create-user-repository ctx)
sourceraw docstring

initialize-user-schema!clj

(initialize-user-schema! ctx)

Initialize database schema for user entities using Malli schema definitions.

Creates the following tables:

  • auth_users: Global authentication records (email, password, MFA, lockout)
  • users: Tenant-specific user profiles (name, role, avatar, preferences)
  • user_sessions: User authentication sessions
  • user_audit_log: Audit trail for user operations

Includes indexes for:

  • Foreign keys (user_id)
  • Unique constraints (email, session tokens)
  • Query performance (role, active status, expiration dates)
  • Audit trail queries (target_user_id, actor_id, created_at)

On PostgreSQL, also creates:

  • search_vector GENERATED column for full-text search on users.name
  • GIN index on search_vector for fast full-text search queries

Note: This creates the split-table architecture for multi-tenancy support. Auth data lives in public.auth_users, profile data in tenant-specific users table.

Args: ctx: Database context

Returns: nil

Example: (initialize-user-schema! ctx)

Initialize database schema for user entities using Malli schema definitions.

Creates the following tables:
- auth_users: Global authentication records (email, password, MFA, lockout)
- users: Tenant-specific user profiles (name, role, avatar, preferences)
- user_sessions: User authentication sessions
- user_audit_log: Audit trail for user operations

Includes indexes for:
- Foreign keys (user_id)
- Unique constraints (email, session tokens)
- Query performance (role, active status, expiration dates)
- Audit trail queries (target_user_id, actor_id, created_at)

On PostgreSQL, also creates:
- search_vector GENERATED column for full-text search on users.name
- GIN index on search_vector for fast full-text search queries

Note: This creates the split-table architecture for multi-tenancy support.
Auth data lives in public.auth_users, profile data in tenant-specific users table.

Args:
  ctx: Database context

Returns:
  nil

Example:
  (initialize-user-schema! ctx)
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close