Oracle driver for Go using database/sql

Overview

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 PKG_CONFIG_PATH to oci8.pc file location (Or can use Go tag noPkgConfig then setup environment variables CGO_CFLAGS and CGO_LDFLAGS)

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 <username> with your actual username.

prefixdir=/Users/<username>/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/<username>/Downloads/instantclient_12_2
export PKG_CONFIG_PATH=/Users/<username>/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

Issues
  • Cursor leak in QueryContext when context is cancelled

    Cursor leak in QueryContext when context is cancelled

    Running the following will eventually crash with ORA-01000: maximum open cursors exceeded

    package main
    
    import (
    	"context"
    	"database/sql"
    	"flag"
    	_ "github.com/mattn/go-oci8"
    	"log"
    	"strings"
    	"sync"
    	"time"
    )
    
    func main() {
    	dsn := flag.String("dsn", "", "Oracle DSN")
    	flag.Parse()
    
    	db, err := sql.Open("oci8", *dsn)
    	if err != nil {
    		panic(err)
    	}
    	defer db.Close()
    
    	db.SetMaxOpenConns(4)
    	db.SetMaxIdleConns(4)
    	db.SetConnMaxLifetime(30 * time.Minute)
    
    	log.Print("Trying to crash")
    
    	for i := 0; i < 10; i++ {
    		go crasher(db)
    	}
    
    	log.Print("Waiting...")
    
    	time.Sleep(60 * time.Second)
    
    	log.Print("No crash?")
    }
    
    func crasher(db *sql.DB) {
    	for {
    		var wg sync.WaitGroup
    		ctx, cancel := context.WithCancel(context.Background())
    		wg.Add(1)
    		go func() {
    			defer wg.Done()
    			rows, err := db.QueryContext(ctx,
    				`select * from sys.audit_actions`,
    			)
    			if err != nil {
    				if err == context.Canceled || strings.Contains(err.Error(), "ORA-01013") { // ORA-01013: user requested cancel of current operation
    				if rows != nil {
    					log.Print("Non-nil rows returned during error? closing rows")
    					err  =rows.Close()
    					if err != nil {
    						panic(err)
    					}
    				}
    					return
    				}
    				panic(err)
    			}
    			err = rows.Close()
    			if err != nil {
    				panic(err)
    			}
    		}()
    
    		// Seems to crash faster if we wait a little bit
    		time.Sleep(1 * time.Millisecond)
    
    		cancel()
    		wg.Wait()
    	}
    }
    

    I was attempting to reproduce a nasty crash (malloc(): memory corruption (fast)) which seemed to be related to cancelling the context of a running query with go-oci8 when I ran into this issue. I'm not sure if this is also the cause of my memory corruption crash or not, but it's making it difficult to reproduce with this issue. Removing the cancel() call makes the issue stop occurring.

    outside bug 
    opened by nvx 74
  • How do I compile this on windows

    How do I compile this on windows

    I read this document and other documents but can't find exact solution for using oracle with golang.

    When i build my go file it stops due to:

    pkg-config --cflags oci8

    pkg-config: exec: "pkg-config": executable file not found in %PATH%

    I have some gaps in my mind about this document can anybody help me? 1- Should i install pkg-config for windows? 2- Should i set environment variables for oci8.pc 3- Is my oci8.pc file true? <-- oci8.pc file --> prefix=C:/instantclient libdir=${prefix} includedir=${prefix}/sdk/include/

    Name: OCI Description: Oracle database engine Version: 11.2 Libs: -L${libdir} -lclntsh Libs.private: Cflags: -I${includedir}

    fmt.Println("THANK YOU")

    opened by ugurozgen 50
  • Periodic hangs on Next()

    Periodic hangs on Next()

    I get a very reproduceable hangs when running GetColumns from xorm using go-oci8. It hangs on a column of type NUMBER, although it processed another column of type NUMBER in the same table. Also, out of 50 tables, it hangs on 3. I cant see a pattern here.

    I got a stacktrace and it looks hung in OCIStmtFetch2. Any ideas?

    Here is the stack trace:

    goroutine 10 [syscall, 2 minutes]: runtime.notetsleepg(0x31b84d8, 0x6fbc0c3fa, 0x0) /usr/local/go/src/runtime/lock_futex.go:205 +0x42 fp=0xc42002af60 sp=0xc42002af30 runtime.timerproc() /usr/local/go/src/runtime/time.go:209 +0x327 fp=0xc42002afe0 sp=0xc42002af60 runtime.goexit() /usr/local/go/src/runtime/asm_amd64.s:2197 +0x1 fp=0xc42002afe8 sp=0xc42002afe0 created by runtime.addtimerLocked /usr/local/go/src/runtime/time.go:116 +0xed

    goroutine 1 [syscall, 10 minutes, locked to thread]: github.com/mattn/go-oci8._Cfunc_OCIStmtFetch2(0x7f96bc09d470, 0x7f96bc089eb0, 0x200000001, 0x0, 0x0) github.com/mattn/go-oci8/_obj/_cgo_gotypes.go:576 +0x4d github.com/mattn/go-oci8.(*OCI8Rows).Next.func1(0x7f96bc09d470, 0x7f96bc089eb0, 0x200000001, 0x0, 0x0) /ddn/work/ddn/src/github.com/mattn/go-oci8/oci8.go:1537 +0xc5 github.com/mattn/go-oci8.(*OCI8Rows).Next(0xc420383630, 0xc420054f50, 0x7, 0x7, 0x42adae, 0xc400000008) /ddn/work/ddn/src/github.com/mattn/go-oci8/oci8.go:1543 +0x7a database/sql.(*Rows).nextLocked(0xc4206c4800, 0xc42089b938) /usr/local/go/src/database/sql/sql.go:2149 +0x6c database/sql.(*Rows).Next.func1() /usr/local/go/src/database/sql/sql.go:2134 +0x3c database/sql.withLock(0x312b200, 0xc4206c4830, 0xc42089b978) /usr/local/go/src/database/sql/sql.go:2545 +0x65 database/sql.(*Rows).Next(0xc4206c4800, 0x15) /usr/local/go/src/database/sql/sql.go:2135 +0x83 github.com/go-xorm/xorm.(*oracle).GetColumns(0xc420383a90, 0xc42067d9f0, 0xc, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0) /ddn/work/ddn/src/github.com/go-xorm/xorm/dialect_oracle.go:705 +0x2a3 github.com/go-xorm/xorm.(*Engine).DBMetas(0xc4203f2fa0, 0x22, 0x0, 0x0, 0x0, 0xc) /ddn/work/ddn/src/github.com/go-xorm/xorm/engine.go:357 +0x301

    opened by rajeevb2 38
  • Improve fetch performance by fetching more rows at a time

    Improve fetch performance by fetching more rows at a time

    I have been comparing go-oci8 to other drivers written in Go and other languages. I have executed a simple test where I query and fetch all the records (rows.Next()) from a single table with 32 columns, 2 million rows and an average row size of 58 bytes. The application and database are on the same Windows machine. Here are the results, from fastest to slowest:

    PL/SQL - 4.8 seconds .Net (System.Data.OracleClient) - 6 seconds go-oci8 - 18 seconds goracle - 33 seconds Delphi (DOA) - 58 seconds

    go-oci8 has good performance compared to goracle and Delphi, however it is around 3x slower than .Net.

    I started investigating and the most obvious difference is that in go-oci8 when OCIStmtFetch is called the nrows parameter is always 1:

    func (rc *OCI8Rows) Next(dest []driver.Value) error {
        rv := C.OCIStmtFetch(
            (*C.OCIStmt)(rc.s.s),
            (*C.OCIError)(rc.s.c.err),
            1, // nrows
            C.OCI_FETCH_NEXT,
            C.OCI_DEFAULT)
    

    .Net, however, has a variable amount of rows:

    rc = TracedNativeMethods.OCIStmtFetch(
                                            _statementHandle,           // stmtp
                                            ErrorHandle,                // errhp
                                            _rowsToPrefetch,            // crows
                                            OCI.FETCH.OCI_FETCH_NEXT,   // orientation
                                            OCI.MODE.OCI_DEFAULT        // mode
                                            );
    

    From what I've seen from the code, .Net fetches around 64 kb of data each time, which in my case would mean around 1100 rows.

    I'm trying to make go-oci8 fetch more rows, however when I do that errors start appearing everywhere, especially on the calls to close the cursors.

    Before I dig any deeper I was wondering if you have already tried anything similar, and maybe have some idea on what would be the parts that need to be modified in order to do that.

    opened by ricsmania 38
  • go 1.8 with go-oci8 crashed !

    go 1.8 with go-oci8 crashed !

    fatal error: unexpected signal during runtime execution [signal SIGSEGV: segmentation violation code=0x1 addr=0x196aca8 pc=0x7f58d1bd35c3]

    runtime stack: runtime.throw(0xbc6be4, 0x2a) /home/lhs/soft/go/go1.8.0/go/src/runtime/panic.go:596 +0x95 runtime.sigpanic() /home/lhs/soft/go/go1.8.0/go/src/runtime/signal_unix.go:274 +0x2db

    goroutine 4 [syscall, locked to thread]: runtime.cgocall(0xa50d60, 0xc42002d6c8, 0xbc5a59) /home/lhs/soft/go/go1.8.0/go/src/runtime/cgocall.go:131 +0xe2 fp=0xc42002d688 sp=0xc42002d648 github.com/mattn/go-oci8._Cfunc_OCIHandleFree(0x196aca8, 0x4, 0x0) github.com/mattn/go-oci8/_obj/_cgo_gotypes.go:479 +0x4d fp=0xc42002d6c8 sp=0xc42002d688 github.com/mattn/go-oci8.(*OCI8Stmt).Close.func1(0x196aca8, 0xc400000004, 0x43155e) /home/lhs/soft/go/go1.8.0/gopath/src/github.com/mattn/go-oci8/oci8.go:755 +0x68 fp=0xc42002d700 sp=0xc42002d6c8 github.com/mattn/go-oci8.(*OCI8Stmt).Close(0xc4202a1f20, 0x0, 0x0) /home/lhs/soft/go/go1.8.0/gopath/src/github.com/mattn/go-oci8/oci8.go:759 +0x47 fp=0xc42002d728 sp=0xc42002d700 runtime.call32(0x0, 0xbd9aa8, 0xc420216000, 0x2000000020) /home/lhs/soft/go/go1.8.0/go/src/runtime/asm_amd64.s:514 +0x48 fp=0xc42002d758 sp=0xc42002d728 runtime.runfinq() /home/lhs/soft/go/go1.8.0/go/src/runtime/mfinal.go:208 +0x205 fp=0xc42002d7e0 sp=0xc42002d758 runtime.goexit() /home/lhs/soft/go/go1.8.0/go/src/runtime/asm_amd64.s:2197 +0x1 fp=0xc42002d7e8 sp=0xc42002d7e0 created by runtime.createfing /home/lhs/soft/go/go1.8.0/go/src/runtime/mfinal.go:142 +0x62

    opened by toplinuxsir 33
  • Why I can not close database connection?

    Why I can not close database connection?

    `package main

    import ( "context" "database/sql" "fmt" "log" "net/http" "os" "os/signal" "syscall" "time"

    _ "github.com/mattn/go-oci8"
    

    )

    func main() {

    db, err := sql.Open("oci8", fmt.Sprintf(
    	"%v/%[email protected]%v:%v/%v",
    	"user",
    	"pass",
    	"0.0.0.0",
    	"000",
    	"serve-id"))
    if err != nil {
    	log.Fatal(err)
    }
    
    router := http.NewServeMux()
    
    router.HandleFunc("/poc-close-connect-db", func(res http.ResponseWriter, req *http.Request) {
    	if err := db.PingContext(req.Context()); err != nil {
    		res.WriteHeader(503)
    	}
    
    	rows, err := db.Query("select sysdate from dual")
    	if err != nil {
    		fmt.Println("Error running query")
    		fmt.Println(err)
    		return
    	}
    	defer rows.Close()
    
    	var thedate string
    	for rows.Next() {
    
    		rows.Scan(&thedate)
    	}
    	fmt.Printf("The date is: %s\n", thedate)
    })
    
    srv := &http.Server{
    	Handler: router,
    	Addr:    fmt.Sprintf(":%s", "8080"),
    }
    
    go func() {
    	log.Fatal(srv.ListenAndServe())
    }()
    
    stop := make(chan os.Signal, 1)
    signal.Notify(stop, os.Interrupt)
    signal.Notify(stop, syscall.SIGTERM)
    
    <-stop
    ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
    defer cancel()
    
    if err := srv.Shutdown(ctx); err != nil {
    	log.Printf("error shutting down server %s", err)
    } else {
    	log.Println("Server gracefully stopped")
    }
    
    stats := db.Stats()
    log.Printf("error closing db connection %s", stats)
    
    if err := db.Close(); err != nil {
    	log.Printf("error closing db connection %s", err)
    } else {
    	log.Println("Db connection gracefully closed")
    }
    

    }`

    I tried close database but I can not close database connection. Why I can not gracefully close database connection?

    question 
    opened by LennonRuangjaroon 29
  • go-oci8 /usr/bin/ld: cannot find -lclntsh

    go-oci8 /usr/bin/ld: cannot find -lclntsh

    go get github.com/mattn/go-oci8 returns go-oci8 /usr/bin/ld: cannot find -lclntsh collect2: error: ld returned 1 exit status and my oci8.pc is `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` and go version is go version go1.6.2 linux/amd64

    opened by vk1818 29
  • Error during install in windows

    Error during install in windows

    I am facing below error in windows 7 64bit with TDM-GCC-64 (64bit) and GO 1.5.2 64bit and Oracle server 64 bit.

    Error: cc1: sorry, unimplemented: 64-bit mode not compiled in

    oci8.pc as below

    prefix=/devel/target/1.0 exec_prefix=${prefix}

    libdir=C:/app/IBM_ADMIN/product/11.2.0/dbhome_1/OCI/lib/MSVC includedir=C:/app/IBM_ADMIN/product/11.2.0/dbhome_1/OCI/include

    gcclib=C:/MyFiles/ProgramFiles/TDM-GCC-64/lib gccinclude=C:/MyFiles/ProgramFiles/TDM-GCC-64/include

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

    Name: oci8 Version: 11.2 Description: oci8 library Libs: -L${libdir} -L${gcclib} -loci Libs.private: Cflags: -I${includedir} -I${gccinclude}

    Not able to figure out where are things going wrong. Please help

    opened by JunedS 28
  • Oracle Errors

    Oracle Errors

    I'm trying to get the actual Oracle error (code/text) back from a failed connection, but that doesn't seem to be happening. Can this be done? Here is my sample code:

    db, err := sql.Open("oci8", connectStr)
    if err != nil {
    	return nil, err
    }
    err = db.Ping()
    if err != nil {
    	db.Close()
    	return nil, err
    }
    

    In the case of a bad user/password, db.Ping() throws an error of "ping failed", but the actual reason is unknown unless I connect to the database with another client. Is this something that I'm doing incorrectly?

    done 
    opened by kog4096 26
  • error in runtime on windows x64

    error in runtime on windows x64

    Hi, I have installed oracle instant client 12.2 64bit in c:\oracle\instantclient_2_2 installed mingw etc. go-oci8 installed/compiled fine. no erros.

    Also go build main.go went fine. no errors. but now when running go run main.go I get the following error:

    go run main.go
    Exception 0xc0000005 0x0 0xb971a6 0x5adc70
    PC=0x5adc70
    signal arrived during external code execution
    
    github.com/mattn/go-oci8._Cfunc_WrapOCIEnvCreate(0x1, 0x0, 0x0, 0x0, 0x0)
            github.com/mattn/go-oci8/_obj/_cgo_gotypes.go:797 +0x67
    github.com/mattn/go-oci8.(*OCI8Driver).Open(0x5e31d8, 0x5388e1, 0x53, 0x0, 0x0, 0x0, 0x0)
            p:/projects/src/github.com/mattn/go-oci8/oci8.go:664 +0xf8
    database/sql.(*DB).conn(0xc04203e1e0, 0x5b2140, 0xc04203a1d0, 0x1, 0xa0, 0x5285a0, 0x0)
            C:/Go/src/database/sql/sql.go:965 +0x14d
    database/sql.(*DB).query(0xc04203e1e0, 0x5b2140, 0xc04203a1d0, 0x53365c, 0x16, 0x0, 0x0, 0x0, 0x4b4d01, 0xc042031e70, ...)
            C:/Go/src/database/sql/sql.go:1245 +0x62
    database/sql.(*DB).QueryContext(0xc04203e1e0, 0x5b2140, 0xc04203a1d0, 0x53365c, 0x16, 0x0, 0x0, 0x0, 0x429b56, 0x538f20, ...)
            C:/Go/src/database/sql/sql.go:1227 +0xbf
    database/sql.(*DB).Query(0xc04203e1e0, 0x53365c, 0x16, 0x0, 0x0, 0x0, 0x0, 0xc042031ee0, 0xc042076088)
            C:/Go/src/database/sql/sql.go:1241 +0x89
    main.main()
            P:/projects/src/test/oradbtest/main.go:17 +0xc4
    
    goroutine 17 [syscall, locked to thread]:
    runtime.goexit()
            C:/Go/src/runtime/asm_amd64.s:2197 +0x1
    
    goroutine 19 [chan receive]:
    database/sql.(*DB).connectionOpener(0xc04203e1e0)
            C:/Go/src/database/sql/sql.go:837 +0x51
    created by database/sql.Open
            C:/Go/src/database/sql/sql.go:582 +0x219
    rax     0x0
    rbx     0xc042031a58
    rcx     0x7ffd08
    rdi     0x7ffd10
    rsi     0x0
    rbp     0xc042032000
    rsp     0x7ffca8
    r8      0x0
    r9      0x0
    r10     0x11e532b
    r11     0x7ffc30
    r12     0x1
    r13     0x0
    r14     0x0
    r15     0xf2
    rip     0x5adc70
    rflags  0x10246
    cs      0x33
    fs      0x53
    gs      0x2b
    exit status 2
    
    opened by edwardborst 26
  • prefetch_rows does not work with clobs?

    prefetch_rows does not work with clobs?

    Looks like when query having a clob in the resultset. Then go-oci8 go back to do fetch for each query.

    Gist with some test code

    Output

    2019/01/20 10:54:59 Query with clob took 2.097061085s 2019/01/20 10:54:59 Query with clob SQLID: 1836z1tr3b785, fetches:1001 , rowsProcessed: 1000

    done 
    opened by dbgeek 24
  • dyld: Library not loaded: @rpath/libclntsh.dylib.12.1

    dyld: Library not loaded: @rpath/libclntsh.dylib.12.1

    hi, in my mac , I have an problem

    db, err := sql.Open("oci8", openString)` if err != nil { fmt.Printf("Open error is not nil: %v", err) return }

    ... rows, err := db.QueryContext(ctx, "select REMARK2 from table") if err != nil { fmt.Println("QueryContext error is not nil:", err) return } ... for rows.Next() { fmt.Println(rows.Columns()) }

    go build main.go && ./main is ok, but go run main.go then program go wrong like this.

    image

    how can i deal with that?

    opened by gftao 0
  • is there any fast bulk insert solutions like executemany() in python/node ?

    is there any fast bulk insert solutions like executemany() in python/node ?

    I'm using golang with go-oci8. The problem is in bulk insert. Now i have 15k records to insert, but in future the number will grow. PrepareNamed function inserts 15k records in 15s roughly (i removed transport time). But that is the way slower than Python with cx_Oracle. Python for example managed with 15k records in 0.5s. Things i should mention: tests and db tables were identical.

    opened by nvl0 1
  • OCIEnvCreate error

    OCIEnvCreate error

    The error is this,and how can i deal with it? panic: OCIEnvCreate error

    goroutine 1 [running]: github.com/mattn/go-oci8.init.0() C:/Users/kingdee/go/pkg/mod/github.com/mattn/[email protected]/globals.go:177 +0x518

    opened by zhongmin2015 2
  • [example] set instant client environment by a shell in linux(ubuntu)

    [example] set instant client environment by a shell in linux(ubuntu)

    this is my example,it's work.

    oci8.pc

    prefix=/opt/oracle/instantclient_12_2
    exec_prefix=${prefix}
    libdir= ${prefix}
    includedir= ${prefix}/sdk/include
    
    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
    

    exec_install.sh

    #! /bin/env bash
    
    sudo mkdir -p /opt/oracle
    sudo mkdir -p /opt/pkg-config
    
    wget https://raw.githubusercontent.com/TruthHun/oracle-instantclient/master/instantclient-sdk-linux.x64-12.2.0.1.0.zip
    wget https://raw.githubusercontent.com/TruthHun/oracle-instantclient/master/instantclient-sqlplus-linux.x64-12.2.0.1.0.zip
    wget https://raw.githubusercontent.com/TruthHun/oracle-instantclient/master/instantclient-basic-linux.x64-12.2.0.1.0.zip
    
    sudo unzip -d /opt/oracle instantclient-sdk-linux.x64-12.2.0.1.0.zip
    sudo unzip -d /opt/oracle instantclient-sqlplus-linux.x64-12.2.0.1.0.zip
    sudo unzip -d /opt/oracle instantclient-basic-linux.x64-12.2.0.1.0.zip
    
    sudo cp oci8.pc /opt/pkg-config
    
    echo "export LD_LIBRARY_PATH=/opt/oracle/instantclient_12_2:\$LD_LIBRARY_PATH" >> ~/.bashrc
    echo "export PATH=\$LD_LIBRARY_PATH:\$PATH" >> ~/.bashrc
    echo "export PKG_CONFIG_PATH=/opt/pkg-config:\$PKG_CONFIG_PATH" >> ~/.bashrc
    
    source ~/.bashrc
    
    # fixed:/usr/bin/ld: cannot find -lclntsh
    cd /opt/oracle/instantclient_12_2
    sudo ln -s libclntsh.so.12.1 libclntsh.so
    

    usage

    bash exec_install.sh
    
    opened by TruthHun 1
Releases(v0.1.1)
Owner
mattn
Long-time Golang user&contributor, Google Dev Expert for Go, and author of many Go tools, Vim plugin author. Windows hacker C#/Java/C/C++
mattn
GO DRiver for ORacle DB

Go DRiver for ORacle godror is a package which is a database/sql/driver.Driver for connecting to Oracle DB, using Anthony Tuininga's excellent OCI wra

null 368 Jun 29, 2022
Microsoft ActiveX Object DataBase driver for go that using exp/sql

go-adodb Microsoft ADODB driver conforming to the built-in database/sql interface Installation This package can be installed with the go get command:

mattn 128 Jun 8, 2022
sqlite3 driver for go using database/sql

go-sqlite3 Latest stable version is v1.14 or later not v2. NOTE: The increase to v2 was an accident. There were no major changes or features. Descript

mattn 5.8k Jun 22, 2022
Go driver for PostgreSQL over SSH. This driver can connect to postgres on a server via SSH using the local ssh-agent, password, or private-key.

pqssh Go driver for PostgreSQL over SSH. This driver can connect to postgres on a server via SSH using the local ssh-agent, password, or private-key.

mattn 47 Mar 3, 2022
Go Sql Server database driver.

gofreetds Go FreeTDS wrapper. Native Sql Server database driver. Features: can be used as database/sql driver handles calling stored procedures handle

minus5 106 Jan 23, 2022
Pure Go Postgres driver for database/sql

pq - A pure Go postgres driver for Go's database/sql package Install go get github.com/lib/pq Features SSL Handles bad connections for database/sql S

null 7.4k Jun 29, 2022
Attach hooks to any database/sql driver

sqlhooks Attach hooks to any database/sql driver. The purpose of sqlhooks is to provide a way to instrument your sql statements, making really easy to

Gustavo Chaín 551 Jun 23, 2022
Qmgo - The Go driver for MongoDB. It‘s based on official mongo-go-driver but easier to use like Mgo.

Qmgo English | 简体中文 Qmgo is a Go driver for MongoDB . It is based on MongoDB official driver, but easier to use like mgo (such as the chain call). Qmg

Qiniu Cloud 920 Jul 1, 2022
Mirror of Apache Calcite - Avatica Go SQL Driver

Apache Avatica/Phoenix SQL Driver Apache Calcite's Avatica Go is a Go database/sql driver for the Avatica server. Avatica is a sub-project of Apache C

The Apache Software Foundation 96 Jun 21, 2022
Firebird RDBMS sql driver for Go (golang)

firebirdsql (Go firebird sql driver) Firebird RDBMS http://firebirdsql.org SQL driver for Go Requirements Firebird 2.5 or higher Golang 1.13 or higher

Hajime Nakagami 171 Jun 1, 2022
Microsoft SQL server driver written in go language

A pure Go MSSQL driver for Go's database/sql package Install Requires Go 1.8 or above. Install with go get github.com/denisenkom/go-mssqldb . Connecti

null 1.6k Jun 23, 2022
PostgreSQL driver and toolkit for Go

pgx - PostgreSQL Driver and Toolkit pgx is a pure Go driver and toolkit for PostgreSQL. pgx aims to be low-level, fast, and performant, while also ena

Jack Christensen 5.6k Jul 1, 2022
Lightweight Golang driver for ArangoDB

Arangolite Arangolite is a lightweight ArangoDB driver for Go. It focuses on pure AQL querying. See AranGO for a more ORM-like experience. IMPORTANT:

Fabien Herfray 72 Jun 17, 2022
Go language driver for RethinkDB

RethinkDB-go - RethinkDB Driver for Go Go driver for RethinkDB Current version: v6.2.1 (RethinkDB v2.4) Please note that this version of the driver on

RethinkDB 1.6k Jun 20, 2022
goriak - Go language driver for Riak KV

goriak Current version: v3.2.1. Riak KV version: 2.0 or higher, the latest version of Riak KV is always recommended. What is goriak? goriak is a wrapp

Gustav Westling 27 Jan 23, 2022
Mongo Go Models (mgm) is a fast and simple MongoDB ODM for Go (based on official Mongo Go Driver)

Mongo Go Models Important Note: We changed package name from github.com/Kamva/mgm/v3(uppercase Kamva) to github.com/kamva/mgm/v3(lowercase kamva) in v

kamva 517 Jun 30, 2022
The MongoDB driver for Go

The MongoDB driver for Go This fork has had a few improvements by ourselves as well as several PR's merged from the original mgo repo that are current

GlobalSign 1.9k Jun 24, 2022
The Go driver for MongoDB

MongoDB Go Driver The MongoDB supported driver for Go. Requirements Installation Usage Bugs / Feature Reporting Testing / Development Continuous Integ

mongodb 6.8k Jul 1, 2022
RethinkDB-go - RethinkDB Driver for Go

Go language driver for RethinkDB

RethinkDB 1.6k Jun 20, 2022