{"id":20291419,"url":"https://github.com/k2informaticsgmbh/erloci","last_synced_at":"2025-10-13T16:49:17.993Z","repository":{"id":8566342,"uuid":"10193724","full_name":"K2InformaticsGmbH/erloci","owner":"K2InformaticsGmbH","description":"Erlang Oracle native driver - DEPRECATED, see https://github.com/K2InformaticsGmbH/oranif instead","archived":false,"fork":false,"pushed_at":"2019-07-25T15:43:44.000Z","size":8767,"stargazers_count":37,"open_issues_count":27,"forks_count":11,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-04-11T11:55:43.872Z","etag":null,"topics":["archived-repository","c-plus-plus","database","deprecated","deprecated-repo","erlang","erlang-driver","instantclient","obselete","oci","oracle","thread-pool"],"latest_commit_sha":null,"homepage":"","language":"C++","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/K2InformaticsGmbH.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-05-21T11:02:04.000Z","updated_at":"2021-12-07T15:50:59.000Z","dependencies_parsed_at":"2022-09-07T04:52:13.790Z","dependency_job_id":null,"html_url":"https://github.com/K2InformaticsGmbH/erloci","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/K2InformaticsGmbH/erloci","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/K2InformaticsGmbH%2Ferloci","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/K2InformaticsGmbH%2Ferloci/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/K2InformaticsGmbH%2Ferloci/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/K2InformaticsGmbH%2Ferloci/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/K2InformaticsGmbH","download_url":"https://codeload.github.com/K2InformaticsGmbH/erloci/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/K2InformaticsGmbH%2Ferloci/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279016110,"owners_count":26085802,"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-10-13T02:00:06.723Z","response_time":61,"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":["archived-repository","c-plus-plus","database","deprecated","deprecated-repo","erlang","erlang-driver","instantclient","obselete","oci","oracle","thread-pool"],"created_at":"2024-11-14T15:12:17.658Z","updated_at":"2025-10-13T16:49:17.970Z","avatar_url":"https://github.com/K2InformaticsGmbH.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DEPRECATED\nThis is no longer supported, please consider using [oranif](https://github.com/K2InformaticsGmbH/oranif) instead.\n\n# erloci - An Erlang driver for the Oracle Call Interface\n\n[![Build Status](https://travis-ci.org/K2InformaticsGmbH/erloci.svg?branch=master)](https://travis-ci.org/K2InformaticsGmbH/erloci) [![Coverage Status](https://coveralls.io/repos/github/K2InformaticsGmbH/erloci/badge.svg?branch=master)](https://coveralls.io/github/K2InformaticsGmbH/erloci?branch=master)\n\n### Users\n\u003ca href=\"http://www.k2informatics.ch/\"\u003e\n  \u003cimg src=\"http://www.k2informatics.ch/logo.gif\" alt=\"K2 Informatics GmbH\"\u003e\n\u003c/a\u003e\n\u003ca href=\"http://privatbank.ua/\"\u003e\n  \u003cimg src=\"https://privatbank.ua/favicon.ico\" alt=\"Privat Bank, Ukraine\"\u003e\n\u003c/a\u003e\n\n### Setup the development system\nCreate a environment variable OTPROOT pointing to erlang installation directory,\ne.g. - in linux (if installed from RPM) its usually /usr/lib/erlang.\nDownload from [Oracle](http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html) the following libraries (for matching os and platfrom for the development system)\n  1. instantclient-basic\n  2. instantclient-sdk\n\n### Windows\nUnzip both into a directory and create the following enviroment variable\nE.g. - if your instant client library version is 12.1 and you have unzipped 'instantclient-basic-windows*.zip' to C:\\Oracle\\instantclient\\instantclient_12_1 then the sdk should be at C:\\Oracle\\instantclient\\instantclient_12_1\\sdk\\\nThe include headers will be at C:\\Oracle\\instantclient\\instantclient_12_1\\sdk\\include and static libraries at C:\\Oracle\\instantclient\\instantclient_12_1\\sdk\\lib\\msvc (note the path for VS project configuration later)\n\n### Linux / Mac OS X\nRequired system libraries\n```\nlibevent\nlibevent-devel\n```\nUse rpms (recomended) to install basic and sdk. The default install path is usually (for x86_64 architecture)\nFor Mac you may use Homebrew (http://brew.sh) as package manager to install it.\n```\nOCI Headers     : /usr/include/oracle/12.1/client64/\nOCI Libraries   : /usr/lib/oracle/12.1/client64/lib/\n```\n\n### Create Environment variables\n```\nINSTANT_CLIENT_LIB_PATH     = path to oci libraries\nINSTANT_CLIENT_INCLUDE_PATH = path to oci headers\nERL_INTERFACE_DIR           = path to erl_interface or erlang installation\n```\nExample `.bashrc` snippet:\n```sh\n...\nINSTANT_CLIENT_LIB_PATH=$(find /usr/lib/oracle/ -type d -name client64)/lib\nINSTANT_CLIENT_INCLUDE_PATH=$(find /usr/include/oracle/ -type d -name client64)\nERL_INTERFACE_DIR=$(find /usr/lib/erlang/lib/ -type d -name erl_interface-*)\n\nexport INSTANT_CLIENT_LIB_PATH\nexport INSTANT_CLIENT_INCLUDE_PATH\nexport ERL_INTERFACE_DIR\n...\n```\n\nFor example:\n```\n(x64 Fedora)\nINSTANT_CLIENT_LIB_PATH     = /usr/lib/oracle/12.1/client64/lib/\nINSTANT_CLIENT_INCLUDE_PATH = /usr/include/oracle/12.1/client64/\nERL_INTERFACE_DIR           = /usr/lib64/erlang/lib/erl_interface-3.7.15\n\n\n(x64 Windows 7)\nINSTANT_CLIENT_LIB_PATH     = C:\\Oracle\\instantclient\\instantclient_12_1\\\nERL_INTERFACE_DIR           = C:\\Program Files\\erlang\\erl5.10.4\\lib\\erl_interface-3.7.15\n```\n\n### Ubuntu (14.04.2 LTS 'trusty')\n```\nsudo apt-get install libevent-dev\nsudo apt-get install alien dpkg-dev debhelper build-essential\nsudo alien oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64.rpm\nsudo alien oracle-instantclient12.1-devel-12.1.0.2.0-1.x86_64.rpm\nsudo dpkg -i oracle-instantclient12.1-basic_12.1.0.2.0-2_amd64.deb\nsudo dpkg -i oracle-instantclient12.1-devel_12.1.0.2.0-2_amd64.deb\n\n~/.profile\nexport INSTANT_CLIENT_LIB_PATH=\"/usr/lib/oracle/12.1/client64/lib/\"\nexport INSTANT_CLIENT_INCLUDE_PATH=\"/usr/include/oracle/12.1/client64/\"\nexport ERL_INTERFACE_DIR=\"/usr/lib/erlang/lib/erl_interface-3.8.2\"\n```\n\n### Compiling\nWe assume you have [rebar3](https://www.rebar3.org/) somewhere on your path. Rebar3 will take care of the Erlang and C++ sources.\n\u003ccode\u003erebar3 compile\u003c/code\u003e\nPlease check the rebar3 documentation for how to add erloci as a dependency to your project.\n\n**DEPRICATION WARNING** Visual Studio 2008 and Visual Studio 2013 are no longer supported please build with Visual Studio 2017 (Community Edition) instead\n\nIssue `rebar3 compile` as usual; then don't forget to revert temporarily changed vcxproj files: `git reset --hard`.\n\n__NOTE__: Setting the environment variables for the comand line tools might be needed: ``\"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Auxiliary\\Build\\vcvarsall.bat\" x64``\n\n### 3rd party dependencies\n#### Threadpool\nThe threadpool code (threadpool.cpp/h) is developed by Mathias Brossard mathias@brossard.org. His threadpool library is hosted at https://github.com/mbrossard/threadpool.\nThis library is unused (not linked) in a Windows environment. For an easier installation process we include the required threadpool files in the erloci repo. So this is NOT a dependency you have to resolve by yourself.\n\n#### Oracle Call Interface (OCI)\nOCI provides a high performance, native 'C' language based interface to the Oracle Database. There is no ODBC layer between your application and the database. Since we don't want to distribute the Oracle Code you MUST download the OCI Packages (basic and devel) from the Oracle Website: http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html.\n\n#### Compile ERLOCI in Windows command line\nMake sure you have `MSbuild.exe` in path. After that `rebar3 compile` will take care the rest. Currently erloci can only be build with VS2008.\n\n### Erlang to/from Oracle datatype mapping (currently)\n\noracle|erlang\n---|---\nSQLT_INT|integer()\nSQLT_CHR,SQLT_AFC|binary()\nSQLT_FLT|float()\nSQLT_IBDOUBLE|float()\nSQLT_BIN|binary()\nSQLT_DAT|binary()\nSQLT_TIMESTAMP|binary()\nSQLT_TIMESTAMP_LTZ|binary()\nSQLT_INTERVAL_YM|binary()\nSQLT_INTERVAL_DS|binary()\nSQLT_IBFLOAT|float()\n\n### Eunit test\nThe database user `\u003c\u003cdb_user\u003e\u003e` must have at least the following privileges:\n\n\t-- Roles\n\tGRANT CONNECT TO \u003c\u003cdb_user\u003e\u003e;\n\tGRANT RESOURCE TO \u003c\u003cdb_user\u003e\u003e;\n\tALTER USER \u003c\u003cdb_user\u003e\u003e DEFAULT ROLE ALL;\n\t-- System Privileges\n\tGRANT ALTER SESSION TO \u003c\u003cdb_user\u003e\u003e;\n\tGRANT ALTER SYSTEM TO \u003c\u003cdb_user\u003e\u003e;\n\tGRANT CREATE ANY DIRECTORY TO \u003c\u003cdb_user\u003e\u003e;\n\tGRANT CREATE DATABASE LINK TO \u003c\u003cdb_user\u003e\u003e;\n\tGRANT CREATE SEQUENCE TO \u003c\u003cdb_user\u003e\u003e;\n\tGRANT CREATE SESSION TO \u003c\u003cdb_user\u003e\u003e;\n\tGRANT CREATE SYNONYM TO \u003c\u003cdb_user\u003e\u003e;\n\tGRANT CREATE VIEW TO \u003c\u003cdb_user\u003e\u003e;\n\tGRANT DROP ANY DIRECTORY TO \u003c\u003cdb_user\u003e\u003e;\n\t-- Object Privileges\n\tGRANT EXECUTE ON SYS.DBMS_STATS TO \u003c\u003cdb_user\u003e\u003e;\n\tGRANT SELECT ON SYS.GV_$PROCESS TO \u003c\u003cdb_user\u003e\u003e;\n\tGRANT SELECT ON SYS.GV_$SESSION TO \u003c\u003cdb_user\u003e\u003e;\n\nThe Oracle connection information are taken from the file `connect.config` in directory `test`. Please change it to point to your database before executing the steps below:\n\n  1. \u003ccode\u003erebar3 compile\u003c/code\u003e\n  2. \u003ccode\u003erebar3 eunit\u003c/code\u003e\n\n## API Description through examples\n\n### Create a new erloci environment\n```\nOciPort = erloci:new([{logging, false}, {env, []}]),\n```\n### Get an OCI Session\n```\nTns = \u003c\u003c\"(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=XE)))\"\u003e\u003e,\nPswd= \u003c\u003c\"XXXXXX\"\u003e\u003e,\nUser= \u003c\u003c\"User\"\u003e\u003e,\nOciSession = OciPort:get_session(Tns, User, Pswd),\n```\n### Prepare an OCI Statement\n```\nSelStmt = OciSession:prep_sql(\"SELECT lastname, firstname from testtable where personid \u003e :a \"),\n```\n### Bind Variable types\n```\nSelStmt:bind_vars([{\u003c\u003c\":a\"\u003e\u003e,'SQLT_INT'}]),\n```\n### Execute the statement with bind values\n```\nSelStmt:exec_stmt([{1}]),\n```\n\nReturns:\n`{cols, [Definition]}` where\nDefinition is `{ColumnName, ColumnType, ColumnSize, Precision, Scale}`\n\n### Fetch result rows\n```\nSelStmt:fetch_rows(NumRows)\n```\nReturns:\n`{{rows, [Row]}, IsComplete}`\n\n### CHANGE LOG\n#### 0.0.2\n1. STL term class for wrapping erlang term\n1. Native process redesigned to OO\n1. Support Variable binding for Input\n1. Concurrent connection and statements\n1. Common test for load testing\n#### 0.1.0\n1. Compiled with rebar3\n1. CommonTests restructured\n#### 0.1.1\n1. Compile with Visual Studio 2017 Community Edition tool chain\n\n### Work-In-Progess\n1. Testing and stabilization\n2. Wiki\n\n### TODOs\n1. In/Out bind variables and arrays\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fk2informaticsgmbh%2Ferloci","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fk2informaticsgmbh%2Ferloci","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fk2informaticsgmbh%2Ferloci/lists"}