ateliware / triplex

Database multitenancy for Elixir applications!
MIT License
465 stars 47 forks source link

warnings in compile #90

Open gabrielmancini opened 1 year ago

gabrielmancini commented 1 year ago

Erlang/OTP 25 [erts-13.0.4] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit:ns]

Elixir 1.14.3 (compiled with Erlang/OTP 25)

==> triplex Compiling 17 files (.ex) warning: incompatible types:

map() !~ atom()

in expression:

# lib/mix/triplex.ex:152
repo.config()

where "repo" was given the type map() (due to calling var.field) in:

# lib/mix/triplex.ex:152
repo.__adapter__

where "repo" was given the type atom() (due to calling var.fun()) in:

# lib/mix/triplex.ex:152
repo.config()

HINT: "var.field" (without parentheses) implies "var" is a map() while "var.fun()" (with parentheses) implies "var" is an atom()

Conflict found at lib/mix/triplex.ex:152: Mix.Triplex.ensure_started/2

warning: incompatible types:

map() !~ atom()

in expression:

# lib/mix/triplex.ex:117
repo.stop()

where "repo" was given the type map() (due to calling var.field) in:

# lib/mix/triplex.ex:101
repo.config

where "repo" was given the type atom() (due to calling var.fun()) in:

# lib/mix/triplex.ex:117
repo.stop()

HINT: "var.field" (without parentheses) implies "var" is a map() while "var.fun()" (with parentheses) implies "var" is an atom()

Conflict found at lib/mix/triplex.ex:117: Mix.Triplex.run_tenant_migrations/5

mscandal commented 1 year ago

@gabrielmancini did you find a solution for this?

gabrielmancini commented 1 year ago

use atom instead string to call the functions, will work