-
Notifications
You must be signed in to change notification settings - Fork 88
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
Supporting natural keys #166
Conversation
@maiha Excellent work! 💯 |
@maiha |
Pushed -f to resolve conflicts. |
|
||
it "sets the value when the primary is defined as `auto: false`" do | ||
Kvs.new(k: "foo").k?.should eq("foo") | ||
Kvs.new(k: "foo", v: "v").k?.should eq("foo") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Blacksmoke16
Yep, I just added new
with mass-assignment yesterday into this PR!
maiha:master + new(*mass-assignment*)
→ maiha:natural-key
If you are using maiha:master branch, could you try again with maiha:natural-key or this pr branch? This should work!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah perfect! Was behind a few commits i guess :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@maiha thank you for this contribution |
This PR enhances
Model.primary
to acceptauto
option that works as a natural key if false.Example (use RDB as KVS)
First, if you use a primary key other than Int as described above, it will give a compile error with following suggestion.
After adding
auto: false
that disables auto number feature, we can play with nartural keys.Best regards,