Skip to content

feat: support table prefix mode as alternative to PostgreSQL schema separation #574

@donna-bsg

Description

@donna-bsg

Currently PGNamespace creates a separate PostgreSQL schema per aggregate:

  • CREATE SCHEMA IF NOT EXISTS auth;
  • Tables: auth.journal, auth.states, auth.outbox, auth.commands

This conflicts with projects using Flyway for migrations in a single schema (e.g. public).

Request: add an option to use table prefix instead of schema:

  • Tables: public.auth_journal, public.auth_states, public.auth_outbox, public.auth_commands

Example API:

// Current (schema mode)
DoobieCQRSDriver.from(PGNamespace("auth"), xa)

// Proposed (prefix mode)
DoobieCQRSDriver.from(PGNamespace.prefixed("auth"), xa)
// Creates: auth_journal, auth_states, etc. in current schema

Use case: monolith backends with shared Flyway migration history where adding PostgreSQL schemas breaks the migration workflow.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions