22.16.196. salt.modules.sqlite3

Support for SQLite3

salt.modules.sqlite3.fetch(db=None, sql=None)

Retrieve data from an sqlite3 db (returns all rows, be careful!)

CLI Example:

salt '*' sqlite3.fetch /root/test.db 'SELECT * FROM test;'
salt.modules.sqlite3.indexes(db=None)

Show all indices in the database, for people with poor spelling skills

CLI Example:

salt '*' sqlite3.indexes /root/test.db
salt.modules.sqlite3.indices(db=None)

Show all indices in the database

CLI Example:

salt '*' sqlite3.indices /root/test.db
salt.modules.sqlite3.modify(db=None, sql=None)

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:

salt '*' sqlite3.modify /root/test.db 'CREATE TABLE test(id INT, testdata TEXT);'
salt.modules.sqlite3.sqlite_version()

Return version of sqlite

CLI Example:

salt '*' sqlite3.sqlite_version
salt.modules.sqlite3.tables(db=None)

Show all tables in the database

CLI Example:

salt '*' sqlite3.tables /root/test.db
salt.modules.sqlite3.version()

Return version of pysqlite

CLI Example:

salt '*' sqlite3.version

Docs for previous releases are available on salt.rtfd.org.

Latest Salt release: 2014.1.13

Try the shiny new release candidate of Salt, v2014.7.0rc6! More info here.

Previous topic

22.16.195. salt.modules.solr

Next topic

22.16.197. salt.modules.ssh

SaltStack News

Upcoming SaltStack events, webinars and local meet ups and user groups.