technoweenie / guillotine

URL shortening hobby kit
http://techno-weenie.net/guillotine/
MIT License
486 stars 54 forks source link

added mysql sequel example #6

Closed kalw closed 12 years ago

kalw commented 12 years ago

here is a living example =)

technoweenie commented 12 years ago

Thanks for the schema example. I chose to remove the sequel/mysql example, since that's just an example of how to use the Sequel gem.

kalw commented 12 years ago

OK. For the record that' s just a dump from the (my)sql that the sequel setup did.

irb
1.9.3p0 :001 > require 'guillotine' => true 
1.9.3p0 :002 > require 'sequel' => true 
1.9.3p0 :003 > db = Guillotine::Adapters::SequelAdapter.new(Sequel.connect('mysql://user:passwd@myhost/mydb'))
 => #<Guillotine::Adapters::SequelAdapter:0x007fa1f1c884e0 @db=#<Sequel::MySQL::Database: "mysql://root@localhost/shorten_test">, @table=#<Sequel::MySQL::Dataset: "SELECT * FROM `urls`">> 
1.9.3p0 :004 > db.setup => nil