summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2010-11-28 12:16:39 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2010-11-28 12:16:39 -0500
commitd14d171772c343203bbceee3d40ca09427b8b869 (patch)
treeaf4b29cc785b31441c907ed68122c7cf513588fe /lib/sqlalchemy/dialects
parent23b082f5b1c30ee1cb14c4c7c821d099ddd1a19c (diff)
downloadsqlalchemy-d14d171772c343203bbceee3d40ca09427b8b869.tar.gz
- the "mutable" flag on PickleType, postgresql.ARRAY is now off
by default. [ticket:1980]
Diffstat (limited to 'lib/sqlalchemy/dialects')
-rw-r--r--lib/sqlalchemy/dialects/postgresql/base.py25
1 files changed, 13 insertions, 12 deletions
diff --git a/lib/sqlalchemy/dialects/postgresql/base.py b/lib/sqlalchemy/dialects/postgresql/base.py
index 47e6d6ea8..f000520ca 100644
--- a/lib/sqlalchemy/dialects/postgresql/base.py
+++ b/lib/sqlalchemy/dialects/postgresql/base.py
@@ -224,15 +224,11 @@ class ARRAY(sqltypes.MutableType, sqltypes.Concatenable, sqltypes.TypeEngine):
The ARRAY type may not be supported on all DBAPIs.
It is known to work on psycopg2 and not pg8000.
- **Note:** be sure to read the notes for
- :class:`.MutableType` regarding ORM
- performance implications. The :class:`.ARRAY` type's
- mutability can be disabled using the "mutable" flag.
"""
__visit_name__ = 'ARRAY'
- def __init__(self, item_type, mutable=True, as_tuple=False):
+ def __init__(self, item_type, mutable=False, as_tuple=False):
"""Construct an ARRAY.
E.g.::
@@ -247,14 +243,19 @@ class ARRAY(sqltypes.MutableType, sqltypes.Concatenable, sqltypes.TypeEngine):
``ARRAY(ARRAY(Integer))`` or such. The type mapping figures out on
the fly
- :param mutable=True: Specify whether lists passed to this
- class should be considered mutable. If so, generic copy operations
- (typically used by the ORM) will shallow-copy values.
+ :param mutable=False: Specify whether lists passed to this
+ class should be considered mutable - this enables
+ "mutable types" mode in the ORM. Be sure to read the
+ notes for :class:`.MutableType` regarding ORM
+ performance implications (default changed from ``True`` in
+ 0.7.0).
- :param as_tuple=False: Specify whether return results should be converted
- to tuples from lists. DBAPIs such as psycopg2 return lists by default.
- When tuples are returned, the results are hashable. This flag can only
- be set to ``True`` when ``mutable`` is set to ``False``. (new in 0.6.5)
+ :param as_tuple=False: Specify whether return results
+ should be converted to tuples from lists. DBAPIs such
+ as psycopg2 return lists by default. When tuples are
+ returned, the results are hashable. This flag can only
+ be set to ``True`` when ``mutable`` is set to
+ ``False``. (new in 0.6.5)
"""
if isinstance(item_type, ARRAY):