Need help with go-oci8?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

mattn
542 Stars 199 Forks MIT License 526 Commits 7 Opened issues

Description

Oracle driver for Go using database/sql

Services available

!
?

Need anything else?

Contributors list

# 142,776
Go
SQLite
Shell
golang-...
164 commits
# 3,574
viml
golang
ag
q
130 commits
# 290,139
v4l2
webcam
C
gtk
16 commits
# 95,771
excel
ooxml
golang
xlsx
9 commits
# 12,744
Go
aws-s3
Apache ...
toml
6 commits
# 46,419
Postgre...
koa2
graphql...
postgre...
5 commits
# 544,653
Go
Shell
C++
4 commits
# 174,326
Arduino
arduino...
c-plus-...
Sass
4 commits
# 101,512
Neovim
grpc-we...
CSS
gRPC
3 commits
# 531,735
Go
Shell
C++
3 commits
# 405,976
CSS
Shell
metrics...
C++
2 commits
# 250,154
CSS
C
Vim
Neovim
2 commits
# 15,618
Go
golang
gzip
sns
2 commits
# 144,061
elastic...
oracle-...
Amazon ...
SQL
1 commit
# 162,778
s3
Perl
Shell
C++
1 commit
# 53,869
golang
SQLite
microso...
oracle
1 commit
# 122,619
event-l...
HTML
nio
jvm
1 commit
# 640,915
C
Shell
C++
1 commit
# 555,387
Go
Shell
C++
1 commit
# 105,946
CSS
leanpub
Shell
styled-...
1 commit

go-oci8

GoDoc Reference Build Status Go Report Card

Description

Golang Oracle database driver conforming to the Go database/sql interface

Installation

Install Oracle full client or Instant Client:

https://www.oracle.com/technetwork/database/database-technologies/instant-client/downloads/index.html

Install a C/C++ compiler

Install pkg-config, edit your package config file oci8.pc (examples below), then set environment variable PKGCONFIGPATH to oci8.pc file location (Or can use Go tag noPkgConfig then setup environment variables CGOCFLAGS and CGOLDFLAGS)

Go get with Go version 1.9 or higher

go get github.com/mattn/go-oci8

Try the simple select example:

https://godoc.org/github.com/mattn/go-oci8#example-package--SqlSelect

If you have a build error it is normaly because of a misconfiguration, make sure to search close issues for help

oci8.pc Examples

Windows

prefix=/devel/target/XXXXXXXXXXXXXXXXXXXXXXXXXX
exec_prefix=${prefix}
libdir=C:/app/instantclient_12_2/sdk/oci/lib/msvc
includedir=C:/app/instantclient_12_2/sdk/include

glib_genmarshal=glib-genmarshal gobject_query=gobject-query glib_mkenums=glib-mkenums

Name: oci8 Description: oci8 library Libs: -L${libdir} -loci Cflags: -I${includedir} Version: 12.2

Linux

prefix=/devel/target/XXXXXXXXXXXXXXXXXXXXXXXXXX
exec_prefix=${prefix}
libdir=/usr/lib/oracle/12.2/client64/lib
includedir=/usr/include/oracle/12.2/client64

glib_genmarshal=glib-genmarshal gobject_query=gobject-query glib_mkenums=glib-mkenums

Name: oci8 Description: oci8 library Libs: -L${libdir} -lclntsh Cflags: -I${includedir} Version: 12.2

MacOs

Please install

pkg-config
with
brew
if not already present. Download the instant client and the sdk and unpack it e.g. in your
Downloads
folder and create therein a file names
oci8.pc
. Please replace
 with your actual username.
prefixdir=/Users//Downloads/instantclient_12_2/
libdir=${prefixdir}
includedir=${prefixdir}/sdk/include

Name: OCI Description: Oracle database driver Version: 12.2 Libs: -L${libdir} -lclntsh Cflags: -I${includedir}

You also have to set these environment variables (e.g. permanently by adding them to your

.bashrc
)
export LD_LIBRARY_PATH=/Users//Downloads/instantclient_12_2
export PKG_CONFIG_PATH=/Users//Downloads/instantclient_12_2

SQL Examples

SQL examples can be found in the GoDoc reference:

https://godoc.org/github.com/mattn/go-oci8

And in _example:

https://github.com/mattn/go-oci8/tree/master/_example

Author

Yasuhiro Matsumoto (a.k.a mattn)

Special Thanks

Jamil Djadala

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.