You want to use adapter.select
. execute
is meant for operations that do not return results.
Example:
> adapter.select('select * from posts')
=> [#<struct id=1, title="T1", body="B1">,
#<struct id=2, title="T2", body="B2">]
You can see the documentation on the different adapter methods here:
http://rdoc.info/github/datamapper/dm-do-adapter/DataMapper/Adapters/DataObjectsAdapter
But if all need is just a pure SQLite adapter then you should be looking at something like the sqlite3
gem instead: http://rubygems.org/gems/sqlite3