Postgresql Support
PatWie opened this issue · comments
You probably address guys coming from ruby-on-rails. Will there be Postgresql support? But nice work.
I don't plan on adding PostgreSQL to the project, but I found that there are a couple changes I should make to make it easier to swap out MySQL for PostgreSQL. I should also add documentation on how to add your own database.
For a quick overview, to add PostgreSQL, you'll need to do the following:
- Change the https://github.com/blue-jay/blueprint/blob/master/lib/database/database.go file to connect to PostgreSQL database using a package like this: https://github.com/lib/pq
- Update the database migration files to use PostgresSQL queries: https://github.com/blue-jay/blueprint/tree/master/database/migration
- Update the models so they reference PostgresSQL instead of SQL
- If using Jay, add a migration package for PostgreSQL here: https://github.com/blue-jay/jay/tree/master/lib/migration
- If using Jay, update the https://github.com/blue-jay/jay/blob/master/lib/database/database.go file so it matches the database file from the first step above with the new PostgresSQL. This is so there are no dependencies between projects.
Does this make sense? Would you be willing to make a few of these changes and I can add them to a Wiki article on how to switch to PostgresSQL?
I added a wrapper for the pq package. I don't have any migrations for PostgreSQL yet, but it's a start. 84663fe