windows - How to connect to Oracle in go -


i gather there 2 ways connect oracle db in go (on windows):

  1. github.com/tgulacsi/goracle
  2. github.com/mattn/go-oci8

but of level (beginner in open source+golang), 2 methods/drivers awfully tricky.

it's burden having go through of deployment, development on different machines etc. (also assuming work).

is there better way connect oracle db in golang or if there not can explain me in high level view or view matter make easier?

pointers appreciated.

tq.

if still interested, have been working go , oracle on windows few months now. favorite driver far go-oci8. faster goracle , seems more active.

some of our applications need deployed on computers don't have access to. both native sql drivers compiled application without need external configuration, huge plus. computer still need oracle client installed, external dependency.

i won't go-oci8 production ready yet, it's stable enough when know limitations. 1 example panics when running on multiple goroutines simultaneously, if need might want use mutex.

i have followed tutorial install it: https://gist.github.com/mnadel/8678269

the trickiest part creating oci8.pc corretly. mine is:

prefix=/devel/target/1.0 exec_prefix=${prefix} libdir=c:/oracle/instantclient_12_1_64/sdk/lib/msvc includedir=c:/oracle/instantclient_12_1_64/sdk/include oralib=c:/oracle/instantclient_12_1_64/sdk/lib/msvc orainclude=c:/oracle/instantclient_12_1_64/sdk/include gcclib=c:/mingw_64/mingw64/lib gccinclude=c:/mingw_64/mingw64/lib glib_genmarshal=glib-genmarshal gobject_query=gobject-query glib_mkenums=glib-mkenums name: oci8 version: 12.1 description: oci8 library libs: -l${oralib} -l${gcclib} -loci libs.private: cflags: -i${orainclude} -i${gccinclude} 

some things might reduntant, might try improve on clean machine.

an important thing have in mind should use same architecture go , oracle client. if want use 64 bit version of go need 64 bit version of oracle. have both 32 , 64 bit versions of both, , while 64 bit default use bat files change necessary paths , environment variables when need build 32 bit version.

it might worth investing time make work, better performance using odbc. have been using high data volume (queries fetch 5+ million rows) , works well.


Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -