I'm using Datamapper+SqLite. I need to use a direct query like so:
adapter = DataMapper.repository(:default).adapter
adapter.execute("SELECT * FROM stuff")
How do I see the output of this thing? I see type DataObjects::Sqlite3::Result in irb? Also, any recommendations on how to see SQLite results, ala PHPMyAdmin for Mac?
You want to use
adapter.select.executeis meant for operations that do not return results.Example:
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
sqlite3gem instead: http://rubygems.org/gems/sqlite3