HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.104.1.lve.el8.x86_64 #1 SMP Tue Feb 10 20:07:30 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.29
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/__pycache__/sqlite3.cpython-310.pyc
o

�N�g*
�@s�dZzddlZdZWneydZYnwdd�Zddd�Zd	d
�Zdd�Zdd
d�Zddd�Z	ddd�Z
ddd�Zddd�ZdS)z
Support for SQLite3
�NTFcCstsdSdS)N)FzYThe sqlite3 execution module failed to load: the sqlite3 python library is not available.T)�HAS_SQLITE3�rr�H/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/sqlite3.py�__virtual__srcCs&|durdStj|dd�}|��}|S)NF)Zisolation_level)�sqlite3�connectZcursor)�dbZcon�currrr�_connects
r
cC�tjS)zr
    Return version of pysqlite

    CLI Example:

    .. code-block:: bash

        salt '*' sqlite3.version
    )r�versionrrrrr!�
rcCr)zw
    Return version of sqlite

    CLI Example:

    .. code-block:: bash

        salt '*' sqlite3.sqlite_version
    )r�sqlite_versionrrrrr.r
rcCst|�}|sdS|�|�dS)a
    Issue an SQL query to sqlite3 (with no return data), usually used
    to modify the database in some way (insert, delete, create, etc)

    CLI Example:

    .. code-block:: bash

        salt '*' sqlite3.modify /root/test.db 'CREATE TABLE test(id INT, testdata TEXT);'
    FT)r
�execute)r�sqlr	rrr�modify;s

rcCs&t|�}|sdS|�|�|��}|S)z�
    Retrieve data from an sqlite3 db (returns all rows, be careful!)

    CLI Example:

    .. code-block:: bash

        salt '*' sqlite3.fetch /root/test.db 'SELECT * FROM test;'
    F�r
rZfetchall)rrr	�rowsrrr�fetchO�

rcC�&t|�}|sdS|�d�|��}|S)z�
    Show all tables in the database

    CLI Example:

    .. code-block:: bash

        salt '*' sqlite3.tables /root/test.db
    Fz@SELECT name FROM sqlite_master WHERE type='table' ORDER BY name;r�rr	rrrr�tablescrrcCr)z�
    Show all indices in the database

    CLI Example:

    .. code-block:: bash

        salt '*' sqlite3.indices /root/test.db
    Fz@SELECT name FROM sqlite_master WHERE type='index' ORDER BY name;rrrrr�indiceswrrcCst|�S)z�
    Show all indices in the database, for people with poor spelling skills

    CLI Example:

    .. code-block:: bash

        salt '*' sqlite3.indexes /root/test.db
    )r)rrrr�indexes�s
r)N)NN)
�__doc__rr�ImportErrorrr
rrrrrrrrrrr�<module>s �