Skip to content

Support table with composite key but no column id #135

Closed

Description

@huangyingjie

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

Activity

  1. dresende commented on Apr 21, 2013

    @dresende
    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).

  2. huangyingjie commented on Apr 22, 2013

    @huangyingjie
    Author

    Expecting

  3. dresende commented on Apr 22, 2013

    @dresende
    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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions