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);'
(db=None, sql=None)
| 57 | |
| 58 | |
| 59 | def modify(db=None, sql=None): |
| 60 | """ |
| 61 | Issue an SQL query to sqlite3 (with no return data), usually used |
| 62 | to modify the database in some way (insert, delete, create, etc) |
| 63 | |
| 64 | CLI Example: |
| 65 | |
| 66 | .. code-block:: bash |
| 67 | |
| 68 | salt '*' sqlite3.modify /root/test.db 'CREATE TABLE test(id INT, testdata TEXT);' |
| 69 | """ |
| 70 | cur = _connect(db) |
| 71 | |
| 72 | if not cur: |
| 73 | return False |
| 74 | |
| 75 | cur.execute(sql) |
| 76 | return True |
| 77 | |
| 78 | |
| 79 | def fetch(db=None, sql=None): |