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

Support table with composite key but no column id #135

Closed
huangyingjie opened this issue Apr 21, 2013 · 3 comments
Closed

Support table with composite key but no column id #135

huangyingjie opened this issue Apr 21, 2013 · 3 comments

Comments

@huangyingjie
Copy link

Hi,
Here is part of my table:

mysql> desc webperformance;
+--------------------------+--------------+------+-----+---------+-------+
| Field                    | Type         | Null | Key | Default | Extra |
+--------------------------+--------------+------+-----+---------+-------+
| datekey                  | int(10)      | NO   | PRI |         |       |
| domain                   | varchar(30)  | NO   | PRI |         |       |
| url                      | varchar(128) | NO   | PRI |         |       |
| domainLookupTime         | int(10)      | YES  |     | NULL    |       |
| connectEstablishTime     | int(10)      | YES  |     | NULL    |       |

It has a composite key with 3 columns datekey,domain and url, and has no id.
I know that the orm might expect every table has a primary key named id or just specify a column instead. I just wander it also spports composite key, thanks.
Just come from #132

@dresende
Copy link
Owner

I'm sure it will be possible :) I have to accept an Array of properties as the keys and also have support on Model.get to pass the 3 columns (or more or less).

@huangyingjie
Copy link
Author

Expecting

@dresende
Copy link
Owner

Look at #137. I'll merge it when I change everything related to this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants