Upload
arangodb
View
1.676
Download
3
Embed Size (px)
DESCRIPTION
Citation preview
by Frank Celler and Lucas Dohmen
Aran!oDB & AshikawaWorkshop
Part 2: Ashikawa
Ashikawa
• Ruby Gems for Aran!oDB
• Ashikawa::Core
• Ashikawa::AR
• DataMapper 2?
Ashikawa::Core
• Low Level Driver for Aran!oDB
• Abstracts the REST interface of Aran!oDB
• Basis for the other !ems
gem install ashikawa-core
Ashikawa::AR
• Implements the Active Record pattern
• Inte!rates with Rails
• Used on happy-!eoco.de Rails Rumble Project
gem install ashikawa-ar
Data Mapper 2
• Not yet
• Implements the Data Mapper pattern
• Will support various data sources
• If you want to know more, !o to Piotr Solnica‘s talk this weekend :(
• We will work on the support of Aran!oDB
Ok, let‘s !o
Ashikawa::Core
Aran!oDB started? ;)
gem install ashikawa-core
require "ashikawa-core"
db = Ashikawa::Core::Database.new "127.0.0.1:8529"
my_collection = db["stuff"]my_collection << { name: "Test", something: "cool"}
p my_collection.all.first.to_hash
• Access Aran!oDB at a low level
• More on rubydoc.info
• Just search for ashikawa-core
What can you do?
Ashikawa::AR
Setup a new Rails App
rails new --skip-active-record
Add
ashikawa-ar, ~> 0.1.2to you !emfile
YourApplicationName::Application.configure do # ...
# ArangoDB configuration Ashikawa::AR.setup :default, "127.0.0.1:8529"end
Confi!ure your DB
Confi!uration via database.yml already planned ;)
class MyFineModel include Ashikawa::AR::Model
attribute :name attribute :my_attribute attribute :my_string, Stringend
# Somewhere else...model = MyFineModel.by_example name: "Johnny"
rails ! ashikawa:model NAME attribute attribute2:Strin!
• Define attributes via virtus
• Validate attributes via aequitas
• Find: all, by_example, find_by_aql…
• Delete, reload, save, update_attributes…
• More on rubydoc.info
• Just search for ashikawa-ar
What can you do?
@moonbeamlabs@aran!odb
triAGENS/ashikawa-coretriAGENS/ashikawa-ar
lucas@aran!odb.or!ashikawa@!oo!le!roups.com
Contact
…or just find us this weekend :)