Based on findmypast-oss/mssql_ecto
OracleEcto requires the Erlang ODBC application to be installed.
This might require the installation of an additional package depending on how you have installed Elixir/Erlang (e.g. on Ubuntu sudo apt-get install erlang-odbc
).
OracleEcto depends on Oracle's ODBC Driver. See the Dockerfile for how to install.
You need to add the following dependencies to your application:
def deps do
[
{:oracle_ecto, github: "MikeAlbertFleetSolutions/oracle_ecto"},
{:oracleex, github: "MikeAlbertFleetSolutions/oracleex"}
]
end
Be sure to run mix deps.get
Example configuration:
config :my_app, MyApp.Repo,
adapter: OracleEcto,
dsn: "OracleODBC-12c",
service: "db",
username: "jeff",
password: "password1"
Tests require an instance of Oracle to be running on localhost
and the appropriate environment
variables to be set. See the docker-compose file for details
docker-compose up db
docker-compose run oracle_ecto
mix deps.get
mix test
- I started down this project because we have a very large existing Oracle database that our apps need to leverage. I tried to implement so this would be reusable by others regardless of their situation but sometimes fell back to just making it work for our use case in order to save time.
- As of Oracle 12c, there is a concept of Identity Columns but no good 'Returning' functionality so the tests had to be changed to provide IDs.
- I struggle with Ecto's prefix for the schema_migration table so now I just assume no prefix.
- Oracle is case sensitive when you quote names so now I force everything to uppercase (back to point #1, that was the naming convention already in place).