Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating for Ecto 3 #2

Closed
lackac opened this issue Nov 14, 2018 · 2 comments
Closed

Updating for Ecto 3 #2

lackac opened this issue Nov 14, 2018 · 2 comments

Comments

@lackac
Copy link

lackac commented Nov 14, 2018

I've been using ecto_replay_sandbox with redshift_ecto which I'm looking to update for Ecto 3. Since ecto_replay_sandbox is a dependency I started looking into updating it as well. I don't think it's going to be a simple process as much have changed in the underlying libraries (e.g. db_connection changes) so I would welcome any help or guidance.

@lackac
Copy link
Author

lackac commented Nov 14, 2018

As a first step I wanted to setup the development environment for the project in its current state. I have no experience with CockroachDB, but I managed to install it with Homebrew simply enough. However, when I try to run the tests I get the following errors:

❯ mix test
Compiling 1 file (.ex)
Generated ecto_replay_sandbox app

15:53:54.411 [error] GenServer #PID<0.255.0> terminating
** (Postgrex.Error) ERROR 42P01 (undefined_table): no data source matches prefix: t
    (db_connection) lib/db_connection/connection.ex:148: DBConnection.Connection.connect/2
    (connection) lib/connection.ex:622: Connection.enter_connect/5
    (stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
Last message: nil

15:53:54.413 [error] GenServer #PID<0.262.0> terminating
** (Postgrex.Error) ERROR 42P01 (undefined_table): no data source matches prefix: t
    (db_connection) lib/db_connection/connection.ex:148: DBConnection.Connection.connect/2
    (connection) lib/connection.ex:622: Connection.enter_connect/5
    (stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
Last message: nil
** (MatchError) no match of right hand side value: {:error, "ERROR 42P01 (undefined_table): no data source matches prefix: t"}
    test/test_helper.exs:44: (file)
    (elixir) lib/code.ex:767: Code.require_file/2
    (elixir) lib/enum.ex:765: Enum."-each/2-lists^foreach/1-0-"/2
    (elixir) lib/enum.ex:765: Enum.each/2

First I thought that I needed to create the database. That's not the case as it is automatically recreated in test/test_helper.exs:43-44. Next I suspected that there was an issue in Ecto.Adapters.Postgres.storage_up/1 in that it's explicitly using database: "postgres" when connecting to the database which doesn't exist in CockroachDB. I realise that's not an issue as changing that to "system" didn't help.

What am I doing wrong?

@tlvenn
Copy link
Member

tlvenn commented May 20, 2019

Hi @lackac , I have just released a new version compatible with Ecto 3.x, enjoy ;)

@tlvenn tlvenn closed this as completed May 20, 2019
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

No branches or pull requests

2 participants