Add `withInitScripts` to the SQL database modules
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 67/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- docker, typescript
- Área
- databases
Línea de trabajo
Start in the module source directories listed in the issue, and check how each database image handles initialization scripts; Java and Go examples are linked in the notes. Implement withInitScripts(...paths) in one module, preserving the supplied order and using its image init directory or database CLI as appropriate. Done means scripts run in order for that module; coordinate the method name with issue #1538.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What happens
None of the SQL database modules has a way to run a schema or seed script at startup. Their builder methods are limited to credentials and the database name:
| Module | Builder methods |
|---|---|
| postgresql | withDatabase, withUsername, withPassword, withSSL, withSSLCert |
| mysql, mariadb | withDatabase, withUsername, withUserPassword, withRootPassword |
| mssqlserver | withDatabase, withPassword, withWaitForMessage |
| cockroachdb | withDatabase, withUsername |
| clickhouse, oraclefree | withDatabase, withUsername, withPassword |
Users copy files into the image's init directory themselves, which means knowing that directory for each image:
new PostgreSqlContainer(image).withCopyFilesToContainer([
{ source: "./schema.sql", target: "/docker-entrypoint-initdb.d/schema.sql" },
]);
For images with no init directory (SQL Server), it means running the script with exec after start.
Expected
withInitScripts(...paths) on each SQL module, run in the order given, using the image's init directory where there is one and the database's CLI otherwise.
Where
packages/modules/{postgresql,mysql,mariadb,mssqlserver,cockroachdb,clickhouse,oraclefree}/src.
Notes
- Java has
withInitScriptandwithInitScriptsonJdbcDatabaseContainer, shared by every JDBC module. Go hasWithInitScriptsandWithOrderedInitScriptson postgres andWithScriptson mysql. - Each module is an independent change.
Dependencies
- Nothing blocks this. It can start now.
- Coordinate with #1538: for the method name.
- Lenguaje dominante
- TypeScript
- Estrellas
- 2.6k
- Forks
- 274
- Merge medio
- 1 d 14 h
- PR fusionados (30 d)
- 44
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de testcontainers/testcontainers-node
-
enhancement minor
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
testcontainers/testcontainers-node#1539 ·
Los mantenedores suelen responder en 1 día
-
enhancement minor
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
testcontainers/testcontainers-node#1533 ·
Los mantenedores suelen responder en 1 día
-
enhancement minor
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
testcontainers/testcontainers-node#1531 ·
Los mantenedores suelen responder en 1 día
-
enhancement minor
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
testcontainers/testcontainers-node#1529 ·
Los mantenedores suelen responder en 1 día
-
enhancement minor
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
testcontainers/testcontainers-node#1528 ·
Los mantenedores suelen responder en 1 día
Todos los issues de testcontainers/testcontainers-node
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
one-zero-eight/apply-bot#39 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
bigbluebutton/bbb-ui-components-react#108 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
high priority
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
CI-CMG/deep-sea-corals-exb#84 · 1 comentario ·