I'd like to create an app that accesses db (with 1 table) and outputs its table in a window using FXRuby. Is there any way to make it without using query language like in this example:
require 'pg'
conn = PG.connect(dbname: 'testdb', user: 'postgres')
rows = conn.exec("select * from users")
And without using Ruby on Rails.
I've also tried to launch this example code, but it doesn't work beacause of the problem with installing sqlite3 gem
:
require 'fox16'
require 'sqlite3.rb'
include Fox
class TestApp < FXApp
def initialize
super('Test', 'Test')
@db = SQLite3::Database.new('test.db3')
@db || raise("can't connect to database")
end
def db
@db
end
end
It looks like the following should solve your problem (see this reference):