{"id":15003322,"url":"https://github.com/findmypast-oss/mssql_ecto","last_synced_at":"2025-08-20T20:32:11.262Z","repository":{"id":57529328,"uuid":"82792912","full_name":"findmypast-oss/mssql_ecto","owner":"findmypast-oss","description":"Ecto adapter for Mssqlex","archived":false,"fork":false,"pushed_at":"2020-01-14T04:32:31.000Z","size":240,"stargazers_count":49,"open_issues_count":12,"forks_count":20,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-08-15T22:40:51.892Z","etag":null,"topics":["ecto","ecto-adapter","elixir","erlang-odbc-application","hex","microsoft-odbc-driver","ms-sql-server","mssql","sql-server"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/findmypast-oss.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-22T10:41:06.000Z","updated_at":"2024-08-26T16:35:54.000Z","dependencies_parsed_at":"2022-08-26T03:51:20.653Z","dependency_job_id":null,"html_url":"https://github.com/findmypast-oss/mssql_ecto","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/findmypast-oss/mssql_ecto","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/findmypast-oss%2Fmssql_ecto","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/findmypast-oss%2Fmssql_ecto/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/findmypast-oss%2Fmssql_ecto/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/findmypast-oss%2Fmssql_ecto/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/findmypast-oss","download_url":"https://codeload.github.com/findmypast-oss/mssql_ecto/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/findmypast-oss%2Fmssql_ecto/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271378680,"owners_count":24749192,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-20T02:00:09.606Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ecto","ecto-adapter","elixir","erlang-odbc-application","hex","microsoft-odbc-driver","ms-sql-server","mssql","sql-server"],"created_at":"2024-09-24T18:57:59.739Z","updated_at":"2025-08-20T20:32:10.971Z","avatar_url":"https://github.com/findmypast-oss.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MssqlEcto\n\n[![Build Status](https://travis-ci.org/findmypast-oss/mssql_ecto.svg?branch=master)](https://travis-ci.org/findmypast-oss/mssql_ecto)\n[![Coverage Status](https://coveralls.io/repos/github/findmypast-oss/mssql_ecto/badge.svg)](https://coveralls.io/github/findmypast-oss/mssql_ecto)\n[![Inline docs](http://inch-ci.org/github/findmypast-oss/mssql_ecto.svg?branch=master)](http://inch-ci.org/github/findmypast-oss/mssql_ecto)\n[![Ebert](https://ebertapp.io/github/findmypast-oss/mssql_ecto.svg)](https://ebertapp.io/github/findmypast-oss/mssql_ecto)\n[![Hex.pm](https://img.shields.io/hexpm/v/mssql_ecto.svg)](https://hex.pm/packages/mssql_ecto)\n[![LICENSE](https://img.shields.io/hexpm/l/mssql_ecto.svg)](https://github.com/findmypast-oss/mssql_ecto/blob/master/LICENSE)\n\n[Ecto](https://github.com/elixir-ecto/ecto) Adapter for\n[Mssqlex](https://github.com/findmypast-oss/mssqlex)\n\n## Installation\n\n### Erlang ODBC Application\n\nMssqlEcto requires the\n[Erlang ODBC application](http://erlang.org/doc/man/odbc.html) to be installed.\nThis might require the installation of an additional package depending on how\nyou have installed Elixir/Erlang (e.g. on Ubuntu\n`sudo apt-get install erlang-odbc`).\n\n### Microsoft's ODBC Driver\n\nMssqlEcto depends on Microsoft's ODBC Driver for SQL Server. You can find\ninstallation instructions for\n[Linux](https://docs.microsoft.com/en-us/sql/connect/odbc/linux/installing-the-microsoft-odbc-driver-for-sql-server-on-linux)\nor\n[other platforms](https://docs.microsoft.com/en-us/sql/connect/odbc/microsoft-odbc-driver-for-sql-server)\non the official site.\n\n### Hex\n\n#### With [Application Inference](https://elixir-lang.org/blog/2017/01/05/elixir-v1-4-0-released/#application-inference)\n\nIf you are using\n[application inference](https://elixir-lang.org/blog/2017/01/05/elixir-v1-4-0-released/#application-inference),\ni.e. `application` in your `mix.exs` looks something like this:\n\n```elixir\ndef application do\n  [extra_applications: [:logger]]\nend\n```\n\nNote, the lack of `:applications` key. Then, you just need to add the following\ndependencies:\n\n```elixir\ndef deps do\n  [{:mssql_ecto, \"~\u003e 1.2.0\"},\n   {:mssqlex, \"~\u003e 1.1.0\"}]\nend\n```\n\n#### Without [Application Inference](https://elixir-lang.org/blog/2017/01/05/elixir-v1-4-0-released/#application-inference)\n\nIf you are explicitly calling out all running applications under `application`\nin your `mix.exs`, i.e. it looks something like this:\n\n```elixir\ndef application do\n  [applications: [:logger, :plug, :postgrex]]\nend\n```\n\nThen, you need to add `mssql_ecto` and `mssqlex` to both your `deps` and list of\nrunning applications:\n\n```elixir\ndef application do\n  [applications: [:logger, :plug, :mssqlex, :mssql_ecto]]\nend\n\ndef deps do\n  [{:mssql_ecto, \"~\u003e 1.2.0\"},\n   {:mssqlex, \"~\u003e 1.1.0\"}]\nend\n```\n\n## Configuration\n\nExample configuration:\n\n```elixir\nconfig :my_app, MyApp.Repo,\n  adapter: MssqlEcto,\n  database: \"sql_server_db\",\n  username: \"bob\",\n  password: \"mySecurePa$$word\",\n  hostname: \"localhost\",\n  instance_name: \"MSSQLSERVER\",\n  port: \"1433\"\n```\n\n## Example Project\n\nAn example project using mssql_ecto with Docker has kindly been created by\n[Chase Pursłey](https://github.com/cpursley). It can be viewed\n[here](https://github.com/cpursley/mssql_ecto_friends).\n\n## Type Mappings\n\n|    Ecto Type    |   SQL Server Type    |                                                                       Caveats                                                                        |\n| :-------------: | :------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------------: |\n|       :id       |         int          |                                                                                                                                                      |\n|     :serial     |  int identity(1, 1)  |                                                                                                                                                      |\n|   :bigserial    | bigint identity(1,1) | When a query is returning this value with the `returning` syntax and no schema is used, it will be returned as a string rather than an integer value |\n|   :binary_id    |       char(36)       |                                                                                                                                                      |\n|      :uuid      |       char(36)       |                                                                                                                                                      |\n|     :string     |       nvarchar       |                                                                                                                                                      |\n|     :binary     |    nvarchar(4000)    |                                                         Limited size, not fully implemented                                                          |\n|    :integer     |         int          |                                                                                                                                                      |\n|    :boolean     |         bit          |                                                                                                                                                      |\n| {:array, type}  |     list of type     |                                                                    Not Supported                                                                     |\n|      :map       |    nvarchar(4000)    |                                                                    Not Supported                                                                     |\n|   {:map, \\_}    |    nvarchar(4000)    |                                                                    Not Supported                                                                     |\n|      :date      |         date         |                                                                                                                                                      |\n|      :time      |         time         |                                                               Can write but can't read                                                               |\n|  :utc_datetime  |      datetime2       |                                                                                                                                                      |\n| :naive_datetime |      datetime2       |                                                                                                                                                      |\n|     :float      |        float         |                                                                                                                                                      |\n|    :decimal     |       decimal        |                                                                                                                                                      |\n\n## Features not yet implemented\n\n- Table comments\n- Column comments\n- On conflict\n- Upserts\n\n## Contributing\n\n### Integration Test Setup\n\nRunning the integration tests requires an instance of SQL Server running on\n`localhost` and certain configuration variables set as environment variables:\n\n- MSSQL_DVR should be set to the ODBC driver to be used. Usually\n  `SQL Server Native Client 11.0` on Windows, `ODBC Driver 17 for SQL Server` on\n  Linux.\n- MSSQL_UID should be set to the name of a login with sufficient permissions,\n  e.g. `sa`\n- MSSQL_PWD should be set to the password for the above account\n\nThe tests will create a database named `mssql_ecto_integration_test`\n\n### Code of Conduct\n\nThis project had a\n[Code of Conduct](https://github.com/findmypast-oss/mssql_ecto/blob/master/CODE_OF_CONDUCT.md)\nif you wish to contribute to this project, please abide by its rules.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffindmypast-oss%2Fmssql_ecto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffindmypast-oss%2Fmssql_ecto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffindmypast-oss%2Fmssql_ecto/lists"}