On Wednesday, September 27, 2017 at 7:00:10 AM UTC-7, French Fry wrote:
>
> Relatively new to Ruby, some experience with Rails (via tutorials, etc).
> I've made it through the Sequel install, a good portion of the
> documentation, have a database with two tables and have run various things
> (datasets, queries) via /bin/sequel. Now my question, I want the ORM, I've
> set up a few model files, have some controller logic going on but I'm not
> sure how to make it work WITHOUT a framework. I did find a few blogs, etc
> on setting up Ruby with Active Record (sans framework) so if it's similar I
> can go with that method, but will I lose the ability to use models, etc?
>
> Ultimately I'm looking to make this an app with Sinatra. Problem is for
> me right now that just adds another layer of complexity. I'd like to find
> a way to get things working first (controller logic with models and
> database) before setting it up in Sinatra (or whatever framework). So if
> my question isn't confusing , any advice / feedback would be appreciated.
>
Sequel setup in simple applications is basically:
require 'sequel'
DB = Sequel.connect('...')
DB.extension :extension1
Sequel::Model.plugin :plugin1
class Foo < Sequel::Model
plugin :plugin2
end
The Code Order guide
(http://sequel.jeremyevans.net/rdoc/files/doc/code_order_rdoc.html)
discusses the recommended order for setup code.
For a simple skeleton app, you can
see https://github.com/jeremyevans/roda-sequel-stack, and just replace Roda
with Sinatra if that is what you want to use.
Thanks,
Jeremy
--
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.