J
Jamis Buck
SQLite/Ruby is an interface for Ruby into the SQLite database engine. It
is only for SQLite version 2.x -- it does not (yet) support 3.x.
http://sqlite-ruby.rubyforge.org
http://rubyforge.org/projects/sqlite-ruby
This version is a completely rewrite of the original codebase. (Yes,
you're probably sensing a pattern here... copland... then sqlite-ruby...
the more I learn about Ruby, the more I realize that much of the code I
wrote even a year ago could be done much more cleanly and concisely, and
I so I'm working to fix those flaws.)
Futhermore, this is only a BETA RELEASE. It is probably not ready for
production environments yet, since the API may change from release to
release. I need people willing to put this release through its paces, to
help me solidify it for a stable 2.1 release. If you're willing, go
ahead and download it and start sending me suggestions (or submitting
bug reports via the trackers on RubyForge).
So, the meat of this release:
* The previous release used the callback-based "sqlite_exec" API.
This was fairly fragile from Ruby's perspective, since exceptions and
the like could result easily in locked or busy databases. This release
moves to the compile/step/finalize API, which does not use C callback
functions. This makes it much easier to use both internal and external
iterators for queries. It also makes the Ruby interface much more robust.
* "show_datatypes" is now always on (and cannot be changed), since it
only applied to the "sqlite_exec" interface.
* Type translators are now registered per database instance, instead
of globally. This allows multiple databases to exist with different
translators for the same datatypes.
* The interface has been broken apart into
Database/Pragma/Statement/ResultSet responsibilities.
* Better metadata querying.
* Better (and more) unit tests.
* Rows are returned as arrays by default, instead of hashes, but rows
as hashes are still supported (see Database#results_as_hash).
Support for Ara's "arrayfields" module remains implicit. If you require
the arrayfields module before doing a query, then the rows that returned
may be indexed by column name (like a hash) or iterated through by index
(like an array).
Lastly: some of you may be wondering why I still bother with the older
2.x interface for SQLite, given that the 3.x interface is almost out of
beta. Three reasons: one, I'm familiar with it. Two, there are still
alot of people that use 2.x databases. Three, a Ruby interface for
SQLite3 is forthcoming--watch this space!
--
Jamis Buck
(e-mail address removed)
http://www.jamisbuck.org/jamis
"I use octal until I get to 8, and then I switch to decimal."
is only for SQLite version 2.x -- it does not (yet) support 3.x.
http://sqlite-ruby.rubyforge.org
http://rubyforge.org/projects/sqlite-ruby
This version is a completely rewrite of the original codebase. (Yes,
you're probably sensing a pattern here... copland... then sqlite-ruby...
the more I learn about Ruby, the more I realize that much of the code I
wrote even a year ago could be done much more cleanly and concisely, and
I so I'm working to fix those flaws.)
Futhermore, this is only a BETA RELEASE. It is probably not ready for
production environments yet, since the API may change from release to
release. I need people willing to put this release through its paces, to
help me solidify it for a stable 2.1 release. If you're willing, go
ahead and download it and start sending me suggestions (or submitting
bug reports via the trackers on RubyForge).
So, the meat of this release:
* The previous release used the callback-based "sqlite_exec" API.
This was fairly fragile from Ruby's perspective, since exceptions and
the like could result easily in locked or busy databases. This release
moves to the compile/step/finalize API, which does not use C callback
functions. This makes it much easier to use both internal and external
iterators for queries. It also makes the Ruby interface much more robust.
* "show_datatypes" is now always on (and cannot be changed), since it
only applied to the "sqlite_exec" interface.
* Type translators are now registered per database instance, instead
of globally. This allows multiple databases to exist with different
translators for the same datatypes.
* The interface has been broken apart into
Database/Pragma/Statement/ResultSet responsibilities.
* Better metadata querying.
* Better (and more) unit tests.
* Rows are returned as arrays by default, instead of hashes, but rows
as hashes are still supported (see Database#results_as_hash).
Support for Ara's "arrayfields" module remains implicit. If you require
the arrayfields module before doing a query, then the rows that returned
may be indexed by column name (like a hash) or iterated through by index
(like an array).
Lastly: some of you may be wondering why I still bother with the older
2.x interface for SQLite, given that the 3.x interface is almost out of
beta. Three reasons: one, I'm familiar with it. Two, there are still
alot of people that use 2.x databases. Three, a Ruby interface for
SQLite3 is forthcoming--watch this space!
--
Jamis Buck
(e-mail address removed)
http://www.jamisbuck.org/jamis
"I use octal until I get to 8, and then I switch to decimal."