No commit activity in last 3 years
No release in over 3 years
The ArangoDB axiom adapter
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 0.0.7
~> 0.0.3
~> 0.1.0
~> 0.1.0
~> 0.0.5
~> 0.0.1
 Project Readme

axiom-arango-adapter

Build Status Dependency Status Code Climate

ArangoDB adapter for axiom.

Installation

Install the gem axiom-arango-adapter via your preferred method.

Examples

Setup a gateway and connect it to ArangDB:

require 'axiom-arango-adapter'
require 'logger'

# Connect to ArangoDB
database = Ashikawa::Core::Database.new('http://localhost:8529')

# Save some people in the database
collection = database['people']

[
  { :id => 1, :firstname => "Jon", :lastname => "Doe" },
  { :id => 2, :firstname => "Sue", :lastname => "Doe" }
].each do |document|
  collection.create(document)
end

# Some logger to see AQL
logger = Logger.new($stderr, :debug)

# Instantiating adapter
adapter = Axiom::Adapter::Arango::Adapter.new(database, logger)

# Setting up a base relation
header = Axiom::Relation::Header.coerce([[:id, Integer], [:firstname, String], [:lastname, String]])
base   = Axiom::Relation::Base.new(:people, header)

# Creating a gateway
gateway = adapter.gateway(base)

# Use the gateway with the examples from the axiom README, for example:
gateway.restrict { |r| r.firstname.eq("Sue") } # restricts to tuples where firstname is "Sue"

You can find more examples in the axiom README.

Fuzzer

Axiom has a fuzzer to assist checking the correctness of the adapter and datastore. To run the fuzzer execute the following:

bundle exec spec/fuzzer.rb

Make sure you run an ArangoDB instance on localhost at the default port!

Credits

Contributing

  • Fork the project.
  • Make your feature addition or bug fix.
  • Add tests for it. This is important so I don't break it in a future version unintentionally.
  • Commit, do not mess with Rakefile or version (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
  • Send me a pull request. Bonus points for topic branches.

License

This gem is published under the MIT license. See LICENSE file.