Skip to content

iallorens/go-orientrest

 
 

Repository files navigation

Build Status orientrest - Orientdb client for Go

Package orientrest is a Go client library providing access to the OrientDB document/graph database via its REST API. Orientrest was inspired by Neoism.

Requirements

Go 1.3 or later is required.

Installation

go get -v github.com/ympons/go-orientrest

Usage

Init the client

There are some ways initialize the client

client, err := orientrest.OrientDB("http://localhost:2480/", orientrest.Options{
	DbName: dbname,
	DbUser: user,
	DbPass: pass,
	Conn: true,
})
db, err := orientrest.OrientDB("http://localhost:2480/")
client, err := db.Connect(orientrest.Options{
	DbName: dbname,
	DbUser: user,
	DbPass: pass,
})
db, err := orientrest.OrientDB("http://localhost:2480/")
db.Configure(orientrest.Options{
	DbName: dbname,
	DbUser: user,
	DbPass: pass,
})
client, err := orientrest.Connect()

Create Database

err := client.DbCreate("my_new_database", orientrest.STORAGE_TYPE_PLOCAL, orientrest.DB_TYPE_GRAPH)

Drop Database

err := client.DbDrop(client.Name)

Get the list of databases

list, err := client.DbList()

Get the available languages

langs, err := client.DbAvailableLangs(client.Name)

Close Database

client.Close()

Send a command

_, err := client.Command("create class Person extends V")

Make a query

result, err := client.Query("select * from V")

This is Free Software, released under the terms of the GPLv3.

About

Orientrest is a Go client library providing access to the OrientDB document/graph database via its REST API.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%