Diese Präsentation wurde erfolgreich gemeldet.
Die SlideShare-Präsentation wird heruntergeladen. ×

Rupy2012 ArangoDB Workshop Part2

Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Wird geladen in …3
×

Hier ansehen

1 von 17 Anzeige
Anzeige

Weitere Verwandte Inhalte

Diashows für Sie (20)

Ähnlich wie Rupy2012 ArangoDB Workshop Part2 (20)

Anzeige

Weitere von ArangoDB Database (20)

Rupy2012 ArangoDB Workshop Part2

  1. 1. ArangoDB & Ashikawa Workshop Part 2: Ashikawa by Frank Celler and Lucas Dohmen
  2. 2. Ashikawa • Ruby Gems for ArangoDB • Ashikawa::Core • Ashikawa::AR • DataMapper 2?
  3. 3. Ashikawa::Core • Low Level Driver for ArangoDB • Abstracts the REST interface of ArangoDB • Basis for the other gems gem install ashikawa-core
  4. 4. Ashikawa::AR • Implements the Active Record pattern • Integrates with Rails • Used on happy-geoco.de Rails Rumble Project gem install ashikawa-ar
  5. 5. Data Mapper 2 • Not yet • Implements the Data Mapper pattern • Will support various data sources • If you want to know more, go to Piotr Solnica‘s talk this weekend :( • We will work on the support of ArangoDB
  6. 6. Ok, let‘s go
  7. 7. Ashikawa::Core
  8. 8. ArangoDB started? ;)
  9. 9. gem install ashikawa-core
  10. 10. 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
  11. 11. What can you do? • Access ArangoDB at a low level • More on rubydoc.info • Just search for ashikawa-core
  12. 12. Ashikawa::AR
  13. 13. Setup a new Rails App rails new --skip-active-record Add ashikawa-ar, ~> 0.1.2 to you gemfile
  14. 14. Configure your DB YourApplicationName::Application.configure do # ... # ArangoDB configuration Ashikawa::AR.setup :default, "127.0.0.1:8529" end Configuration via database.yml already planned ;)
  15. 15. class MyFineModel include Ashikawa::AR::Model attribute :name attribute :my_attribute attribute :my_string, String end # Somewhere else... model = MyFineModel.by_example name: "Johnny" rails g ashikawa:model NAME attribute attribute2:String
  16. 16. What can you do? • 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
  17. 17. Contact @moonbeamlabs @arangodb triAGENS/ashikawa-core triAGENS/ashikawa-ar lucas@arangodb.org ashikawa@googlegroups.com …or just find us this weekend :)

×