testcontainers / testcontainers/testcontainers-java

Allow for an init script that runs as the database admin (superuser) for JdbcTestContainer implementations

Open
#585 5 comments 12 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

modules/jdbc resolution/acknowledged resolution/somedaymaybe
Dominant language
Java
Stars
8.7k
Forks
1.9k
Avg merge
2d 17h
Merged PRs (30d)
9

Description

This would allow customized setup that just isn't possible as the "test" user.

TC_INITSCRIPT_SUPER parameter maybe?

This would ideally run before the

TC_INITSCRIPT

so there is an opportunity to configure things before the main real-user based init script runs.

Example Usages...

  1. Setting up multischema databases (that utilize joins across schemas)
  2. Some stored procedure creation DDLs need admin/root access on the DB
  3. Custom database/schema naming
  4. Grants

As a side-note it would be nice to have a code-based way to get a connection as the admin/root user for code based configuration that requires it.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the JdbcTestContainer implementations and the existing TC_INITSCRIPT handling. Trace how initialization scripts and database-user connections are configured, then verify that a superuser setup runs before the main test-user script and supports the listed schema, DDL, naming, and grant use cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, java
Domain
databases, testing
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.