feat(persistence): Allow using custom database schema for persistence. Fixes #2452#15897
Open
jnt0r wants to merge 5 commits intoargoproj:mainfrom
Open
feat(persistence): Allow using custom database schema for persistence. Fixes #2452#15897jnt0r wants to merge 5 commits intoargoproj:mainfrom
jnt0r wants to merge 5 commits intoargoproj:mainfrom
Conversation
9dfc2e1 to
9f08db4
Compare
tico24
reviewed
Apr 14, 2026
|
|
||
| ## Customizing PostgreSQL Database Schema | ||
|
|
||
| To change the schema for the tables in PostgreSQL, set `schema:` to the desired schema in the `persistence` section of [your configuration](workflow-controller-configmap.yaml). Only available on PostgreSQL. |
Member
There was a problem hiding this comment.
Each sentence on a new line please. It make future reviews easier. Thanks!
2b19b4c to
4909fae
Compare
…ql database Signed-off-by: Jonathan Pollert <jona.pollert@gmail.com>
4909fae to
3ce2a72
Compare
…ql database Signed-off-by: Jonathan Pollert <jona.pollert@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2452
Motivation
Currently, Argo Workflows uses the default database schema for persistence. This PR introduces the ability to configure a custom schema. As MySQL does not have the concept of schemas and used the database name as kind of a schema, it is only introduced to postgres.
Key benefits:
Modifications
Verification
I adjusted the Unit Tests to verify the schema is set to the database connections only when schema is explicitly set. When the schema is not overridden the default schema is used to provide downward compatibility.
Locally tested with hack/db (setting custom dsn like it would be generated in code: -d postgres://postgres:password@host.docker.internal:5432/postgres?search_path=argo)
Also, I created a new integration test with postgres and mysql testcontainers to test the connection is correctly using the new schema.
Should I also create a new E2E test?
Documentation
Added the schema property in examples and added additional chapter to "workflow archive" chapter.