add "dimension" attribute to pg.ARRAY - implement DDL, and when present optimize bind/result to this
replaces #1591
Comments (7)
-
reporter -
reporter - attached 2441.patch
p
-
reporter I forgot that PG arrays do N-dimensions implicitly. So the attached patch makes "dimensions" optional. Unfortunately we can't do the stack version if we need to convert the collection to a tuple, so we might want to combine all of these approaches, not sure. Needs new tests and docs in any case, the existing tests are all over the place. tests should include dimensions =None to ensure we can still put different numbers of dimensions per individual row.
-
reporter let's also make the "collection" configurable - let's make it "collection_cls=<somecls>", astuple does this, then add docs pointing to sqlalchemy.ext.mutable for usage with the ORM, that way no TypeDecorator is needed. probably add a specific example to the mutable docs.
mutable_pg = MutableList.as_mutable(postgresql.ARRAY(Integer, collection_cls=MutableList))
-
reporter -
reporter - changed status to resolved
-
reporter - removed milestone
Removing milestone: 0.8.0b1 (automated comment)
- Log in to comment
Here's a stack based algorithm to process+copy any N-dimensional structure, given the dimension: