Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Add `withInitScripts` to the SQL database modules

オープン
#1,574 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
67/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
docker, typescript
領域
databases

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

enhancement minor

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 withInitScript and withInitScripts on JdbcDatabaseContainer, shared by every JDBC module. Go has WithInitScripts and WithOrderedInitScripts on postgres and WithScripts on mysql.
  • Each module is an independent change.

Dependencies

  • Nothing blocks this. It can start now.
  • Coordinate with #1538: for the method name.
主要言語
TypeScript
スター
2.6k
フォーク
277
平均マージ
1日 53分
マージ済み PR(30日)
58

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

testcontainers/testcontainers-node のほかの issue

testcontainers/testcontainers-node の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。