withInitScript method

PostgresContainer withInitScript(
  1. String hostPath
)

Runs the SQL file at hostPath when the database is created (the image's /docker-entrypoint-initdb.d/); files run in the order of their names.

Implementation

PostgresContainer withInitScript(String hostPath) {
  withCopyFile(
    hostPath,
    '/docker-entrypoint-initdb.d/${hostPath.split(RegExp(r'[/\\]')).last}',
  );
  return this;
}