
    ^=is
                     z    d dl mZmZmZ d dl mZ d dl mZ g dZ G d de	      Z
 G d de      Z G d	 d
e      Zy)    )SQLAggregateCompilerSQLCompilerSQLDeleteCompiler)SQLInsertCompiler)SQLUpdateCompiler)r   r   r   r   r   c                       e Zd ZdZd Zy)InsertUnnestz
    Sentinel value to signal DatabaseOperations.bulk_insert_sql() that the
    UNNEST strategy should be used for the bulk insert.
    c                 *    ddj                  |       z  S )Nz
UNNEST(%s)z, )join)selfs    y/home/cursorai/projects/telegram-earn/sandbox/venv/lib/python3.12/site-packages/django/db/backends/postgresql/compiler.py__str__zInsertUnnest.__str__   s    diio--    N)__name__
__module____qualname____doc__r    r   r   r	   r	      s    
.r   r	   c                        e Zd Z fdZ xZS )r   c                 @    d|v rt        d      t        | 	  |      S )N$z?Dollar signs are not permitted in column aliases on PostgreSQL.)
ValueErrorsuperquote_name_unless_alias)r   name	__class__s     r   r   z#SQLCompiler.quote_name_unless_alias   s,    $;Q  w.t44r   )r   r   r   r   __classcell__r   s   @r   r   r      s    5 5r   r   c                        e Zd Z fdZ xZS )r   c           	          t        |      dk  sJt        d |D              s8t        d |D              s&t         fd|D              st        d |D              rt           ||      S |D cg c]  }|j	                   j
                         }}t        |D cg c]  }d|z  	 c}      t        t        t        t        |             gfS c c}w c c}w )N   c              3   $   K   | ]  }|d u  
 y wNr   .0fields     r   	<genexpr>z4SQLInsertCompiler.assemble_as_sql.<locals>.<genexpr>/   s     5fU5D=fs   c              3   4   K   | ]  }t        |d         yw)get_placeholderNhasattrr$   s     r   r'   z4SQLInsertCompiler.assemble_as_sql.<locals>.<genexpr>4   s     I&75"34&   c              3      K   | ]B  }|j                   r|j                  n|j                         j                  j                  v D y wr#   )is_relationtarget_fieldget_internal_type
connection
data_types)r%   r&   r   s     r   r'   z4SQLInsertCompiler.assemble_as_sql.<locals>.<genexpr>8   sF       $E (-'8'8##eVVX112#s   AAc              3   @   K   | ]  }t        d  |D                yw)c              3   4   K   | ]  }t        |d         yw)as_sqlNr*   )r%   values     r   r'   z>SQLInsertCompiler.assemble_as_sql.<locals>.<genexpr>.<genexpr>>   s     ASEwuh/Sr,   N)any)r%   rows     r   r'   z4SQLInsertCompiler.assemble_as_sql.<locals>.<genexpr>>   s     XZc3ASAAZs   z(%%s)::%s[])
lenr7   r   assemble_as_sqldb_typer1   r	   listmapzip)r   fields
value_rowsr&   db_typesr;   r   s   `     r   r:   z!SQLInsertCompiler.assemble_as_sql&   s     
Oq  5f55
 I&II   $  XZXX7*6:>>@FGuEMM$//2GHMH]W4HMNT3
+,-Q
 
 	
 HMs   /"CC)r   r   r   r:   r   r   s   @r   r   r   %   s    
 
r   r   N)django.db.models.sql.compilerr   r   BaseSQLCompilerr   r   BaseSQLInsertCompilerr   __all__r<   r	   r   r   r   <module>rF      sD    
 U ;.4 .5/ 5
- 
r   