Assaph Mehr
2006-Feb-15 00:44 UTC
[Rails] [ANN] Ackbar - ActiveRecord Adapter for KirbyBase
= About Ackbar Ackbar is an adapter for ActiveRecord (the Rails ORM layer) to the KirbyBase pure-ruby plain-text DBMS. Because KirbyBase does not support SQL, joins or transactions, this is not a 100% fit. There are some changes to the ActiveRecord interface (see below), but it may still be useful in some cases. = URIs Ackbar: http://ackbar.rubyforge.org KirbyBase: http://www.netpromi.com/kirbybase_ruby.html Rails: http://www.rubyonrails.com Pimki: http://pimki.rubyforge.org = Goals Ackbar''s project goals, in order of importance, are: 1. Support Pimki with a pure-ruby, cross-platform hassle-less install DBMS 2. An exercise for me to learn ActiveRecord inside out 3. Support other "shrink-wrapped" Rails projects with similar needs As can be seen, the main reason I need Ackbar is so I distribute Pimki across multiple platforms without requiring non-Ruby 3rd party libraries. KirbyBase will work wherever Ruby works, and so will Pimki. That alleviates the need to repackage other bits, end users will not have to install extra software, I have full control on the storage, the storage is in plain text. Just what I need to "shrink wrap" a Rails project for end-user distribution. = What''s Covered Ackbar currently passes through a small bootstrap test suite, and through about 80% of the ActiveRecord test suite. I will never pass 100% of the tests because KirbyBase does not support all required functionality. Ackbar includes a SQL fragment translator, so that simple cross-database code should be maintainable. For example the following will work as expected, Book.find :all, :conditions => "name = ''Pickaxe''" Book.find :all, :conditions => ["name = ?", ''Pickaxe''] Additionally, you can also provide blocks: Book.find :all, :conditions => lambda{|rec| rec.name == ''Pickaxe''} or even: Book.find(:all) {|rec| rec.name == ''Pickaxe''} Most of these changes are around the #find method, bit some apply to #update and associations. Basic SQL translation should work the same, but you can always provide custom code to be used. See the CHANGELOG and the tests for examples. = What''s Not Covered * Transactions * Joins, and therefore Eager Associations * Mixins * Other plugins On the todo list is support for mixins. It might even be possible to rig something to simulate joins and eager associations, but that is for a later stage. Transactions will obviously only be supported once they are supported by KirbyBase. Additionally, there are numerous little changes to the standard behaviour. See the CHANGELOG and the tests for more details. These may cause little heart attacks if you expect a standard SQL database. It is also worth noting that other plugins that write SQL will not work. You will need to get a copy of them to your /vendors dir and modify the relevant parts. = Installation Simply: gem install ackbar or download the zip file from http://rubyforge.org/projects/ackbar and just stick kirbybase_adapter.rb in the Rails lib dir. You will then need to add require ''kirbybase_adapter'' in the config/environment.rb file of your project. If you plan on multi-database development / deployment, you must require the adapter only if necessary: require ''kirbybase_adapter'' if ActiveRecord::Base.configurations[RAILS_ENV][''adapter''] == ''kirbybase'' This is because Ackbar overrides certain methods in ActiveRecord::Base and others. These methods translate the standard SQL generation to method calls on KirbyBase, and obviously should not be overridden for regular DBs. Please do not hesitate to contact me for questions, comments, whacks on the head with a clue stick :-) Cheers, Assaph
Ezra Zygmuntowicz
2006-Feb-15 06:08 UTC
[Rails] [ANN] Ackbar - ActiveRecord Adapter for KirbyBase
Assaph- This is freaking great! I have been eagerly awaiting to see what you come up with for the kirbybase adapter. I love kirbybase and the prospect of a pure ruby db layer is very attractive for some projects i am working on. I will use this heavily in a project I am working on so i will get back to you with some feedback and maybe even some patches ;) Thanks for writing this Cheers- -Ezra On Feb 14, 2006, at 4:44 PM, Assaph Mehr wrote:> = About Ackbar > > Ackbar is an adapter for ActiveRecord (the Rails ORM layer) to the > KirbyBase > pure-ruby plain-text DBMS. Because KirbyBase does not support SQL, > joins or > transactions, this is not a 100% fit. There are some changes to the > ActiveRecord > interface (see below), but it may still be useful in some cases. > > = URIs > > Ackbar: http://ackbar.rubyforge.org > KirbyBase: http://www.netpromi.com/kirbybase_ruby.html > Rails: http://www.rubyonrails.com > Pimki: http://pimki.rubyforge.org > > = Goals > > Ackbar''s project goals, in order of importance, are: > 1. Support Pimki with a pure-ruby, cross-platform hassle-less > install DBMS > 2. An exercise for me to learn ActiveRecord inside out > 3. Support other "shrink-wrapped" Rails projects with similar needs > > As can be seen, the main reason I need Ackbar is so I distribute > Pimki across > multiple platforms without requiring non-Ruby 3rd party libraries. > KirbyBase will > work wherever Ruby works, and so will Pimki. That alleviates the need > to repackage > other bits, end users will not have to install extra software, I have > full control > on the storage, the storage is in plain text. Just what I need to > "shrink wrap" > a Rails project for end-user distribution. > > = What''s Covered > > Ackbar currently passes through a small bootstrap test suite, and > through about > 80% of the ActiveRecord test suite. I will never pass 100% of the > tests because > KirbyBase does not support all required functionality. > > Ackbar includes a SQL fragment translator, so that simple cross- > database code > should be maintainable. For example the following will work as > expected, > Book.find :all, :conditions => "name = ''Pickaxe''" > Book.find :all, :conditions => ["name = ?", ''Pickaxe''] > Additionally, you can also provide blocks: > Book.find :all, :conditions => lambda{|rec| rec.name == ''Pickaxe''} > or even: > Book.find(:all) {|rec| rec.name == ''Pickaxe''} > > Most of these changes are around the #find method, bit some apply > to #update and > associations. Basic SQL translation should work the same, but you > can always > provide custom code to be used. See the CHANGELOG and the tests for > examples. > > > = What''s Not Covered > > * Transactions > * Joins, and therefore Eager Associations > * Mixins > * Other plugins > > On the todo list is support for mixins. It might even be possible to > rig something > to simulate joins and eager associations, but that is for a later > stage. Transactions > will obviously only be supported once they are supported by KirbyBase. > > Additionally, there are numerous little changes to the standard > behaviour. See > the CHANGELOG and the tests for more details. These may cause little > heart attacks > if you expect a standard SQL database. > > It is also worth noting that other plugins that write SQL will not > work. You will > need to get a copy of them to your /vendors dir and modify the > relevant parts. > > = Installation > > Simply: > gem install ackbar > or download the zip file from http://rubyforge.org/projects/ackbar and > just stick > kirbybase_adapter.rb in the Rails lib dir. > > You will then need to add > require ''kirbybase_adapter'' > in the config/environment.rb file of your project. > > If you plan on multi-database development / deployment, you must > require the adapter > only if necessary: > require ''kirbybase_adapter'' if > ActiveRecord::Base.configurations[RAILS_ENV][''adapter''] == ''kirbybase'' > > This is because Ackbar overrides certain methods in ActiveRecord::Base > and others. > These methods translate the standard SQL generation to method calls on > KirbyBase, > and obviously should not be overridden for regular DBs. > > > Please do not hesitate to contact me for questions, comments, whacks > on the head with a clue stick :-) > > Cheers, > Assaph > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-Ezra Zygmuntowicz WebMaster Yakima Herald-Republic Newspaper ezra@yakima-herald.com 509-577-7732
Ezra Zygmuntowicz
2006-Feb-15 06:09 UTC
[Rails] [ANN] Ackbar - ActiveRecord Adapter for KirbyBase
Oh, one more question. Is it possible to use this outside of rails? Or is it tied in somehow? -Ezra On Feb 14, 2006, at 4:44 PM, Assaph Mehr wrote:> = About Ackbar > > Ackbar is an adapter for ActiveRecord (the Rails ORM layer) to the > KirbyBase > pure-ruby plain-text DBMS. Because KirbyBase does not support SQL, > joins or > transactions, this is not a 100% fit. There are some changes to the > ActiveRecord > interface (see below), but it may still be useful in some cases. > > = URIs > > Ackbar: http://ackbar.rubyforge.org > KirbyBase: http://www.netpromi.com/kirbybase_ruby.html > Rails: http://www.rubyonrails.com > Pimki: http://pimki.rubyforge.org > > = Goals > > Ackbar''s project goals, in order of importance, are: > 1. Support Pimki with a pure-ruby, cross-platform hassle-less > install DBMS > 2. An exercise for me to learn ActiveRecord inside out > 3. Support other "shrink-wrapped" Rails projects with similar needs > > As can be seen, the main reason I need Ackbar is so I distribute > Pimki across > multiple platforms without requiring non-Ruby 3rd party libraries. > KirbyBase will > work wherever Ruby works, and so will Pimki. That alleviates the need > to repackage > other bits, end users will not have to install extra software, I have > full control > on the storage, the storage is in plain text. Just what I need to > "shrink wrap" > a Rails project for end-user distribution. > > = What''s Covered > > Ackbar currently passes through a small bootstrap test suite, and > through about > 80% of the ActiveRecord test suite. I will never pass 100% of the > tests because > KirbyBase does not support all required functionality. > > Ackbar includes a SQL fragment translator, so that simple cross- > database code > should be maintainable. For example the following will work as > expected, > Book.find :all, :conditions => "name = ''Pickaxe''" > Book.find :all, :conditions => ["name = ?", ''Pickaxe''] > Additionally, you can also provide blocks: > Book.find :all, :conditions => lambda{|rec| rec.name == ''Pickaxe''} > or even: > Book.find(:all) {|rec| rec.name == ''Pickaxe''} > > Most of these changes are around the #find method, bit some apply > to #update and > associations. Basic SQL translation should work the same, but you > can always > provide custom code to be used. See the CHANGELOG and the tests for > examples. > > > = What''s Not Covered > > * Transactions > * Joins, and therefore Eager Associations > * Mixins > * Other plugins > > On the todo list is support for mixins. It might even be possible to > rig something > to simulate joins and eager associations, but that is for a later > stage. Transactions > will obviously only be supported once they are supported by KirbyBase. > > Additionally, there are numerous little changes to the standard > behaviour. See > the CHANGELOG and the tests for more details. These may cause little > heart attacks > if you expect a standard SQL database. > > It is also worth noting that other plugins that write SQL will not > work. You will > need to get a copy of them to your /vendors dir and modify the > relevant parts. > > = Installation > > Simply: > gem install ackbar > or download the zip file from http://rubyforge.org/projects/ackbar and > just stick > kirbybase_adapter.rb in the Rails lib dir. > > You will then need to add > require ''kirbybase_adapter'' > in the config/environment.rb file of your project. > > If you plan on multi-database development / deployment, you must > require the adapter > only if necessary: > require ''kirbybase_adapter'' if > ActiveRecord::Base.configurations[RAILS_ENV][''adapter''] == ''kirbybase'' > > This is because Ackbar overrides certain methods in ActiveRecord::Base > and others. > These methods translate the standard SQL generation to method calls on > KirbyBase, > and obviously should not be overridden for regular DBs. > > > Please do not hesitate to contact me for questions, comments, whacks > on the head with a clue stick :-) > > Cheers, > Assaph > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-Ezra Zygmuntowicz WebMaster Yakima Herald-Republic Newspaper ezra@yakima-herald.com 509-577-7732
Good job, Assaph! I was the one who posted about talking to kirbybase the other day. I''m defninitely looking forward to checking this out, though it''s a little disappointing that you faced so much trouble because of kirbybase. I guess I can''t blame the guy for making his embedded db the way he wanted, but it troubles me to have to make concesions to get an embedded db. I think you understand me when I pine for a simple self-contained db that one can distribute with their app, ready to go. You know that strikes me as especially funny given DHH''s recital of the application db vs. integration db thing. If we''re making dedicated databases, why even bother with a server process at all? Rails should come with an embedded db of some type, ready to roll. Then we could just define plain old ruby objects (POROs) and run generators to whip up some scaffolding. This would create the tables as needed in the db and we''d be up and running after merely writing some dead-simple ruby classes. It''ll happen... some day. Who knows? Maybe I''ll do it. :-) b Assaph Mehr wrote:> = About Ackbar > > Ackbar is an adapter for ActiveRecord (the Rails ORM layer) to the KirbyBase > pure-ruby plain-text DBMS. Because KirbyBase does not support SQL, joins or > transactions, this is not a 100% fit. There are some changes to the ActiveRecord > interface (see below), but it may still be useful in some cases. > > = URIs > > Ackbar: http://ackbar.rubyforge.org > KirbyBase: http://www.netpromi.com/kirbybase_ruby.html > Rails: http://www.rubyonrails.com > Pimki: http://pimki.rubyforge.org > > = Goals > > Ackbar''s project goals, in order of importance, are: > 1. Support Pimki with a pure-ruby, cross-platform hassle-less install DBMS > 2. An exercise for me to learn ActiveRecord inside out > 3. Support other "shrink-wrapped" Rails projects with similar needs > > As can be seen, the main reason I need Ackbar is so I distribute Pimki across > multiple platforms without requiring non-Ruby 3rd party libraries. > KirbyBase will > work wherever Ruby works, and so will Pimki. That alleviates the need > to repackage > other bits, end users will not have to install extra software, I have > full control > on the storage, the storage is in plain text. Just what I need to "shrink wrap" > a Rails project for end-user distribution. > > = What''s Covered > > Ackbar currently passes through a small bootstrap test suite, and through about > 80% of the ActiveRecord test suite. I will never pass 100% of the tests because > KirbyBase does not support all required functionality. > > Ackbar includes a SQL fragment translator, so that simple cross-database code > should be maintainable. For example the following will work as expected, > Book.find :all, :conditions => "name = ''Pickaxe''" > Book.find :all, :conditions => ["name = ?", ''Pickaxe''] > Additionally, you can also provide blocks: > Book.find :all, :conditions => lambda{|rec| rec.name == ''Pickaxe''} > or even: > Book.find(:all) {|rec| rec.name == ''Pickaxe''} > > Most of these changes are around the #find method, bit some apply to #update and > associations. Basic SQL translation should work the same, but you can always > provide custom code to be used. See the CHANGELOG and the tests for examples. > > > = What''s Not Covered > > * Transactions > * Joins, and therefore Eager Associations > * Mixins > * Other plugins > > On the todo list is support for mixins. It might even be possible to > rig something > to simulate joins and eager associations, but that is for a later > stage. Transactions > will obviously only be supported once they are supported by KirbyBase. > > Additionally, there are numerous little changes to the standard behaviour. See > the CHANGELOG and the tests for more details. These may cause little > heart attacks > if you expect a standard SQL database. > > It is also worth noting that other plugins that write SQL will not > work. You will > need to get a copy of them to your /vendors dir and modify the relevant parts. > > = Installation > > Simply: > gem install ackbar > or download the zip file from http://rubyforge.org/projects/ackbar and > just stick > kirbybase_adapter.rb in the Rails lib dir. > > You will then need to add > require ''kirbybase_adapter'' > in the config/environment.rb file of your project. > > If you plan on multi-database development / deployment, you must > require the adapter > only if necessary: > require ''kirbybase_adapter'' if > ActiveRecord::Base.configurations[RAILS_ENV][''adapter''] == ''kirbybase'' > > This is because Ackbar overrides certain methods in ActiveRecord::Base > and others. > These methods translate the standard SQL generation to method calls on > KirbyBase, > and obviously should not be overridden for regular DBs. > > > Please do not hesitate to contact me for questions, comments, whacks > on the head with a clue stick :-) > > Cheers, > Assaph > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails
Assaph Mehr
2006-Feb-15 10:59 UTC
[Rails] [ANN] Ackbar - ActiveRecord Adapter for KirbyBase
Hi Ezra, On 2/15/06, Ezra Zygmuntowicz <ezra@yakimaherald.com> wrote:> Oh, one more question. Is it possible to use this outside of rails? > Or is it tied in somehow?It''s tied to ActiveRecord... :-) But you can use it in a "console" mode. In fact I used this to play around with it while developing. Just define the model as you normally would and call something similar to Rails'' script/console (or write your own IRB wrapper). But I must say I really don''t see the big advantage - if you''re not tied to Rails you might as well use KB directly, or use an ORM layer like Og which wouldn''t have all those caveats and dark corners. Cheers, Assaph
Assaph Mehr
2006-Feb-15 11:06 UTC
[Rails] [ANN] Ackbar - ActiveRecord Adapter for KirbyBase
Hi Ben, Thanks for the kind words.> I''m defninitely looking forward to checking this out, though it''s a little disappointing > that you faced so much trouble because of kirbybase.Let me just state that Jamey Cribbs was wonderful - he gave me excellent advise and support and even implemented a few changes I asked for make this possible. KirbyBase is an excellent piece of software. It is the way it is because it is the best way for a pure-Ruby DBMS which doesn''t need SQL. There is an unavoidable paradigm gap between the two, and any shortcoming is purely on the side of ackbar, not KirbyBase or Rails. Cheers, Assaph
David Mitchell
2006-Feb-15 11:22 UTC
[Rails] [ANN] Ackbar - ActiveRecord Adapter for KirbyBase
I only just found out myself that this is the space that Sqlite fills - it''s a single file DB that''s perfect for a specific set of uses (notably embedded apps, but that''s not all). I''d seen info about others using Sqlite with Rails, but I''d just pushed that info to one side on the incorrect assumption that Sqlite was yet another MySQL/Postgres/Firebird/...-like FOSS database with no real compelling reason for me personally to switch from my favorite Postgres. If you aren''t already across Sqlite, give it a look and see what you think. Regards Dave M. On 15/02/06, Ben Munat <bent@munat.com> wrote:> I think you understand me when I pine for a simple self-contained db > that one can distribute with their app, ready to go.
I used SqlLite to work through the Nitro+Og tutorial the other day, but didn''t stop to read the details. I''ll have to check it out some more. Thanks! I guess ultimately I''m trying to move all my comfy Java furniture into my new Ruby apartment... having an embedded db like HSQLDB to include "in process" is just sweet. b David Mitchell wrote:> I only just found out myself that this is the space that Sqlite fills > - it''s a single file DB that''s perfect for a specific set of uses > (notably embedded apps, but that''s not all). I''d seen info about > others using Sqlite with Rails, but I''d just pushed that info to one > side on the incorrect assumption that Sqlite was yet another > MySQL/Postgres/Firebird/...-like FOSS database with no real compelling > reason for me personally to switch from my favorite Postgres. > > If you aren''t already across Sqlite, give it a look and see what you think. > > Regards > > Dave M. > > On 15/02/06, Ben Munat <bent@munat.com> wrote: > >>I think you understand me when I pine for a simple self-contained db >>that one can distribute with their app, ready to go. > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails
Reasonably Related Threads
- Ackbar 0.1.1 - ActiveRecord Adapter for KirbyBase
- Blog of building Agile Web Development w/Rails Depot App using Ackbar/KirbyBase (Chapter 6-7)
- ActiveRecord for kirbybase?
- Summary of my Rails/Ackbar/KirbyBase experiment posted
- Ackbar, KirbyBase, and Agile Web Development With Rails Blog