Table of Contents
This chapter provides information on building third party APIs. See the sections below:
To install Go bindings for Oracle Berkeley DB, get a go-bdb
package
from https://orahub.oraclecorp.com/nosql-bdb-dev/go-bdb. You will need
an Oracle SSO account. Download your preferred package format; then install it following
the steps mentioned in the sections below.
Download Berkeley DB 6.2.32 or higher from http://www.oracle.com/technetwork/database/database-technologies/berkeleydb/downloads/index.html
Windows
Build Berkeley DB from the source code using Minimalist GNU for Windows (MinGW). The easiest way to get access to MinGW is to download and install MinGW-64 (https://sourceforge.net/projects/mingw-w64/) and MSYS (https://sourceforge.net/projects/mingw-w64/files/External%20binary%20packages%20%28Win64%20hosted%29/MSYS%20%2832-bit%29/)
For more information on MSYS and MinGW, see http://www.mingw.org/wiki/MSYS
Start a MSYS terminal and change into the unpacked
db-6.2.32
directory.
Execute the following command in the
db-6.2.32/build_unix
directory.
../dist/configure --prefix=/c/bdb/install --enable-cxx --enable-mingw --host=x86_64-w64-mingw32 make make install
Set the following environment variables:
set CPATH=C:\bdb\install\include set LIBRARY_PATH=C:\bdb\install\lib set PATH=C:\bdb\install\lib;%PATH%
Linux/Posix
Unpack the Berkeley DB source library and change to the directory
db-6.2.32/build_unix
.
Execute the following command:
../dist/configure --prefix=/usr/local/bdb/install --enable-cxx make make install
Set the following environment variables:
export CPATH=/usr/local/bdb/install/include export LIBRARY_PATH=/usr/local/bdb/install/lib export LD_LIBRARY_PATH=/usr/local/bdb/install/lib:$LD_LIBRARY_PATH
Under your Go installation, change to the directory
Go/src
and add the directory
orahub.oraclecorp.com/nosql-bdb-dev
.
Change to orahub.oraclecorp.com/nosql-bdb-dev
.
Choose either of the following options:
Checkout go-bdb
using the command:
git clone git@orahub.oraclecorp.com:nosql-bdb-dev/go-bdb
Download a .zip
or .tar.gz
from
https://orahub.oraclecorp.com/nosql-bdb-dev/go-bdb
and unpack it into the orahub.oraclecorp.com/nosql-bdb-dev
directory.
Build go-bdb
using the command:
go build orahub.oraclecorp.com/nosql-bdb-dev/go-bdb
Change to the examples directory in
Go/src/orahub.oraclecorp.com/nosql-bdb-dev/go-bdb/_examples
.
Change to the directory
HelloWorld
.
Enter the command:
go run HelloWorld.go
If Hello World!
is printed out, then the installation
was successful.
Go/src/orahub.oraclecorp.com/nosql-bdb-dev/go-bdb/_examples
- Examples
of how to use Berkeley DB are located in this directory.
HelloWorld
- Shows the basics of Berkeley DB, how to create
a database and put and get data.
Replication
- Shows how to set up a replication group and
replicate data from the master environment to a replica environment.
Bulk
- Shows how to do bulk inserts and gets.