You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Need ability to assign indexes and manually assign primary key column #32
I have not seen anywhere where I can define a column to have an index associated with it. This could really increase the speed of searches based on other columns than ID or foreign keys.
Forcing of a primary key "id" when I want a different column to be that key.
What I have is an existing data model that I want to utilize with this library. One other thing that I feel is bad is that when defining a model, "user", the library adds an "s" to it automatically making it "users". This change, I believe, is not something that should happen as it changes the developer's expectation of the data model on the back-end. And it makes integration with other systems that would use the back-end data difficult if they are the ones that originally defined the model.
@indexes: right... nice one :) @primary key "id": there is already an issue. that's pretty difficulty. will take some time to prepare the code for that i guess. @adding a s: the app isn't adding a s but transforming the word into plural :) I used that behavoir due to my background as rails developer. they are doing it as well and i never had problems with that. but i will think about that :)
I've started working on potential solutions on this.
I have a field that defines the key column. I was thinking that it is possible to have multiple primary keys in the case of a complex table definition. An example of I am working on right now a radius SQL backend where there is no ID field, but a userID and an attribute field, combined they make a primary key. I didn't write it, I'm just working with it. I've added an ID field to make it work. But to ensure unique user/attribute I wanted to be able to define it in the object as it is in the DB.
I have completed this... however.. I'm having some difficulty with the association code.. (You got some complex stuff in there)
I am chugging through it. So everything works.. until you want to work with associations.
Added Index specification.
Added Primary key option
Added ability to specify multiple primary key columns.
Added the ability to specify the size of a string in column definition (letting the DB truncate data for you)
Activity
sdepold commentedon Sep 27, 2010
hey there,
@indexes: right... nice one :)
@primary key "id": there is already an issue. that's pretty difficulty. will take some time to prepare the code for that i guess.
@adding a s: the app isn't adding a s but transforming the word into plural :) I used that behavoir due to my background as rails developer. they are doing it as well and i never had problems with that. but i will think about that :)
Trakkasure commentedon Sep 27, 2010
I've started working on potential solutions on this.
I have a field that defines the key column. I was thinking that it is possible to have multiple primary keys in the case of a complex table definition. An example of I am working on right now a radius SQL backend where there is no ID field, but a userID and an attribute field, combined they make a primary key. I didn't write it, I'm just working with it. I've added an ID field to make it work. But to ensure unique user/attribute I wanted to be able to define it in the object as it is in the DB.
Trakkasure commentedon Sep 27, 2010
I have completed this... however.. I'm having some difficulty with the association code.. (You got some complex stuff in there)
I am chugging through it. So everything works.. until you want to work with associations.
Added Index specification.
Added Primary key option
Added ability to specify multiple primary key columns.
Added the ability to specify the size of a string in column definition (letting the DB truncate data for you)
Trakkasure commentedon Sep 28, 2010
Check pull request for completed code.