Giter Site home page Giter Site logo

sql_keys_oracle's Introduction

Orcale DB Interfacer

Oracle Databases are not an easy thing to talk to. So I made a Interfacer to make it easier.

Demo

POST: http://hostname:8800/creds
Header: Content-Type = application/json
Body: {"connection":"username/password@DBURL:PORT"}

Response: {"key":"a5c44a8f-bc74-4e49-6fec-f5701548a1e1"}

POST: http://hostname:8800/query
Header: Content-Type = application/json
Body: {"key":"a5c44a8f-bc74-4e49-6fec-f5701548a1e1", "query":"select * mytable"}

Response:
{
  "data": [
    {"column1": "tim", "column2": "cook"},
    {"column1": "joe", "column2": "cool"}
  ],
  "qkey": "9e0902b9-d693-468d-4312-4427f02482dd"
}
GET: http://hostname:8800/query/9e0902b9-d693-468d-4312-4427f02482dd

Response:
[
  {"column1": "tim", "column2": 1022},
  {"column1": "joe", "column2": 1011}
]

Build

For this build you will need the Oracle Instant Client installed on your system.

Oracle Instant Client Install Guide

Go to the Download Page and download these 3 packages

  • instantclient-basic-linux.x64-12.1.0.2.0.zip
  • instantclient-sdk-linux.x64-12.1.0.2.0.zip
  • instantclient-sqlplus-linux.x64-12.1.0.2.0.zip

Unpack all the contents of these zips into one file called instantclient_12_1.

  • Make symlink libclntsh.so -> libclntsh.so.12.1
  • Make symlink libocci.so -> libocci.so.12.1

Then set oic needed env variable.

export LD_LIBRARY_PATH=/opt/oic/instantclient_12_1

Build Go Code

Use $glide up; to install the Go deps into a folder called vendor.

Next set you oic8.pc file to match your OIC install. I installed it in /opt/oic.

includedir=/opt/oic/instantclient_12_1/sdk/include
libdir=/opt/oic/instantclient_12_1

Name: oci8
Description: Oracle Instant Client
Version: 12.1
Cflags: -I${includedir}
Libs: -L${libdir} -lclntsh

Then set mattn-oci8 needed env variable.

export PKG_CONFIG_PATH=$HOME/src/sql_keys_oracle/vendor/github.com/mattn/go-oci8/
go build

sql_keys_oracle's People

Watchers

 avatar

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.