class_docstr: PostgreSQL ENUM type.
  
  This is a subclass of :class:`_types.Enum` which includes
  support for PG's ``CREATE TYPE`` and ``DROP TYPE``.
  
  When the builtin type :class:`_types.Enum` is used and the
  :paramref:`.Enum.native_enum` flag is left at its default of
  True, the PostgreSQL backend will use a :class:`_postgresql.ENUM`
  type as the implementation, so the special create/drop rules
  will be used.
  
  The create/drop behavior of ENUM is necessarily intricate, due to the
  awkward relationship the ENUM type has in relationship to the
  parent table, in that it may be "owned" by just a single table, or
  may be shared among many tables.
  
  When using :class:`_types.Enum` or :class:`_postgresql.ENUM`
  in an "inline" fashion, the ``CREATE TYPE`` and ``DROP TYPE`` is emitted
  corresponding to when the :meth:`_schema.Table.create` and
  :meth:`_schema.Table.drop`
  methods are called::
  
      table = Table('sometable', metadata,
          Column('some_enum', ENUM('a', 'b', 'c', name='myenum'))
      )
  
      table.create(engine)  # will emit CREATE ENUM and CREATE TABLE
      table.drop(engine)  # will emit DROP TABLE and DROP ENUM
  
  To use a common enumerated type between multiple tables, the best
  practice is to declare the :class:`_types.Enum` or
  :class:`_postgresql.ENUM` independently, and associate it with the
  :class:`_schema.MetaData` object itself::
  
      my_enum = ENUM('a', 'b', 'c', name='myenum', metadata=metadata)
  
      t1 = Table('sometable_one', metadata,
          Column('some_enum', myenum)
      )
  
      t2 = Table('sometable_two', metadata,
          Column('some_enum', myenum)
      )
  
  When this pattern is used, care must still be taken at the level
  of individual table creates.  Emitting CREATE TABLE without also
  specifying ``checkfirst=True`` will still cause issues::
  
      t1.create(engine) # will fail: no such type 'myenum'
  
  If we specify ``checkfirst=True``, the individual table-level create
  operation will check for the ``ENUM`` and create if not exists::
  
      # will check if enum exists, and emit CREATE TYPE if not
      t1.create(engine, checkfirst=True)
  
  When using a metadata-level ENUM type, the type will always be created
  and dropped if either the metadata-wide create/drop is called::
  
      metadata.create_all(engine)  # will emit CREATE TYPE
      metadata.drop_all(engine)  # will emit DROP TYPE
  
  The type can also be created and dropped directly::
  
      my_enum.create(engine)
      my_enum.drop(engine)
class_docstr_tok: ["PostgreSQL","ENUM","type",".","This","is","a","subclass","of",":","class",":","`","_types.Enum","`","which","includes","support","for","PG","'s","``","CREATE","TYPE","``","and","``","DROP","TYPE","``",".","When","the","builtin","type",":","class",":","`","_types.Enum","`","is","used","and","the",":","paramref",":","`",".Enum.native_enum","`","flag","is","left","at","its","default","of","True",",","the","PostgreSQL","backend","will","use","a",":","class",":","`","_postgresql.ENUM","`","type","as","the","implementation",",","so","the","special","create\/drop","rules","will","be","used",".","The","create\/drop","behavior","of","ENUM","is","necessarily","intricate",",","due","to","the","awkward","relationship","the","ENUM","type","has","in","relationship","to","the","parent","table",",","in","that","it","may","be","``","owned","''","by","just","a","single","table",",","or","may","be","shared","among","many","tables",".","When","using",":","class",":","`","_types.Enum","`","or",":","class",":","`","_postgresql.ENUM","`","in","an","``","inline","''","fashion",",","the","``","CREATE","TYPE","``","and","``","DROP","TYPE","``","is","emitted","corresponding","to","when","the",":","meth",":","`","_schema.Table.create","`","and",":","meth",":","`","_schema.Table.drop","`","methods","are","called",":",":","table","=","Table","(","'sometable","'",",","metadata",",","Column","(","'some_enum","'",",","ENUM","(","'","a","'",",","'","b","'",",","'","c","'",",","name='myenum","'",")",")",")","table.create","(","engine",")","#","will","emit","CREATE","ENUM","and","CREATE","TABLE","table.drop","(","engine",")","#","will","emit","DROP","TABLE","and","DROP","ENUM","To","use","a","common","enumerated","type","between","multiple","tables",",","the","best","practice","is","to","declare","the",":","class",":","`","_types.Enum","`","or",":","class",":","`","_postgresql.ENUM","`","independently",",","and","associate","it","with","the",":","class",":","`","_schema.MetaData","`","object","itself",":",":","my_enum","=","ENUM","(","'","a","'",",","'","b","'",",","'","c","'",",","name='myenum","'",",","metadata=metadata",")","t1","=","Table","(","'sometable_one","'",",","metadata",",","Column","(","'some_enum","'",",","myenum",")",")","t2","=","Table","(","'sometable_two","'",",","metadata",",","Column","(","'some_enum","'",",","myenum",")",")","When","this","pattern","is","used",",","care","must","still","be","taken","at","the","level","of","individual","table","creates",".","Emitting","CREATE","TABLE","without","also","specifying","``","checkfirst=True","``","will","still","cause","issues",":",":","t1.create","(","engine",")","#","will","fail",":","no","such","type","'myenum'","If","we","specify","``","checkfirst=True","``",",","the","individual","table-level","create","operation","will","check","for","the","``","ENUM","``","and","create","if","not","exists",":",":","#","will","check","if","enum","exists",",","and","emit","CREATE","TYPE","if","not","t1.create","(","engine",",","checkfirst=True",")","When","using","a","metadata-level","ENUM","type",",","the","type","will","always","be","created","and","dropped","if","either","the","metadata-wide","create\/drop","is","called",":",":","metadata.create_all","(","engine",")","#","will","emit","CREATE","TYPE","metadata.drop_all","(","engine",")","#","will","emit","DROP","TYPE","The","type","can","also","be","created","and","dropped","directly",":",":","my_enum.create","(","engine",")","my_enum.drop","(","engine",")"]
docstr: dont return dbapi.STRING for ENUM in PostgreSQL, since that's
  a different type
docstr_tok: ["dont","return","dbapi.STRING","for","ENUM","in","PostgreSQL",",","since","that's","a","different","type"]
code: def get_dbapi_type(self, dbapi):
      """dont return dbapi.STRING for ENUM in PostgreSQL, since that's
      a different type"""
  
      return None
  
imports: from __future__ import annotations
  from typing import Any
  from typing import Optional
  from typing import Type
  from typing import TYPE_CHECKING
  from typing import Union
  from ...None import schema
  from ...None import util
  from ...sql import coercions
  from ...sql import elements
  from ...sql import roles
  from ...sql import sqltypes
  from ...sql import type_api
  from ...sql.base import _NoArg
  from ...sql.ddl import InvokeCreateDDLBase
  from ...sql.ddl import InvokeDropDDLBase
label_desc: Use image node_id 7 for calling the ENUM obj's underlying member method code with example usage: obj.get_dbapi_type(dbapi) and returns: None