Comments (16)
actually @RobStallion @katbow , I just got it to work. Had your same error but after adding deps to applications
def application do
[mod: {BlogPhoenix, []},
applications: [:phoenix, :phoenix_pubsub, :cowboy, :logger, :gettext,
:phoenix_ecto, :mssqlex, :mssql_ecto]]
and REMOVING
- odbc_driver: "{ODBC Driver 13.1 for SQL Server}"
it worked!
from mssql_ecto.
The default version of Erlang on MacOS does not include Erlang ODBC, could you try to install Erlang via Kerl and follow kerls instructions to enable Erlang ODBC.
If you are still unable to get ODBC to work on MacOS then a fallback solution could be to run your project in a docker container, this is how I develop elixir projects that connect to SQL Server on MacOS.
from mssql_ecto.
@katbow we would like to support mssql_ecto on MacOS in a more official sense and are willing to provide further assistance in order to achieve that.
Hopefully, the resolution of this ticket will include updating our README.md to include instructions specific to MacOS, if the current instructions are relevant. Any help on that from you or @toddharding would be great, as I don't own a MacBook 😓
from mssql_ecto.
@toddharding Yes, I was having that issue initially where Erlang ODBC was not included in the version of Erlang I had installed. I managed to get it installed with ODBC. I double checked it was included by running odbc:module_info().
in the Erlang console.
@shdblowers thanks, I'll keep at it for a bit & let you know if I find a solution 👍 .
from mssql_ecto.
@katbow it could be that the version of the ODBC driver you've installed doesn't match up with what mssqlex expects. See this.
Looking at finding a solution...
from mssql_ecto.
@katbow try adding the last line to your config:
config :my_app, MyApp.Repo,
adapter: MssqlEcto,
username: "<my_username>",
password: "<my_password>",
database: "test",
hostname: "<my_server>.database.windows.net",
pool_size: 10
odbc_driver: "{ODBC Driver 13.1 for SQL Server}"
I'm not sure if that will be the correct name of the ODBC driver you have installed on you MacOS. Not sure how to check at this point.
from mssql_ecto.
@toddharding. I have also tried all of the suggestions to this point but have still been experiencing the same issue. I have also added a Vagrantfile to test things in an linux environment but have still had the same issue.
I have also tried querying the DB with node running in the linux environment and that worked as expected. That code is in the repo that can be found here: https://github.com/RobStallion/azure-elixir.
If anything is unclear or you would like any more information please let me know.
from mssql_ecto.
I've just been through all the steps the healthlocker people have been through. Same exact path. Installed erlang on iOS with kerl, verified odbc is working, installed microsoft driver. Same dead end. If this is a problem in linux too that's not good.
from mssql_ecto.
Thanks for doing some debugging @ssomnoremac
My current thoughts are that the :mssqlex
app is not getting started when only adding :mssql_ecto
to the list of dependencies.
I will try and investigate this further...
from mssql_ecto.
I can't replicate this bug on my Linux/Ubuntu environment, but my theory is that adding both mssql_ecto
and mssqlex
to the list of deps will fix the bug.
i.e. (with Elixir 1.4)
applications will look like:
def application do
[mod: {Throwaway.Application, []},
extra_applications: [:logger, :runtime_tools]]
end
and deps:
defp deps do
[{:mssql_ecto, "~> 0.1"},
{:mssqlex, "~> 0.6"},
...]
end
Could someone with a Mac please confirm?
from mssql_ecto.
@shdblowers I had both mssql_ecto
and mssqlex
in the list of deps as you have said above but I could not get it to work like that on mac or ubuntu.
Following what @ssomnoremac mentioned is the only way I have ben able to get things working (massive thanks btw to everyone for continuing to look into this and get back to us). Otherwise, I was repeatedly getting the same error mentioned by @katbow when the issue was opened..
[error] Mssqlex.Protocol (#PID<0.3246.0>) failed to connect: ** (Mssqlex.Error) odbc_not_started
.
I only needed to add mssqlex to the application list to remove the error. Just thought I would mention that incase it helped clear things up
from mssql_ecto.
@shdblowers Also I have this working on mac (to answer your original question 😄)
from mssql_ecto.
I'm glad you've managed to get this working @RobStallion @katbow.
Thanks for your help @ssomnoremac.
I think this issue can be closed once the readme has been updated to reflect how you managed to get things to work.
I had a look over your mix.exs
file on Health Locker here
I think the problem is understanding how application inference works with Elixir 1.4
I will update the readme to show how to get it to work both with and without application inference, as I think this will be a common issue in Elixir until application inference becomes the standard in everyone's mix.exs
files.
I think it would also be useful to add to the readme the steps you took to get it working on MacOS and was looking for help on that front.
from mssql_ecto.
@ssomnoremac thanks very much!
@shdblowers Oh I see, thanks for that. That's useful to know as it cleans up the config a lot. @RobStallion and I can update the README with instructions for macOS (probably on the weekend, though).
Really appreciate the help everyone!
from mssql_ecto.
@katbow let me know how it goes. For some reason I'm having issues with my associations. I'm not sure if it's an issue with this library or not, or if it's because my table names are capitalized, or if it's an issue with Absinthe-ecto, or my setup, or what. I'm using an existing Azure db so there's a bit to tackle.
from mssql_ecto.
actually solved the association issue, had to be careful with plural fields for that.
from mssql_ecto.
Related Issues (20)
- support for xml column type HOT 4
- Variable insertion misaligned with using WHERE IN HOT 4
- Run tests using latest version of Elixir
- Support for uniqueidentifier / UUIDs HOT 5
- Installing Erlang ODBC on Windows 2012 R2 HOT 9
- Encoding issues with nvarchar(max) columns? HOT 1
- Support Ecto 2.2 HOT 7
- App created with phx.new test --database mssql won't compile HOT 6
- DML statement cannot have any enabled triggers if the statement contains an OUTPUT clause without INTO clause. HOT 10
- Compilation error in file lib/mssql_ecto/query_string.ex == HOT 1
- How to handle capital letters in database column HOT 1
- UUID ** (ArgumentError) invalid or unknown type :uuid for field :DemoCategoryKey HOT 2
- Column type not supported | ODBC_CODE | SQL_SERVER_CODE 0 using type uniqueidentifier HOT 1
- Difficulty setting up HOT 9
- Can't open lib HOT 1
- Concurrent DB Tests Failing HOT 1
- Alter table remove column migration removes primary key
- Associations do not work with non-standard primary keys HOT 3
- Preloading associations with differing schemas fails
- Ecto-3 support. HOT 18
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mssql_ecto.