Show all tables in the database CLI Example: .. code-block:: bash salt '*' sqlite3.tables /root/test.db
(db=None)
| 97 | |
| 98 | |
| 99 | def 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 | |
| 119 | def indices(db=None): |