Class PostgresWorkspaceStore

java.lang.Object
at.aimon.memory.postgres.PostgresWorkspaceStore
All Implemented Interfaces:
at.aimon.core.memory.WorkspaceStore

public final class PostgresWorkspaceStore extends Object implements at.aimon.core.memory.WorkspaceStore
Postgres-backed WorkspaceStore per design §5.1 / §5.5.

Each workspace maps to a single row in mem_workspace keyed by id. The metadata map is stored in a JSONB column as a flat String→String object. created_at round-trips through TimestampInstant.

Cascading deletes on mem_observation and mem_representation are handled by ON DELETE CASCADE in V1__init.sql, so delete(at.aimon.core.memory.Workspace) is a single statement.

ACL note: findAll(Principal) currently performs no access control filtering — that is deferred to a future stage. Today every caller sees every row, matching the in-memory reference implementation. Production deployments must extend this method once an ACL model is in place.

  • Constructor Details

    • PostgresWorkspaceStore

      public PostgresWorkspaceStore(DataSource dataSource, com.fasterxml.jackson.databind.ObjectMapper mapper)
  • Method Details

    • create

      public at.aimon.core.memory.Workspace create(at.aimon.core.memory.Workspace workspace)
      Specified by:
      create in interface at.aimon.core.memory.WorkspaceStore
    • findById

      public Optional<at.aimon.core.memory.Workspace> findById(String id)
      Specified by:
      findById in interface at.aimon.core.memory.WorkspaceStore
    • findAll

      public List<at.aimon.core.memory.Workspace> findAll(at.aimon.core.base.Principal requester)
      Specified by:
      findAll in interface at.aimon.core.memory.WorkspaceStore
    • delete

      public void delete(at.aimon.core.memory.Workspace workspace)
      Specified by:
      delete in interface at.aimon.core.memory.WorkspaceStore