Class PostgresBaseStore.Builder

java.lang.Object
io.agentscope.extensions.postgresql.store.PostgresBaseStore.Builder
Enclosing class:
PostgresBaseStore

public static final class PostgresBaseStore.Builder extends Object
Builder for PostgresBaseStore.
  • Method Details

    • objectMapper

      public PostgresBaseStore.Builder objectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
      Sets a custom Jackson ObjectMapper for value serialisation.
    • schemaName

      public PostgresBaseStore.Builder schemaName(String schemaName)
      Sets the PostgreSQL schema name to use. If not set, SQL uses the unqualified table name for backwards compatibility.

      The provided schema name must be non-null, non-blank, and match [A-Za-z_][A-Za-z0-9_]*. The schema is created when initializeSchema(boolean) is enabled.

    • tableName

      public PostgresBaseStore.Builder tableName(String tableName)
      Overrides the table name. Identifiers must match the regex [A-Za-z_][A-Za-z0-9_]*.

      Schema and table identifiers are embedded into SQL (identifier quoting is used when a schema is configured), so validation here is the SQL-injection guard.

    • initializeSchema

      public PostgresBaseStore.Builder initializeSchema(boolean initializeSchema)
      When true, runs CREATE TABLE IF NOT EXISTS during construction. Defaults to false — production deployments usually own their schema via migration tooling.
    • build

      public PostgresBaseStore build()
      Builds the PostgresBaseStore.