+
     Bi                         R t ^ RIt^ RIt^ RIHt ^ RIHt ^ RIHt RR lt	 ! R R]4      t
R t]R	8X  d   ]! ]P                  R
,          4       R# R# )zA simple SQLite CLI for the sqlite3 module.

Apart from using 'argparse' for the command-line interface,
this module implements the REPL as a thin wrapper around
the InteractiveConsole class from the 'code' stdlib module.
N)ArgumentParser)InteractiveConsole)dedentc                    V P                  V4       F  p\        V4       K  	  R#   \        P                   d   p\	        T4      P
                  p \        T RTP                   RT 2\        P                  R7       M1  \         d$    \        T RT 2\        P                  R7        Mi ; iT'       g   \        P                  ! ^4        Rp?R#  Rp?R# Rp?ii ; i)zHelper that wraps execution of SQL code.

This is used both by the REPL and by direct execution from the CLI.

'c' may be a cursor or a connection.
'sql' is the SQL string to execute.
z (z): )filez: N)executeprintsqlite3Errortype__name__sqlite_errornamesysstderrAttributeErrorexit)csqlsuppress_errorsrowetps   &&&   '/usr/lib/python3.14/sqlite3/__main__.pyr   r      s    
99S>C#J "== !W	1RD1--.c!5CJJG 	1RD1#,SZZ0	1HHQKK s>   #' C C-B ?C +B.+C-B..
C9CC c                   @   a a ] tR t^%t oRtV 3R ltRR ltRtVtV ;t	# )SqliteInteractiveConsolezA simple SQLite REPL.c                Z   < \         SV `  4        Wn        VP                  4       V n        R # )N)super__init___concursor_cur)self
connection	__class__s   &&r   r   !SqliteInteractiveConsole.__init__(   s#    	%%'	    c                   V'       d   VP                  4       '       d   R# V^ ,          R8X  d   VR,          P                  4       ;R8X  d    \        \        P                   4       R# ;R8X  d    \        R4       R# ;R8X  d    \
        P                  ! ^ 4       R# ;R8X  d     R# pV P                  R	V R
24       R# \        P                  ! V4      '       g   R# \        V P                  V4       R# )zOverride runsource, the core of the InteractiveConsole REPL.

Return True if more input is needed; buffering is done automatically.
Return False if input is a complete statement ready for execution.
F.   NNversionhelpzEnter SQL code and press enter.quit z/Error: unknown command or invalid arguments:  "z".
T)isspacestripr   r	   sqlite_versionr   r   writecomplete_statementr   r    )r!   sourcefilenamesymbolunknowns   &&&& r   	runsource"SqliteInteractiveConsole.runsource-   s     ))!9*""$W3346  ;<  HHQK    "JJ  %%,IT 3 4  --f55DIIv&r%   )r   r    )z<input>single)
r   
__module____qualname____firstlineno____doc__r   r7   __static_attributes____classdictcell____classcell__)r#   __classdict__s   @@r   r   r   %   s     (
 r%   r   c            	         \        R RR7      pVP                  R\        RRRR7       VP                  R\        RR	R
7       VP                  RRRR\        P                   2RR7       VP
                  ! V !  p V P                  R8X  d   RpM\        V P                  4      p\        P                  R8X  d   R\        P                  9  d   RpMRp\        R\        P                   RV RV R24      P                  4       pR\        n        R\        n        \        P                  ! V P                  RR7      p V P                   '       d   \#        WPP                   RR7       M#\%        V4      p ^ RIpVP+                  VR R!7       VP-                  4        \        P.                  ! ^ 4       R#   \(         d     LHi ; i  TP-                  4        i ; i)"zPython sqlite3 CLIT)descriptioncolorr4   z:memory:?zrSQLite database to open (defaults to ':memory:'). A new database is created if the file does not previously exist.)r   defaultnargsr+   r   zAAn SQL query to execute. Any returned rows are printed to stdout.)r   rG   r+   z-vz	--versionr*   zSQLite version z'Print underlying SQLite library version)actionr*   r+   za transient in-memory databasewin32zidlelib.runzCTRL-ZzCTRL-Dz2
        sqlite3 shell, running on SQLite version z
        Connected to z}

        Each command will be run using execute() on the cursor.
        Type ".help" for more information; type ".quit" or z to quit.
    zsqlite> z    ... N)isolation_levelF)r   r-   )exitmsg)r   add_argumentstrr	   r0   
parse_argsr4   reprr   platformmodulesr   r/   ps1ps2connectr   r   r   readlineImportErrorinteractcloser   )argsparserdb_nameeofkeybannerconconsolerU   s   *       r   mainr`   I   s   (F jO   Cs7   k)!'"8"8!9:6  
 d#D}}
"2t}}% ||w=#C 2292H2H1I JY < =C8 D 	 
  CGCG
//$--
>C888C59 /s3G VR0		HHQK   			s0   :5G  0F/ 4G  /F=:G  <F==G   G__main__r(   )T)r=   r	   r   argparser   coder   textwrapr   r   r   r`   r   argv r%   r   <module>rg      sS     
 # # ,!1 !H>B z" r%   