Go (golang) client for OrientDB
Go
Latest commit a1fc07b Apr 22, 2016 @hus787 hus787 committed with dennwc support Time, Uint and Uint64 added
(cherry picked from commit cb901a4)
Permalink
Failed to load latest commit information.
logo removed extra pixels in the logo Oct 4, 2015
obinary Add method AddClusterWithID Dec 19, 2015
.gitignore Implementing new record serializer. SQLCommand works. Sep 10, 2015
.travis.yml Bump Go version Apr 22, 2016
LICENSE.md Added init README and LICENSE Jan 26, 2015
README.md Add database Dial example Jan 6, 2016
TODO.org.txt Added additional tests of serialization of EMBEDDED ODocuments. Jul 7, 2015
client.go allow to remove connection limit Sep 17, 2016
client_m_test.go allow to remove connection limit Sep 17, 2016
client_test.go allow to remove connection limit Sep 17, 2016
commands.go Fix typo in params serializer. Fixed #35. Oct 6, 2015
commands_result.go Handle records-to-map conversion properly Nov 4, 2015
commands_result_test.go Handle records-to-map conversion properly Nov 4, 2015
decimal.go Some changes for DECIMAL type. Addresses #12 Sep 27, 2015
dial_example_test.go Add database Dial example Jan 6, 2016
document.go Fix NPE for document with no serializer Jan 22, 2016
document_test.go Support for struct-to-Document conversion. Resolves #29. Addresses #27. Oct 3, 2015
errors.go Retry Command if concurrent modification occurs Nov 30, 2015
functions.go More docs. Update README. Follow some golint suggestions. Updated tes… Sep 17, 2015
global_property.go Removed oschema package. Cleanup. Sep 18, 2015
graph_test.go Switch to stdlib log package Dec 5, 2015
link.go Switch import paths to v2 Sep 22, 2015
mapstructure.go Add mapstructure hook for Document-to-map conversion. Fixes #38. Oct 9, 2015
oclass.go Do not panic on CustomFields Dec 5, 2015
orient_test.go allow to remove connection limit Sep 17, 2016
property.go Removed oschema package. Cleanup. Sep 18, 2015
proto.go Add method AddClusterWithID Dec 19, 2015
records.go Better String method for Documents. Cleanup. Oct 3, 2015
rid.go Better String method for Documents. Cleanup. Oct 3, 2015
rid_test.go Better String method for Documents. Cleanup. Oct 3, 2015
serializer.go Handle records-to-map conversion properly Nov 4, 2015
serializer_binary.go handle zero objects properly Jan 11, 2016
serializer_binary_decimal.go Moved serializers to orient package Oct 10, 2015
serializer_binary_test.go Moved serializers to orient package Oct 10, 2015
serializer_string.go Moved serializers to orient package Oct 10, 2015
sql.go Switch to stdlib log package Dec 5, 2015
sql_test.go Switch to stdlib log package Dec 5, 2015
type.go support Time, Uint and Uint64 added Sep 17, 2016
util.go Support for struct-to-Document conversion. Resolves #29. Addresses #27. Oct 3, 2015

README.md

Overview

Build Status GoDoc

OrientGo is a Go client for the OrientDB database.

OrientGo Logo

Status

OrientDB versions supported: 2.0.15 - 2.1.5

Not supported versions:

  • 2.1.0 (bug in OrientDB, see #28)
  • 2.1.3 (broken protocol, see #39)

Driver is under active development. API in orientgo is potentially unstable (though getting more stable now).

Early adopters are welcome to try it out and report any problems found.

Ogonori

Original ogonori API is deprecated. Still, it's source code have been frozen in v1.0 branch. To use it, simply replace github.com/quux00/ogonori imports with gopkg.in/istreamdata/orientgo.v1.

Supported features:

  • Mostly any SQL queries, commands and batch requests.
  • Server-side scripts (via ScriptCommand or functions).
  • Command results conversion to custom types via mapstructure.
  • Direct CRUD operations on Document or BytesRecord objects.
  • Management of databases and record clusters.
  • Can be used for the golang database/sql API, with some cautions (see below).
  • Only supports OrientDB 2.x series.

Not supported yet:

  • OrientDB 1.x.
  • Servers with cluster configuration (not tested).
  • Fetch plans are temporary disabled due to internal changes.
  • Transactions in Go. Transactions in JS can be used instead.
  • Live queries.
  • Command results streaming (#26).
  • OrientDB CUSTOM type.
  • ORM-like API. See Issue #6.

Caveat on using OrientGo as a database/sql API driver

WARNING: database/sql API is disabled for now.

The golang database/sql API has some constraints that can be make it painful to work with OrientDB. For example:

  • When you insert a record, the Go database/sql API only allows one to return a single int64 identifier for the record, but OrientDB uses as a compound int16:int64 RID, so getting the RID of records you just inserted requires another round trip to the database to query the RID.

Also, since OrientDB transactions are not supported, the Tx portion of the database/sql API is not yet implemented.

Development

You are welcome to initiate pull request and suggest a more user-friendly API. We will try to review them ASAP.

How to run functional tests:

1) Install Docker

2) Pull OrientDB image: docker pull dennwc/orientdb:2.1

3) go test -v ./...

Examples

Dial example - dial_example_test.go

LICENSE

The MIT License