Elixir,postgresql 错误:连接类型无效
Elixir, error with postgresql: has invalid types for the connection
我遇到了以下问题:
ArgumentError{message: \"query %Postgrex.Query{columns: ["id", "name", "internal", "inserted_at", "updated_at"], name: "ecto_616034", param_formats: [:binary], param_oids: [25], param_types: [Postgrex.Extensions.Raw], ref: #Reference<0.0.1.107309>, result_formats: [:binary, :binary, :binary, :binary, :binary], result_oids: [23, 1043, 16, 1184, 1184], result_types: [Postgrex.Extensions.Int4, Postgrex.Extensions.Raw, Postgrex.Extensions.Bool, Ecto.Adapters.Postgres.TimestampTZ, Ecto.Adapters.Postgres.TimestampTZ], statement: "SELECT r0.\"id\", r0.\"name\", r0.\"internal\", r0.\"inserted_at\", r0.\"updated_at\" FROM \"roles\" AS r0 WHERE (r0.\"name\" = )", types: {Ecto.Adapters.Postgres.TypeModule, 35356751}} has invalid types for the connection\"}", status: "error"}
我的模型架构定义如下:
schema "roles" do
field :name, :string
field :internal, :boolean
many_to_many :user_organizations, User.Models.UserOrganization, join_through: "roles_users_organizations"
many_to_many :sessions, User.Models.Session, join_through: "roles_sessions"
timestamps()
end
测试在我的本地机器上 运行 正常,但每次在 semaphoreci 上都会发生。我正在使用 docker-compose 和 "postgis" 图像 我已经尝试过 "postgres" 图像,结果相同。
非常感谢任何建议。
谢谢!
我在一个 umbrella 应用程序中遇到过这种情况,其中一个项目的 seeds.exs 文件错误地调用了 umbrella 应用程序中另一个应用程序的 Repo 模块。
所以,
cat app1/priv/repo/seeds.exs
### Using The right Repo module ###
App1.Stuffs.query_stuff()
|> App1.Repo.one() # <== Should look like this -- Use App1.Repo module
### Using the wrong Repo module ###
App1.ThingStuffs.query_things()
|> App2.Repo.one() # <== this was causing this error for me
我遇到了以下问题:
ArgumentError{message: \"query %Postgrex.Query{columns: ["id", "name", "internal", "inserted_at", "updated_at"], name: "ecto_616034", param_formats: [:binary], param_oids: [25], param_types: [Postgrex.Extensions.Raw], ref: #Reference<0.0.1.107309>, result_formats: [:binary, :binary, :binary, :binary, :binary], result_oids: [23, 1043, 16, 1184, 1184], result_types: [Postgrex.Extensions.Int4, Postgrex.Extensions.Raw, Postgrex.Extensions.Bool, Ecto.Adapters.Postgres.TimestampTZ, Ecto.Adapters.Postgres.TimestampTZ], statement: "SELECT r0.\"id\", r0.\"name\", r0.\"internal\", r0.\"inserted_at\", r0.\"updated_at\" FROM \"roles\" AS r0 WHERE (r0.\"name\" = )", types: {Ecto.Adapters.Postgres.TypeModule, 35356751}} has invalid types for the connection\"}", status: "error"}
我的模型架构定义如下:
schema "roles" do
field :name, :string
field :internal, :boolean
many_to_many :user_organizations, User.Models.UserOrganization, join_through: "roles_users_organizations"
many_to_many :sessions, User.Models.Session, join_through: "roles_sessions"
timestamps()
end
测试在我的本地机器上 运行 正常,但每次在 semaphoreci 上都会发生。我正在使用 docker-compose 和 "postgis" 图像 我已经尝试过 "postgres" 图像,结果相同。
非常感谢任何建议。
谢谢!
我在一个 umbrella 应用程序中遇到过这种情况,其中一个项目的 seeds.exs 文件错误地调用了 umbrella 应用程序中另一个应用程序的 Repo 模块。
所以,
cat app1/priv/repo/seeds.exs
### Using The right Repo module ###
App1.Stuffs.query_stuff()
|> App1.Repo.one() # <== Should look like this -- Use App1.Repo module
### Using the wrong Repo module ###
App1.ThingStuffs.query_things()
|> App2.Repo.one() # <== this was causing this error for me