Skip to content
/ go-nuodb Public
forked from tilinna/go-nuodb

NuoDB driver for Go database/sql interface

License

Notifications You must be signed in to change notification settings

nuodb/go-nuodb

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-nuodb

NuoDB driver for Go(golang) database/sql interface.

It wraps the libNuoRemote.so C++ API with a custom C API and then uses Cgo for calling it.

Setup

Installation requires NuoDB in /opt/nuodb and properly set $GOPATH.

$ go get -d github.com/tilinna/go-nuodb
$ make -C `go env GOPATH`/src/github.com/tilinna/go-nuodb install

Usage

package main

import (
  "database/sql"
	_ "github.com/tilinna/go-nuodb"
)

func main() {
	// func Open(driverName, dataSourceName string) (*DB, error)
	db, err := sql.Open("nuodb", "nuodb://robinh:crossbow@localhost:48004/tests?schema=abcd&timezone=UTC")
}

dataSourceName url string

Mandatory:

nuodb:// username : password @ broker_address / database

Optional:

  • schema=default schema
  • timezone=default timezone
  • preferred_address_family=ipv6

Test

1. Configure NuoDB

$ java -jar /opt/nuodb/jar/nuoagent.jar --broker --domain go-nuodb --password archer &
$ /opt/nuodb/bin/nuodb --allow-non-durable --database tests --initialize --password archer --dba-user robinh --dba-password crossbow &

2. Run the tests

$ make -C `go env GOPATH`/src/github.com/tilinna/go-nuodb test

About

NuoDB driver for Go database/sql interface

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 61.1%
  • C++ 32.9%
  • C 5.2%
  • Makefile 0.8%