Skip to content

Add support in SqlRunnerStorage and SqlMessageStorage for setting schema #5922

@sdemjanenko

Description

@sdemjanenko

What is the problem this feature would solve?

I would like to be able to put the cluster tables in their own schema in my PG database.

What is the feature you are proposing to solve the problem?

import { SqlRunnerStorage, SqlMessageStorage } from "@effect/cluster"

// Use a separate schema for cluster tables
const clusterSchema = "cluster_schema"

const runnerStorageLayer = SqlRunnerStorage.layerWith({
  prefix: "cluster",
  schema: clusterSchema  // Tables will be: cluster_schema.cluster_runners, cluster_schema.cluster_locks
})

const messageStorageLayer = SqlMessageStorage.layerWith({
  prefix: "cluster",
  schema: clusterSchema  // Tables will be: cluster_schema.cluster_messages, cluster_schema.cluster_replies
})

What alternatives have you considered?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions