Code Monkey home page Code Monkey logo

Comments (6)

shdblowers avatar shdblowers commented on May 30, 2024

Hi @damonvjanis

Even with using mssql_ecto with the Phoenix command you also have to follow the installation instructions in the Readme. Specifically to do with installing Erlang ODBC and Microsoft's ODBC Driver.

from mssql_ecto.

shdblowers avatar shdblowers commented on May 30, 2024

After doing this please let me know if you still cannot get it working.

from mssql_ecto.

damonvjanis avatar damonvjanis commented on May 30, 2024

@shdblowers thanks for taking a look at this.

I apologize, I should have included those details in the original request.

Before running mix phx.new, I had verified that Erlang ODBC was accessible on my system by opening an Erlang shell and entering 1>odbc.start() which returned a response of ok.

I had also previously verified that my environment had the Microsoft ODBC driver by attempting to install the driver (version 13) from the download page, and when it went to install the system informed me that I already had the current version installed. I double-checked by navigating to the 64 bit ODBC application in Windows, selecting the Drivers tab, and the driver was listed.

I've done a little more digging on the issue and here's what I'm finding:

In mssql_ecto/lib/mssql_ecto/query_string line 251, there is a key value pair fields: fields. This is what was throwing the compile error. I took a look in Ecto for where %Ecto.SubQuery{} was being defined, and it's in ecto/lib/ecto/query.ex. On line 5, the struct is defined with the following: defstruct [:query, :params, :select, :cache].

The error is happening because :fields is not on that list. I looked through the GitHub history and found that line 5 changed on August 4th, removing :fields (link to history here).

I was able to get around the compile error by changing fields: fields to params: fields in mssql_ecto/query_string.ex, and I was able to successfully connect to my database. I don't understand Ecto, MSSQL_Ecto or Elixir at a deep enough level to know what the correct fix is, but if I have some time I'll dive into the details and see if I can be more confident in proposing a solution.

from mssql_ecto.

jbachhardie avatar jbachhardie commented on May 30, 2024

I think this is related to #25, right @shdblowers ?

We're not quite there yet with Ecto 2.2 compatibility and I believe the template scaffolds up that version. You should be able to downgrade to Ecto 2.1.x and have everything work.

from mssql_ecto.

shdblowers avatar shdblowers commented on May 30, 2024

Yes I think so too @jbachhardie.

Will release a patch for this version that changes the dependency on ecto from 2.1 to 2.1.0, which should make this issue more clear.

Will also continue on upgrading to 2.2 when I can

from mssql_ecto.

shdblowers avatar shdblowers commented on May 30, 2024

That's been done now, here: ae2d567

from mssql_ecto.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.