class_docstr: PostgreSQL ARRAY type.
  
  The :class:`_postgresql.ARRAY` type is constructed in the same way
  as the core :class:`_types.ARRAY` type; a member type is required, and a
  number of dimensions is recommended if the type is to be used for more
  than one dimension::
  
      from sqlalchemy.dialects import postgresql
  
      mytable = Table("mytable", metadata,
              Column("data", postgresql.ARRAY(Integer, dimensions=2))
          )
  
  The :class:`_postgresql.ARRAY` type provides all operations defined on the
  core :class:`_types.ARRAY` type, including support for "dimensions",
  indexed access, and simple matching such as
  :meth:`.types.ARRAY.Comparator.any` and
  :meth:`.types.ARRAY.Comparator.all`.  :class:`_postgresql.ARRAY`
  class also
  provides PostgreSQL-specific methods for containment operations, including
  :meth:`.postgresql.ARRAY.Comparator.contains`
  :meth:`.postgresql.ARRAY.Comparator.contained_by`, and
  :meth:`.postgresql.ARRAY.Comparator.overlap`, e.g.::
  
      mytable.c.data.contains([1, 2])
  
  The :class:`_postgresql.ARRAY` type may not be supported on all
  PostgreSQL DBAPIs; it is currently known to work on psycopg2 only.
  
  Additionally, the :class:`_postgresql.ARRAY`
  type does not work directly in
  conjunction with the :class:`.ENUM` type.  For a workaround, see the
  special type at :ref:`postgresql_array_of_enum`.
  
  .. container:: topic
  
      **Detecting Changes in ARRAY columns when using the ORM**
  
      The :class:`_postgresql.ARRAY` type, when used with the SQLAlchemy ORM,
      does not detect in-place mutations to the array. In order to detect
      these, the :mod:`sqlalchemy.ext.mutable` extension must be used, using
      the :class:`.MutableList` class::
  
          from sqlalchemy.dialects.postgresql import ARRAY
          from sqlalchemy.ext.mutable import MutableList
  
          class SomeOrmClass(Base):
              # ...
  
              data = Column(MutableList.as_mutable(ARRAY(Integer)))
  
      This extension will allow "in-place" changes such to the array
      such as ``.append()`` to produce events which will be detected by the
      unit of work.  Note that changes to elements **inside** the array,
      including subarrays that are mutated in place, are **not** detected.
  
      Alternatively, assigning a new array value to an ORM element that
      replaces the old one will always trigger a change event.
  
  .. seealso::
  
      :class:`_types.ARRAY` - base array type
  
      :class:`_postgresql.array` - produces a literal array value.
docstr: Construct an ARRAY.
  
  E.g.::
  
    Column('myarray', ARRAY(Integer))
  
  Arguments are:
  
  :param item_type: The data type of items of this array. Note that
    dimensionality is irrelevant here, so multi-dimensional arrays like
    ``INTEGER[][]``, are constructed as ``ARRAY(Integer)``, not as
    ``ARRAY(ARRAY(Integer))`` or such.
  
  :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.
  
  :param dimensions: if non-None, the ARRAY will assume a fixed
   number of dimensions.  This will cause the DDL emitted for this
   ARRAY to include the exact number of bracket clauses ``[]``,
   and will also optimize the performance of the type overall.
   Note that PG arrays are always implicitly "non-dimensioned",
   meaning they can store any number of dimensions no matter how
   they were declared.
  
  :param zero_indexes=False: when True, index values will be converted
   between Python zero-based and PostgreSQL one-based indexes, e.g.
   a value of one will be added to all index values before passing
   to the database.
docstr_tok: ["Construct","an","ARRAY",".","E.g",".",":",":","Column","(","'myarray","'",",","ARRAY","(","Integer",")",")","Arguments","are",":",":","param","item_type",":","The","data","type","of","items","of","this","array",".","Note","that","dimensionality","is","irrelevant","here",",","so","multi-dimensional","arrays","like","``","INTEGER","[","]","[","]","``",",","are","constructed","as","``","ARRAY","(","Integer",")","``",",","not","as","``","ARRAY","(","ARRAY","(","Integer",")",")","``","or","such",".",":","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",".",":","param","dimensions",":","if","non-None",",","the","ARRAY","will","assume","a","fixed","number","of","dimensions",".","This","will","cause","the","DDL","emitted","for","this","ARRAY","to","include","the","exact","number","of","bracket","clauses","``","[","]","``",",","and","will","also","optimize","the","performance","of","the","type","overall",".","Note","that","PG","arrays","are","always","implicitly","``","non-dimensioned","''",",","meaning","they","can","store","any","number","of","dimensions","no","matter","how","they","were","declared",".",":","param","zero_indexes=False",":","when","True",",","index","values","will","be","converted","between","Python","zero-based","and","PostgreSQL","one-based","indexes",",","e.g",".","a","value","of","one","will","be","added","to","all","index","values","before","passing","to","the","database","."]
code: def __init__(
      self,
      item_type: _TypeEngineArgument[Any],
      as_tuple: bool = False,
      dimensions: Optional[int] = None,
      zero_indexes: bool = False,
  ):
      """Construct an ARRAY.
  
      E.g.::
  
        Column('myarray', ARRAY(Integer))
  
      Arguments are:
  
      :param item_type: The data type of items of this array. Note that
        dimensionality is irrelevant here, so multi-dimensional arrays like
        ``INTEGER[][]``, are constructed as ``ARRAY(Integer)``, not as
        ``ARRAY(ARRAY(Integer))`` or such.
  
      :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.
  
      :param dimensions: if non-None, the ARRAY will assume a fixed
       number of dimensions.  This will cause the DDL emitted for this
       ARRAY to include the exact number of bracket clauses ``[]``,
       and will also optimize the performance of the type overall.
       Note that PG arrays are always implicitly "non-dimensioned",
       meaning they can store any number of dimensions no matter how
       they were declared.
  
      :param zero_indexes=False: when True, index values will be converted
       between Python zero-based and PostgreSQL one-based indexes, e.g.
       a value of one will be added to all index values before passing
       to the database.
  
      """
      if isinstance(item_type, ARRAY):
          raise ValueError(
              "Do not nest ARRAY types; ARRAY(basetype) "
              "handles multi-dimensional arrays of basetype"
          )
      if isinstance(item_type, type):
          item_type = item_type()
      self.item_type = item_type
      self.as_tuple = as_tuple
      self.dimensions = dimensions
      self.zero_indexes = zero_indexes
  
imports: from __future__ import annotations
  import re
  from typing import Any
  from typing import Optional
  from typing import TypeVar
  from .operators import CONTAINED_BY
  from .operators import CONTAINS
  from .operators import OVERLAP
  from ...None import types
  from ...None import util
  from ...sql import expression
  from ...sql import operators
  from ...sql._typing import _TypeEngineArgument
label_desc: Use image node_id 1 to create a new ARRAY object from inherited base classes: sqltypes with example: obj = ARRAY(item_type, as_tuple, dimensions, zero_indexes)