class documentation

class BindTyping(Enum): (source)

View In Hierarchy

Define different methods of passing typing information for bound parameters in a statement to the database driver. .. versionadded:: 2.0

Constant NONE No steps are taken to pass typing information to the database driver.
Constant RENDER_CASTS Render casts or other directives in the SQL string.
Constant SETINPUTSIZES Use the pep-249 setinputsizes method.

No steps are taken to pass typing information to the database driver. This is the default behavior for databases such as SQLite, MySQL / MariaDB, SQL Server.

Value
1
RENDER_CASTS: int = (source)

Render casts or other directives in the SQL string. This method is used for all PostgreSQL dialects, including asyncpg, pg8000, psycopg, psycopg2. Dialects which implement this can choose which kinds of datatypes are explicitly cast in SQL statements and which aren't. When RENDER_CASTS is used, the compiler will invoke the :meth:`.SQLCompiler.render_bind_cast` method for each :class:`.BindParameter` object whose dialect-level type sets the :attr:`.TypeEngine.render_bind_cast` attribute.

Value
3
SETINPUTSIZES: int = (source)

Use the pep-249 setinputsizes method. This is only implemented for DBAPIs that support this method and for which the SQLAlchemy dialect has the appropriate infrastructure for that dialect set up. Current dialects include cx_Oracle as well as optional support for SQL Server using pyodbc. When using setinputsizes, dialects also have a means of only using the method for certain datatypes using include/exclude lists. When SETINPUTSIZES is used, the :meth:`.Dialect.do_set_input_sizes` method is called for each statement executed which has bound parameters.

Value
2