I have a complex join and union SQL statement that I need to execute against my models for my app, and it looks like I can use the db.executeSql(string SQL) command. Stupid question: how do I execute this?
sql = "SELECT blah blah blah..."
db = Rho::Database
@addresses = db.executeSql(sql)
Undefined method 'executeSql' for Rho::Database:class
Am I missing a require or include? Do I need to open the Database first? If so, how do I know that the name is?
Well it appears as though it's as easy as using the vague documentation (http://docs.rhomobile.com/en/4.0.0/api/Database#e1):
path = Rho::Application.databaseFilePath('app')
db = Rho::Database.new(path, 'app')
@addresses = db.executeSql(@sql)
Now I just need to figure out how to access the results in the view...