Skip to content

Conversation

@jarlah
Copy link
Member

@jarlah jarlah commented Sep 23, 2024

run task in app with

mix testcontainers.test

or

mix testcontainers.test --database mysql

env vars will be populated with:

  • DB_HOST
  • DB_USER
  • DB_PASSWORD
  • DB_PORT

these env variables can be referenced in any of the config files, like dev.exs and test.exs like:

config :my_project, MyProject.Repo,
  username: System.get_env("DB_USER") || "postgres",
  password: System.get_env("DB_PASSWORD") || "postgres",
  hostname: System.get_env("DB_HOST") || "localhost",
  port: System.get_env("DB_PORT") || "5432",
  database: "my_project_dev",
  stacktrace: true,
  show_sensitive_data_on_connection_error: true,
  pool_size: 10

this will completely remove the need for the phoenix application.ex hack.

  •  Remove/deprecate phoenix hack (ecto.ex) and update README

@jarlah jarlah merged commit 3d23f9a into main Sep 23, 2024
@jarlah jarlah deleted the add_mix_task branch September 23, 2024 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants