Add `withInitScripts` to the SQL database modules
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 67/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- docker, typescript
- Ambito
- databases
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- TypeScript
- Stelle
- 2.6k
- Fork
- 274
- Merge medio
- 1g 14h
- PR unite (30g)
- 44
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di testcontainers/testcontainers-node
-
enhancement minor
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
testcontainers/testcontainers-node#1539 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement minor
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
testcontainers/testcontainers-node#1533 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement minor
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
testcontainers/testcontainers-node#1531 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement minor
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
testcontainers/testcontainers-node#1529 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement minor
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
testcontainers/testcontainers-node#1528 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di testcontainers/testcontainers-node
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
status:approved type:bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 70/100
egdev6/quorb#109 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
stage:4
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
ilan-pinto/roaring-lions#598 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Frontmatter next to `src:` is applied to every imported slide, not only the first (undocumented)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno