MCPcopy Index your code
hub / github.com/saltstack/salt / modify

Function modify

salt/modules/sqlite3.py:59–76  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

57
58
59def 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
79def fetch(db=None, sql=None):

Callers

nothing calls this directly

Calls 2

_connectFunction · 0.70
executeMethod · 0.45

Tested by

no test coverage detected