Re: [sqlalchemy] implementing implicit scalar collections
Hi Mike, On 05/25/13 17:59, Michael Bayer wrote: Your primary key is far from useless. If your collection consists of unique values, then that's your primary key. If your collection consists of non-unique values, but are unique to their parent, then again, that's your primary key (a composite). If your collection consists of non-unique values within a single parent, then you can't manipulate that data correctly since you can't target individual rows. OK, just wanted to make sure. In that case, it'd be best to store an array of primitives as native postgres ARRAY objects if one wants to trade off the overhead of primary keys for the overhead of re-writing the whole array on every update. Another feature request for Spyne, I guess :) So its simple and straightforward just to map to that primary key. SQLAlchemy could someday provide some out of the box system that does the mapping and association proxy for you but it's really not that big a deal to automate this yourself. I guess I've already done that automation. I do create the table, the mapping and the association proxy automatically. Thank you for your response. Best, Burak -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com. To post to this group, send email to sqlalchemy@googlegroups.com. Visit this group at http://groups.google.com/group/sqlalchemy?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: [sqlalchemy] implementing implicit scalar collections
On May 22, 2013, at 4:51 PM, Burak Arslan wrote: > Hi, > > I've just implemented support for scalar collections for Spyne. (In Spyne > terms that's sql serialization of an array of primitives). Seems to be > working fine so far. > > The question is: Is the association proxy the only (read/write) way of doing > this? It requires the child table to be mapped, which requires the child > table to have a primary key, which is sometimes completely useless. I also > have to create another implicit attribute so that the association proxy can > fetch the value off of it. Saw this yesterday and forgot to get to it. Your primary key is far from useless. If your collection consists of unique values, then that's your primary key. If your collection consists of non-unique values, but are unique to their parent, then again, that's your primary key (a composite). If your collection consists of non-unique values within a single parent, then you can't manipulate that data correctly since you can't target individual rows. So its simple and straightforward just to map to that primary key. SQLAlchemy could someday provide some out of the box system that does the mapping and association proxy for you but it's really not that big a deal to automate this yourself. -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com. To post to this group, send email to sqlalchemy@googlegroups.com. Visit this group at http://groups.google.com/group/sqlalchemy?hl=en. For more options, visit https://groups.google.com/groups/opt_out.