All Projects → 7bridges-eu → Clj Odbp

7bridges-eu / Clj Odbp

Licence: apache-2.0
A Clojure driver for OrientDB binary protocol

Programming Languages

clojure
4091 projects

Projects that are alternatives of or similar to Clj Odbp

Rdbc
Rust DataBase Connectivity (RDBC) :: Common Rust API for database drivers
Stars: ✭ 328 (+958.06%)
Mutual labels:  database, driver
Qmgo
Qmgo - The Go driver for MongoDB. It‘s based on official mongo-go-driver but easier to use like Mgo.
Stars: ✭ 444 (+1332.26%)
Mutual labels:  database, driver
Sqlhooks
Attach hooks to any database/sql driver
Stars: ✭ 397 (+1180.65%)
Mutual labels:  database, driver
Dgraph
Native GraphQL Database with graph backend
Stars: ✭ 17,127 (+55148.39%)
Mutual labels:  database, graphdb
Clickhouse Driver
ClickHouse Python Driver with native interface support
Stars: ✭ 562 (+1712.9%)
Mutual labels:  database, driver
Vertica Python
Official native Python client for the Vertica Analytics Database.
Stars: ✭ 301 (+870.97%)
Mutual labels:  database, driver
Rust Mysql Simple
Mysql client library implemented in rust.
Stars: ✭ 415 (+1238.71%)
Mutual labels:  database, driver
Psycopg2
PostgreSQL database adapter for the Python programming language
Stars: ✭ 2,425 (+7722.58%)
Mutual labels:  database, driver
Arangojs
The official ArangoDB JavaScript driver.
Stars: ✭ 503 (+1522.58%)
Mutual labels:  database, driver
Faunadb Js
Javascript driver for FaunaDB
Stars: ✭ 498 (+1506.45%)
Mutual labels:  database, driver
Psycopg3
New generation PostgreSQL database adapter for the Python programming language
Stars: ✭ 278 (+796.77%)
Mutual labels:  database, driver
Mongo Cxx Driver
C++ Driver for MongoDB
Stars: ✭ 792 (+2454.84%)
Mutual labels:  database, driver
Neo4j Java Driver
Neo4j Bolt driver for Java
Stars: ✭ 241 (+677.42%)
Mutual labels:  database, driver
Cdrs
Cassandra DB native client written in Rust language. Find 1.x versions on https://github.com/AlexPikalov/cdrs/tree/v.1.x Looking for an async version? - Check WIP https://github.com/AlexPikalov/cdrs-async
Stars: ✭ 314 (+912.9%)
Mutual labels:  database, driver
Grakn
TypeDB: a strongly-typed database
Stars: ✭ 2,947 (+9406.45%)
Mutual labels:  database, graphdb
Hasql
Performant PostgreSQL driver with a flexible mapping API
Stars: ✭ 415 (+1238.71%)
Mutual labels:  database, driver
Gocql
Package gocql implements a fast and robust Cassandra client for the Go programming language.
Stars: ✭ 2,182 (+6938.71%)
Mutual labels:  database, driver
Arangodb Php
PHP ODM for ArangoDB
Stars: ✭ 178 (+474.19%)
Mutual labels:  database, driver
Csharp Driver
DataStax C# Driver for Apache Cassandra
Stars: ✭ 477 (+1438.71%)
Mutual labels:  database, driver
Neo4j Javascript Driver
Neo4j Bolt driver for JavaScript
Stars: ✭ 674 (+2074.19%)
Mutual labels:  database, driver

This project is no longer maintained, because we are no longer interested in OrientDB.

7bridges clj-odbp

clj-odbp

A Clojure driver for OrientDB binary protocol.

Build Status Clojars Project

Installation

Add the necessary dependency to your project:

[eu.7bridges/clj-odbp "0.2.3"]

Usage

Driver configuration

clj-odbp comes with default settings with regard to OrientDB connection and logging.

user> (require '[clj-odbp.configure :as c])
user> @c/config
;; => {:log-level :fatal, :log-file "log/clj_odbp.log", :port 2424, :host "localhost", :log-rotation-frequency :daily}

To change the default settings, you need to use clj-odbp.configure/configure-driver.

user> (c/configure-driver {:host "my-orientdb-server" :log-level :debug})
user> @c/config
;; => {:log-level :debug, :log-file "log/clj_odbp.log", :port 2424, :host "my-orientdb-server", :log-rotation-frequency :daily}

Driver usage

Connect to an OrientDB server:

user> (require '[clj-odbp.core :as odbp])
user> (odbp/connect-server "<username>" "<password>")

Create a new database:

user> (let [connection (odbp/connect-server "<username>" "<password>")]
        (odbp/db-create connection "test-db"))

Check if a database exists:

user> (let [connection (odbp/connect-server "<username>" "<password>")]
        (odbp/db-exist connection "test-db"))

Connect to a database and create a vertex:

user> (let [connection (odbp/db-open "test-db" "<username>" "<password>")]
        (odbp/execute-command connection "create class Test extends V"))

Connect to a database and create a record:

user> (let [connection (odbp/db-open "test-db" "<username>" "<password>")]
        (odbp/record-create connection {:_class "Test" :text "test property"}))

For further details check API documentation.

Types

The following table shows how OrientDB types map to Clojure types and viceversa.

OrientDB Clojure
boolean true, false
integer (int 42)
short (short 42)
long 42
float (float 42.5)
double 42.5
decimal (bigdec 42.5)
string "foo"
binary {:_obinary [100 101]}
date not supported
datetime (java.util.Date.)
embedded {:_version 0 :_class "Test" :name "foo"}
embedded list [0 "foo" 1]
embedded set #{0 "foo" 1}
embedded map {:name "foo" :age 42}
link "#20:1"
link list ["#20:1" "#20:2"]
link set #{"#20:1" "#20:2"}
link map {"rid" "#20:1"}
ORidBag {:_oridbag {:bag []}}
ORidTree {:_oridtree {:changes []}}

License

Copyright © 2017 7bridges s.r.l.

Distributed under the Apache License 2.0.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].