Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQL: Allow database name and schema be specified for each model #147

Closed
wants to merge 2 commits into from

Conversation

salieri
Copy link

@salieri salieri commented Jan 8, 2014

In larger applications, data is often divided between schemas and databases.

This change allows developers to define schema and database for each model that uses Postgres or MySQL database adapters. (Schemas only supported on Postgres.)

Interface is simple -- when defining a model, just add "db" and/or "schema" values:

var User = function () {
  this.db = 'mydatabasename';
  this.schema = 'myschemaname';

  this.property( ...

@mde
Copy link
Contributor

mde commented Jan 8, 2014

This looks good. Similar work is happening here: #151 Would it be possible for y'all to coordinate to make sure this stuff plays nicely together?

@salieri
Copy link
Author

salieri commented Jan 8, 2014

By the looks of it, for a successful merge all that's needed is for me to go over the tableizeModelName() calls and make sure they use tableizeModelNameFull() instead where appropriate. Should not be a problem at all.

@smitt04
Copy link

smitt04 commented Jan 8, 2014

I think to make things a little more seemless is to just change the _tablelizedModelName function just like I did in #151. In that function you can check to see if a schema is defined or not. But it should be first merged with #151 and then the schema support added.

@mde
Copy link
Contributor

mde commented Jan 22, 2014

Where are we on this? Can y'all get this sorted out, or do I need to do separate merges and then sort it out?

@salieri
Copy link
Author

salieri commented Feb 2, 2014

Will get back to you after crunch mode is over, give it a few weeks.

@mde
Copy link
Contributor

mde commented Feb 6, 2014

Excellent. :) Lemme know if there's anything I can do to help.

@salieri salieri closed this Jun 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants