findmypast-oss / mssql_ecto

Ecto adapter for Mssqlex
Apache License 2.0
49 stars 20 forks source link

Expected MssqlEcto to implement Ecto.Adapter.Storage in order to to create storage #8

Closed P4l closed 7 years ago

P4l commented 7 years ago

In a Phoenix-project when I run mix test I get the following error:

(Mix) Expected MssqlEcto to implement Ecto.Adapter.Storage in order to to create storage for MyApp.Repo

The app works in development environment where I can connect to the MS SQL server.

Am I missing something in my configuration (see below) or is this an error?

Thank you for your help!

Expected Behavior

mix test should run because I didn't change anything except adding mssql_ecto as a dependency.

Current Behavior

mix test doesn't work as it did bevor I've added mssql_ecto as a dependency.

Steps to Reproduce (for bugs)

  1. Create a new Phoenix App
  2. add dependency mssql_ecto
  3. add mssql_ecto repo to config/test config :my_app, MyApp.Repo, adapter: MssqlEcto, database: "mydb_test", username: "user", password: "pwd", hostname: "localhost", odbc_driver: "{SQL Server Native Client 11.0}", pool: 10 # pool: Ecto.Adapters.SQL.Sandbox
  4. run mix test

Context

Run mix test doesn't work

Your Environment

jbachhardie commented 7 years ago

This is indeed a bug, an oversight on our part since we don't use the storage functionality in production. I'll push a patch shortly.

Thank you for the report.

jbachhardie commented 7 years ago

storage_up is callable in 0.1.3 but there still seems to be an issue where the correct error isn't returned when the database is already up. Looking into it.

jbachhardie commented 7 years ago

Yeah, apparently SQL Server (or at least some versions) unhelpfully returns ODBC code 42000 rather than 42S01 when the table already exists. I'll need to patch Mssqlex for that one.

jbachhardie commented 7 years ago

OK, tested as working with mssql_ecto 0.1.4 and mssqlex 0.6.5.

Thank you for bringing this to our attention.