B
*]: @ s d Z ddlZddlmZ ddlmZmZ e Z G dd de
ZG dd deZG d d
d
eZ
G dd deZG d
d deZG dd deZe
dZe
dZdS )zSQL composition utility module
N)
extensions)PY3string_typesc @ sH e Zd ZdZdd Zdd Zdd Zdd Zd
d Zdd
Z dd Z
dS )
Composablea6
Abstract base class for objects that can be used to compose an SQL string.
`!Composable` objects can be passed directly to `~cursor.execute()`,
`~cursor.executemany()`, `~cursor.copy_expert()` in place of the query
string.
`!Composable` objects can be joined using the ``+`` operator: the result
will be a `Composed` instance containing the objects joined. The operator
``*`` is also supported with an integer argument: the result is a
`!Composed` instance containing the left argument repeated as many times as
requested.
c C s
|| _ d S )N)_wrapped)selfwrapped r ?/opt/alt/python37/lib64/python3.7/site-packages/psycopg2/sql.py__init__1 s zComposable.__init__c C s d| j j| jf S )Nz%s(%r)) __class____name__r )r r r r
__repr__4 s zComposable.__repr__c C s t dS )aj
Return the string value of the object.
:param context: the context to evaluate the string into.
:type context: `connection` or `cursor`
The method is automatically invoked by `~cursor.execute()`,
`~cursor.executemany()`, `~cursor.copy_expert()` if a `!Composable` is
passed instead of the query string.
N)NotImplementedError)r contextr r r
as_string7 s zComposable.as_stringc C s>