/opt/cloudlinux/venv/lib/python3.11/site-packages/psycopg2/__pycache__
NameSizeModeActions
errorcodes.cpython-311.pyc145250644editdlrm
errors.cpython-311.pyc5980644editdlrm
extensions.cpython-311.pyc92320644editdlrm
extras.cpython-311.pyc682930644editdlrm
pool.cpython-311.pyc83150644editdlrm
sql.cpython-311.pyc205520644editdlrm
tz.cpython-311.pyc64570644editdlrm
_ipaddress.cpython-311.pyc29360644editdlrm
_json.cpython-311.pyc80020644editdlrm
_range.cpython-311.pyc227040644editdlrm
__init__.cpython-311.pyc41170644editdlrm
Edit: /opt/cloudlinux/venv/lib/python3.11/site-packages/psycopg2/__pycache__/sql.cpython-311.pyc (20552B)
§ ºËª"~Øãó—dZddlZddlmZej¦«ZGd„d¦«ZGd„de¦«ZGd„d e¦«Z Gd „d e¦«Z Gd „d e¦«Z Gd„de¦«Z e d¦«Z e d¦«ZdS)zSQL composition utility module éN)Ú extensionscó<—eZdZdZd„Zd„Zd„Zd„Zd„Zd„Z d„Z d S) Ú 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ó—||_dS©N©Ú_wrapped)ÚselfÚwrappeds ú`/builddir/build/BUILD/cloudlinux-venv-1.0.12/venv/lib64/python3.11/site-packages/psycopg2/sql.pyÚ__init__zComposable.__init__1s €ØˆŒ ˆ ˆ ócó0—|jj›d|j›d�S)Nú(ú))Ú __class__Ú__name__r ©r s r Ú__repr__zComposable.__repr__4s €Ø”.Ô)Ð>Ð>¨D¬MÐ>Ð>Ð>Ð>rcó—t‚)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. )ÚNotImplementedError©r Úcontexts r Ú as_stringzComposable.as_string7s €õ"Ð!rcóÌ—t|t¦«rt|g¦«|zSt|t¦«r!t|g¦«t|g¦«zStSr)Ú isinstanceÚComposedrÚNotImplemented©r Úothers r Ú__add__zComposable.__add__Ds`€Ý �e�XÑ &Ô &ð ,ݘT˜FÑ#Ô# eÑ+Ð +Ý �e�ZÑ (Ô (ð "ݘT˜FÑ#Ô#¥h°¨wÑ&7Ô&7Ñ7Ð 7å!Ð !rcó(—t|g|z¦«Sr)r)r Úns r Ú__mul__zComposable.__mul__Ls€Ý˜˜ ™ Ñ#Ô#Ð#rcó^—t|¦«t|¦«uo|j|jkSr)Útyper rs r Ú__eq__zComposable.__eq__Os'€Ý�D‰zŒz�T %™[œ[Ð(ÐL¨T¬]¸e¼nÒ-LÐLrcó.—| |¦« Sr)r'rs r Ú__ne__zComposable.__ne__Rs€Ø—;’;˜uÑ%Ô%Ð%Ð%rN) rÚ __module__Ú __qualname__Ú__doc__r rrr!r$r'r)©rr rr#sŠ€€€€€ð ð ð ð ð ð?ð?ð?ð "ð "ð "ð"ð"ð"ð$ð$ð$ðMðMðMð&ð&ð&ð&ð&rrcóP‡—eZdZdZˆfd„Zed„¦«Zd„Zd„Zd„Z d„Z ˆxZ S)ra A `Composable` object made of a sequence of `!Composable`. The object is usually created using `!Composable` operators and methods. However it is possible to create a `!Composed` directly specifying a sequence of `!Composable` as arguments. Example:: >>> comp = sql.Composed( ... [sql.SQL("insert into "), sql.Identifier("table")]) >>> print(comp.as_string(conn)) insert into "table" `!Composed` objects are iterable (so they can be used in `SQL.join` for instance). cóÒ•—g}|D]?}t|t¦«std|›d�¦«‚| |¦«Œ@t ¦« |¦«dS)Nz*Composed elements must be Composable, got z instead)rrÚ TypeErrorÚappendÚsuperr )r Úseqr Úirs €r r zComposed.__init__hs€ø€ØˆØð ð ˆAݘa¥Ñ,Ô,ð PÝØNÀÐNÐNÐNñPôPðPà �NŠN˜1Ñ Ô Ð Ð å ‰Œ×Ò˜Ñ!Ô!Ð!Ð!Ð!rcó*—t|j¦«S)z+The list of the content of the `!Composed`.)Úlistr rs r r3z Composed.seqrs€õ�D”MÑ"Ô"Ð"rcó”—g}|jD]*}| | |¦«¦«Œ+d |¦«S)NÚ)r r1rÚjoin)r rÚrvr4s r rzComposed.as_stringwsI€Ø ˆØ”ð ,ð ,ˆAØ �IŠI�a—k’k 'Ñ*Ô*Ñ +Ô +Ð +Ð +Ø�wŠw�r‰{Œ{Ðrcó*—t|j¦«Sr)Úiterr rs r Ú__iter__zComposed.__iter__}s€Ý�D”MÑ"Ô"Ð"rcóÌ—t|t¦«rt|j|jz¦«St|t¦«rt|j|gz¦«StSr)rrr rrrs r r!zComposed.__add__€sZ€Ý �e�XÑ &Ô &ð <ݘDœM¨E¬NÑ:Ñ;Ô;Ð ;Ý �e�ZÑ (Ô (ð "ݘDœM¨U¨GÑ3Ñ4Ô4Ð 4å!Ð !rcó¾—t|t¦«rt|¦«}n$t|t¦«std¦«‚| |¦«S)a| Return a new `!Composed` interposing the *joiner* with the `!Composed` items. The *joiner* must be a `SQL` or a string which will be interpreted as an `SQL`. Example:: >>> fields = sql.Identifier('foo') + sql.Identifier('bar') # a Composed >>> print(fields.join(', ').as_string(conn)) "foo", "bar" z3Composed.join() argument must be a string or an SQL)rÚstrÚSQLr0r9)r Újoiners r r9z Composed.joinˆsc€õ �f�cÑ "Ô "ð Gݘ‘[”[ˆFˆFݘF¥CÑ(Ô(ð GÝØEñGôGð Gð�{Š{˜4Ñ Ô Ð r) rr*r+r,r Úpropertyr3rr=r!r9Ú __classcell__©rs@r rrVs™ø€€€€€ððð""ð"ð"ð"ð"ðð#ð#ñ„Xð#ðððð #ð#ð#ð"ð"ð"ð!ð!ð!ð!ð!ð!ð!rrcóJ‡—eZdZdZˆfd„Zed„¦«Zd„Zd„Zd„Z ˆxZ S)rAaA A `Composable` representing a snippet of SQL statement. `!SQL` exposes `join()` and `format()` methods useful to create a template where to merge variable parts of a query (for instance field or table names). The *string* doesn't undergo any form of escaping, so it is not suitable to represent variable identifiers or values: you should only use it to pass constant strings representing templates or snippets of SQL statements; use other objects such as `Identifier` or `Literal` to represent variable parts. Example:: >>> query = sql.SQL("select {0} from {1}").format( ... sql.SQL(', ').join([sql.Identifier('foo'), sql.Identifier('bar')]), ... sql.Identifier('table')) >>> print(query.as_string(conn)) select "foo", "bar" from "table" có’•—t|t¦«std¦«‚t¦« |¦«dS)NzSQL values must be strings)rr@r0r2r )r Ústringrs €r r z SQL.__init__µsBø€Ý˜&¥#Ñ&Ô&ð :ÝÐ8Ñ9Ô9Ð 9Ý ‰Œ×Ò˜Ñ Ô Ð Ð Ð rcó—|jS)z(The string wrapped by the `!SQL` object.rrs r rHz SQL.stringºó €ðŒ}Ðrcó—|jSrrrs r rz SQL.as_string¿s €ØŒ}ÐrcóF—g}d}t |j¦«D]ï\}}}}|rtd¦«‚|rtd¦«‚|r"| t |¦«¦«|€ŒP| ¦«r<|rtd¦«‚| |t|¦«¦«d}Œ |s2|€td¦«‚| ||¦«|dz }ŒÔ| ||¦«Œðt|¦«S)a^ Merge `Composable` objects into a template. :param `Composable` args: parameters to replace to numbered (``{0}``, ``{1}``) or auto-numbered (``{}``) placeholders :param `Composable` kwargs: parameters to replace to named (``{name}``) placeholders :return: the union of the `!SQL` string with placeholders replaced :rtype: `Composed` The method is similar to the Python `str.format()` method: the string template supports auto-numbered (``{}``), numbered (``{0}``, ``{1}``...), and named placeholders (``{name}``), with positional arguments replacing the numbered placeholders and keywords replacing the named ones. However placeholder modifiers (``{0!r}``, ``{0:<10}``) are not supported. Only `!Composable` objects can be passed to the template. Example:: >>> print(sql.SQL("select * from {} where {} = %s") ... .format(sql.Identifier('people'), sql.Identifier('id')) ... .as_string(conn)) select * from "people" where "id" = %s >>> print(sql.SQL("select * from {tbl} where {pkey} = %s") ... .format(tbl=sql.Identifier('people'), pkey=sql.Identifier('id')) ... .as_string(conn)) select * from "people" where "id" = %s rz(no format specification supported by SQLz%no format conversion supported by SQLNz6cannot switch from automatic field numbering to manualz6cannot switch from manual field numbering to automaticé) Ú _formatterÚparser Ú ValueErrorr1rAÚisdigitÚintr) r ÚargsÚkwargsr:ÚautonumÚpreÚnameÚspecÚconvs r Úformatz SQL.formatÂsP€ð@ˆØˆÝ%/×%5Ò%5°d´mÑ%DÔ%Dð (ð (Ñ !ˆC��t˜TØð MÝ Ð!KÑLÔLÐLØð JÝ Ð!HÑIÔIÐIØð $Ø— ’ �#˜c™(œ(Ñ#Ô#Ð#àˆ|Øà�|Š|‰~Œ~ð (ØðRÝ$ØPñRôRðRà— ’ ˜$�s 4™yœyœ/Ñ*Ô*Ð*Ø��àð (Ø�?Ý$ØPñRôRðRà— ’ ˜$˜wœ-Ñ(Ô(Ð(ؘ1‘ ��ð— ’ ˜& œ,Ñ'Ô'Ð'Ð'嘉|Œ|Ðrcó—g}t|¦«} | t|¦«¦«|D],}| |¦«| |¦«Œ-n#t$rYnwxYwt |¦«S)a Join a sequence of `Composable`. :param seq: the elements to join. :type seq: iterable of `!Composable` Use the `!SQL` object's *string* to separate the elements in *seq*. Note that `Composed` objects are iterable too, so they can be used as argument for this method. Example:: >>> snip = sql.SQL(', ').join( ... sql.Identifier(n) for n in ['foo', 'bar', 'baz']) >>> print(snip.as_string(conn)) "foo", "bar", "baz" )r<r1ÚnextÚ StopIterationr)r r3r:Úitr4s r r9zSQL.joins—€ð$ˆÝ �#‰YŒYˆð Ø �IŠI•d˜2‘h”hÑ Ô Ð ðð ð �Ø— ’ ˜$‘”�Ø— ’ ˜!‘ ” � � ð øõð ð ð Ø ˆDð øøøõ˜‰|Œ|Ðs“"A%Á% A2Á1A2) rr*r+r,r rCrHrrZr9rDrEs@r rArAŸs‹ø€€€€€ððð*!ð!ð!ð!ð!ð ððñ„Xððððð>ð>ð>ð@ððððððrrAcóZ‡—eZdZdZˆfd„Zed„¦«Zed„¦«Zd„Zd„Z ˆxZ S)Ú Identifiera* A `Composable` representing an SQL identifier or a dot-separated sequence. Identifiers usually represent names of database objects, such as tables or fields. PostgreSQL identifiers follow `different rules`__ than SQL string literals for escaping (e.g. they use double quotes instead of single). .. __: https://www.postgresql.org/docs/current/static/sql-syntax-lexical.html# SQL-SYNTAX-IDENTIFIERS Example:: >>> t1 = sql.Identifier("foo") >>> t2 = sql.Identifier("ba'r") >>> t3 = sql.Identifier('ba"z') >>> print(sql.SQL(', ').join([t1, t2, t3]).as_string(conn)) "foo", "ba'r", "ba""z" Multiple strings can be passed to the object to represent a qualified name, i.e. a dot-separated sequence of identifiers. Example:: >>> query = sql.SQL("select {} from {}").format( ... sql.Identifier("table", "field"), ... sql.Identifier("schema", "table")) >>> print(query.as_string(conn)) select "table"."field" from "schema"."table" c󾕗|std¦«‚|D]&}t|t¦«std¦«‚Œ't¦« |¦«dS)NzIdentifier cannot be emptyz$SQL identifier parts must be strings)r0rr@r2r )r ÚstringsÚsrs €r r zIdentifier.__init__Assø€Øð :ÝÐ8Ñ9Ô9Ð 9àð Hð HˆAݘa¥Ñ%Ô%ð HÝÐ FÑGÔGÐGð Hõ ‰Œ×Ò˜Ñ!Ô!Ð!Ð!Ð!rcó—|jS)z5A tuple with the strings wrapped by the `Identifier`.rrs r rbzIdentifier.stringsKrJrcój—t|j¦«dkr |jdStd¦«‚)z0The string wrapped by the `Identifier`. rMrz2the Identifier wraps more than one than one string)Úlenr ÚAttributeErrorrs r rHzIdentifier.stringPs>€õ ˆtŒ}Ñ Ô  Ò "Ð "Ø”= Ô#Ð #å ØDñFôFð Frcó|—|jj›dd tt|j¦«¦«›d�S)Nrz, r)rrr9ÚmapÚreprr rs r rzIdentifier.__repr__Zs6€Ø”.Ô)ÐRÐR¨D¯IªIµc½$ÀÄ Ñ6NÔ6NÑ,OÔ,OÐRÐRÐRÐRrcóP‡—d ˆfd„|jD¦«¦«S)Nú.c3óB•K—|]}tj|‰¦«V—ŒdSr)ÚextÚ quote_ident)Ú.0rcrs €r ú z'Identifier.as_string..^s/øèè€ÐKÐK¸�œ¨¨7Ñ3Ô3ÐKÐKÐKÐKÐKÐKr)r9r rs `r rzIdentifier.as_string]s,ø€Ø�xŠxÐKÐKÐKÐK¸T¼]ÐKÑKÔKÑKÔKÐKr) rr*r+r,r rCrbrHrrrDrEs@r r`r`"s£ø€€€€€ððð<"ð"ð"ð"ð"ðððñ„XðððFðFñ„XðFðSðSðSðLðLðLðLðLðLðLrr`có.—eZdZdZed„¦«Zd„ZdS)ÚLiteralaˆ A `Composable` representing an SQL value to include in a query. Usually you will want to include placeholders in the query and pass values as `~cursor.execute()` arguments. If however you really really need to include a literal value in the query you can use this object. The string returned by `!as_string()` follows the normal :ref:`adaptation rules ` for Python objects. Example:: >>> s1 = sql.Literal("foo") >>> s2 = sql.Literal("ba'r") >>> s3 = sql.Literal(42) >>> print(sql.SQL(', ').join([s1, s2, s3]).as_string(conn)) 'foo', 'ba''r', 42 có—|jS)z%The object wrapped by the `!Literal`.rrs r r zLiteral.wrappedurJrcóÄ—t|tj¦«r|}n1t|tj¦«r|j}nt d¦«‚tj|j¦«}t|d¦«r| |¦«|  ¦«}t|t¦«r*|  tj |j ¦«}|S)Nz(context must be a connection or a cursorÚprepare)rrnÚ connectionÚcursorr0Úadaptr ÚhasattrrvÚ getquotedÚbytesÚdecodeÚ encodingsÚencoding)r rÚconnÚar:s r rzLiteral.as_stringzs¼€å �g�sœ~Ñ .Ô .ð H؈DˆDÝ ˜¥¤Ñ ,Ô ,ð HØÔ%ˆDˆDåÐFÑGÔGÐ Gå ŒI�d”mÑ $Ô $ˆÝ �1�iÑ Ô ð Ø �IŠI�d‰OŒOˆOà �[Š[‰]Œ]ˆÝ �b�%Ñ Ô ð 9Ø—’�3œ=¨¬Ô7Ñ8Ô8ˆBàˆ rN)rr*r+r,rCr rr-rr rsrsasH€€€€€ððð&ððñ„XððððððrrscóF‡—eZdZdZdˆfd„ Zed„¦«Zd„Zd„ZˆxZ S)Ú PlaceholderaãA `Composable` representing a placeholder for query parameters. If the name is specified, generate a named placeholder (e.g. ``%(name)s``), otherwise generate a positional placeholder (e.g. ``%s``). The object is useful to generate SQL queries with a variable number of arguments. Examples:: >>> names = ['foo', 'bar', 'baz'] >>> q1 = sql.SQL("insert into table ({}) values ({})").format( ... sql.SQL(', ').join(map(sql.Identifier, names)), ... sql.SQL(', ').join(sql.Placeholder() * len(names))) >>> print(q1.as_string(conn)) insert into table ("foo", "bar", "baz") values (%s, %s, %s) >>> q2 = sql.SQL("insert into table ({}) values ({})").format( ... sql.SQL(', ').join(map(sql.Identifier, names)), ... sql.SQL(', ').join(map(sql.Placeholder, names))) >>> print(q2.as_string(conn)) insert into table ("foo", "bar", "baz") values (%(foo)s, %(bar)s, %(baz)s) NcóÊ•—t|t¦«rd|vrtd|›�¦«‚n|�td|›�¦«‚t ¦« |¦«dS)Nrzinvalid name: z%expected string or None as name, got )rr@rPr0r2r )r rWrs €r r zPlaceholder.__init__©sxø€Ý �d�CÑ Ô ð NØ�dˆ{ˆ{Ý Ð!:°$Ð!:Ð!:Ñ;Ô;Ð;ððÐ ÝÐLÀDÐLÐLÑMÔMÐ Må ‰Œ×Ò˜ÑÔÐÐÐrcó—|jS)zThe name of the `!Placeholder`.rrs r rWzPlaceholder.name³rJrcó\—|j€|jj›d�S|jj›d|j›d�S)Nz()rr)r rrrs r rzPlaceholder.__repr__¸s<€Ø Œ=Ð Ø”nÔ-Ð1Ð1Ð1Ð 1à”nÔ-ÐBÐB°´ ÐBÐBÐBÐ Brcó*—|j� d|j›d�SdS)Nz%(z)sz%srrs r rzPlaceholder.as_string¾s"€Ø Œ=Ð $Ø)˜œ Ð)Ð)Ð)Ð )à�4rr) rr*r+r,r rCrWrrrDrEs@r rƒrƒŽsƒø€€€€€ððð4ððððððððñ„XððCðCðCð ððððððrrƒÚNULLÚDEFAULT)r,rHÚpsycopg2rrnÚ FormatterrNrrrAr`rsrƒrˆr‰r-rr úrŒsvðððð4€ € € à&Ð&Ð&Ð&Ð&Ð&ðˆVÔ Ñ Ô € ð0&ð0&ð0&ð0&ð0&ñ0&ô0&ð0&ðfF!ðF!ðF!ðF!ðF!ˆzñF!ôF!ðF!ðR@ð@ð@ð@ð@ˆ*ñ@ô@ð@ðF<Lð<Lð<Lð<Lð<L�ñ<Lô<Lð<Lð~*ð*ð*ð*ð*ˆjñ*ô*ð*ðZ4ð4ð4ð4ð4�*ñ4ô4ð4ðp €sˆ6�{„{€Ø ˆ#ˆi‰.Œ.€€€r