elixir-ecto / myxql

MySQL 5.5+ driver for Elixir
Apache License 2.0
271 stars 66 forks source link

How to Set Pool Size #130

Closed besteman closed 3 years ago

besteman commented 3 years ago

Hello,

I am trying to set a pool size on the config file. I see in the docs that the

:pool - The connection pool module, defaults to DBConnection.ConnectionPool

I have the config like this for the pool:

config :db, Db.Repo,
  priv: "priv/repo",
  pool: 10,
  connect_timeout: 25000,
  loggers: [{ExJsonLogger.Ecto.Logger, :log, []}]

But I get this error:

** (FunctionClauseError) no function clause matching in Code.ensure_loaded?/1    

    The following arguments were given to Code.ensure_loaded?/1:

        # 1
        10

    Attempted function clauses (showing 1 out of 1):

        def ensure_loaded?(module) when is_atom(module)

    (elixir) lib/code.ex:1044: Code.ensure_loaded?/1
    (ecto_sql) lib/mix/tasks/ecto.migrate.ex:127: anonymous fn/5 in Mix.Tasks.Ecto.Migrate.run/2
    (elixir) lib/enum.ex:1948: Enum."-reduce/3-lists^foldl/2-0-"/3
    (ecto_sql) lib/mix/tasks/ecto.migrate.ex:121: Mix.Tasks.Ecto.Migrate.run/2
    (mix) lib/mix/task.ex:331: Mix.Task.run_task/3
    (mix) lib/mix/task.ex:365: Mix.Task.run_alias/3
    (mix) lib/mix/task.ex:292: Mix.Task.run/2
    (mix) lib/mix/cli.ex:79: Mix.CLI.run_task/2

I believe I am getting this because pool needs to atom, so I am wonder how in the config set pool to 10?

josevalim commented 3 years ago

Use pool_size: 10. :)

Btw, please use the ElixirForum or StackOverflow for questions/help/feedback, where a wider community will be able to help you. We reserve the issues tracker for issues only. Thank you!

besteman commented 3 years ago

@josevalim Thank you!