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

Add defaultDatabase property in Model Protocol #126

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

nick6969
Copy link

Description

If there are multiple databases at the same time,
Any Query must specify database,
Cannot use Datebase.dafault directly.

// if not using Datebase.dafault
struct Amodel: Model { }

// every time using find / findAll / save / update .... need put using parameter
// even always same property
Amodel.find(id: 1, using: Database.abc) { model, error in
     // do somrthing
}

But
Model is mean the record struct in the specific table and specific database.
We allow Model specify table,
Why not let Model specify Database?

@CLAassistant
Copy link

CLAassistant commented Apr 5, 2020

CLA assistant check
All committers have signed the CLA.

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.

2 participants