+
    i  c                   s    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                s    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): )Zfilez: N)executeprintsqlite3ZErrortype__name__Zsqlite_errornamesysZstderrZAttributeErrorexit)Zcsqlsuppress_errorsZrowZeZtps   &&&   )/usr/lib64/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                   s@   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                sZ   < \         SV `  4        Wn        VP                  4       V n        R # )N)Zsuper__init___conZcursor_cur)selfZ
connection	__class__s   &&r   r   Z!SqliteInteractiveConsole.__init__(   s#    	%%'	    c                s   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.
FZ.i   NNversionhelpzEnter SQL code and press enter.Zquit z/Error: unknown command or invalid arguments:  "z".
T)Zisspacestripr   r   sqlite_versionr   r	   ZwriteZcomplete_statementr   r   )r   ZsourcefilenameZsymbolZunknowns   &&&& r   	runsourceZ"SqliteInteractiveConsole.runsource-   s     ))!9*""$W3346  ;<  HHQK    "JJ  %%,IT 3 4  --f55DIIv&r   )r   r   )z<input>Zsingle)
r   Z
__module__Z__qualname__Z__firstlineno____doc__r   r   Z__static_attributes__Z__classdictcell__Z__classcell__)r   Z__classdict__s   @@r   r   r   %   s     (
 r   r   c            	      s   \        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)ZdescriptionZcolorr   z:memory:Z?zrSQLite database to open (defaults to ':memory:'). A new database is created if the file does not previously exist.)r   Zdefaultnargsr   r
   zAAn SQL query to execute. Any returned rows are printed to stdout.)r   r   r   z-vz	--versionr   zSQLite version z'Print underlying SQLite library version)Zactionr   r   za transient in-memory databaseZ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)Zisolation_levelF)r   r   )Zexitmsg)r    Zadd_argumentZstrr   r   Z
parse_argsr   Zreprr   ZplatformZmodulesr   r   Zps1Zps2Zconnectr
   r   r   readlineZImportErrorZinteractZcloser	   )ZargsZparserZdb_nameZeofkeyZbannerZconZconsoler   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Z__main__r   )T)r   r   r   Zargparser    Zcoder   Ztextwrapr   r   r   r   r   Zargv) r   r   <module>r       sS     
 # # ,!1 !H>B z" r   