MCPcopy Create free account
hub / github.com/saltstack/salt / tables

Function tables

salt/modules/sqlite3.py:99–116  ·  view source on GitHub ↗

Show all tables in the database CLI Example: .. code-block:: bash salt '*' sqlite3.tables /root/test.db

(db=None)

Source from the content-addressed store, hash-verified

97
98
99def tables(db=None):
100 """
101 Show all tables in the database
102
103 CLI Example:
104
105 .. code-block:: bash
106
107 salt '*' sqlite3.tables /root/test.db
108 """
109 cur = _connect(db)
110
111 if not cur:
112 return False
113
114 cur.execute("SELECT name FROM sqlite_master WHERE type='table' ORDER BY name;")
115 rows = cur.fetchall()
116 return rows
117
118
119def indices(db=None):

Callers

nothing calls this directly

Calls 3

fetchallMethod · 0.80
_connectFunction · 0.70
executeMethod · 0.45

Tested by

no test coverage detected