kingfisherframework / kingfisher-example

2 stars 0 forks source link

PostgreSQL backend support, configurable database for different environments #22

Closed JuanitoFatas closed 7 years ago

JuanitoFatas commented 7 years ago

Implements #12, #25

JuanitoFatas commented 7 years ago

@halogenandtoast Hmm the backend for PostgreSQL is exactly the same for Sqlite3.

What do you think about we don't implement ActiveRecord interface, and let users of Kingfisher use Sequel directly? => Have Repositories (interact with db) UserRepository, and User (business logic)

class UserRepository < Sequel::Model; end
class User; end

Sequel looks really powerful, if we need to implement all the things like ActiveRecord Query interface, we have a lot of responsibilities.

halogenandtoast commented 7 years ago

@JuanitoFatas the backend might not be a database backend so we should abstract as much as possible here. One idea would be to just ship with a Sequel backend so you don't have to make separate backends for sqlite3, postgresql, etc. But while they are the same right now, the question is when things get more complex, will they remain the same. It's possible as well that we just don't ship with an ORM, but I wanted to be a bit opinionated with our framework's out of the box experience.

JuanitoFatas commented 7 years ago

@JuanitoFatas the backend might not be a database backend so we should abstract as much as possible here. One idea would be to just ship with a Sequel backend so you don't have to make separate backends for sqlite3, postgresql, etc.

Should we use Sequel backend right now with PostgreSQL?

It's possible as well that we just don't ship with an ORM, but I wanted to be a bit opinionated with our framework's out of the box experience.

👍

halogenandtoast commented 7 years ago

Let's use the postgres sequel backend for now, we'll figure it out as we continue building our app.