dicfg.addons.sql.SQLReaderModifier#

class SQLReaderModifier[source]#

Bases: ModifierAddon

__init__()#

Methods

__init__()

get_addon(name)

modify(params)

Expects params as a dictionary with the following keys:

Attributes

NAME

classmethod modify(params)[source]#
Expects params as a dictionary with the following keys:
  • “database”: (str) Path to the SQLite database file.

  • “query”: (str) The SQL query to execute.

  • “params”: (optional, list/tuple) Parameters for the SQL query.

  • “format”: (optional, str) Output format: “raw” (default), “table”, or “json”.

Example

{

“database”: “example.db”, “query”: “SELECT * FROM users WHERE age > ?”, “params”: [30], “format”: “json”

}