17
by Frank Celler and Lucas Dohmen AranoDB & Ashikawa Workshop Part 2: Ashikawa

Rupy2012 ArangoDB Workshop Part2

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: Rupy2012 ArangoDB Workshop Part2

by Frank Celler and Lucas Dohmen

Aran!oDB & AshikawaWorkshop

Part 2: Ashikawa

Page 2: Rupy2012 ArangoDB Workshop Part2

Ashikawa

• Ruby Gems for Aran!oDB

• Ashikawa::Core

• Ashikawa::AR

• DataMapper 2?

Page 3: Rupy2012 ArangoDB Workshop Part2

Ashikawa::Core

• Low Level Driver for Aran!oDB

• Abstracts the REST interface of Aran!oDB

• Basis for the other !ems

gem install ashikawa-core

Page 4: Rupy2012 ArangoDB Workshop Part2

Ashikawa::AR

• Implements the Active Record pattern

• Inte!rates with Rails

• Used on happy-!eoco.de Rails Rumble Project

gem install ashikawa-ar

Page 5: Rupy2012 ArangoDB Workshop Part2

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

Page 6: Rupy2012 ArangoDB Workshop Part2

Ok, let‘s !o

Page 7: Rupy2012 ArangoDB Workshop Part2

Ashikawa::Core

Page 8: Rupy2012 ArangoDB Workshop Part2

Aran!oDB started? ;)

Page 9: Rupy2012 ArangoDB Workshop Part2

gem install ashikawa-core

Page 10: Rupy2012 ArangoDB Workshop Part2

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

Page 11: Rupy2012 ArangoDB Workshop Part2

• Access Aran!oDB at a low level

• More on rubydoc.info

• Just search for ashikawa-core

What can you do?

Page 12: Rupy2012 ArangoDB Workshop Part2

Ashikawa::AR

Page 13: Rupy2012 ArangoDB Workshop Part2

Setup a new Rails App

rails new --skip-active-record

Add

ashikawa-ar, ~> 0.1.2to you !emfile

Page 14: Rupy2012 ArangoDB Workshop Part2

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 ;)

Page 15: Rupy2012 ArangoDB Workshop Part2

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!

Page 16: Rupy2012 ArangoDB Workshop Part2

• 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?

Page 17: Rupy2012 ArangoDB Workshop Part2

@moonbeamlabs@aran!odb

triAGENS/ashikawa-coretriAGENS/ashikawa-ar

lucas@aran!odb.or!ashikawa@!oo!le!roups.com

Contact

…or just find us this weekend :)