mirror of
https://github.com/lubuntu-team/metrics.git
synced 2025-07-04 14:11:30 +00:00
Allow for the value of the SQLite command to be returned.
This commit is contained in:
parent
2c1227c0ee
commit
0fbe46ecdc
8
metrics
8
metrics
@ -21,7 +21,7 @@ from modules.jenkins import JenkinsModule
|
||||
ENABLED_MODULES = [JenkinsModule]
|
||||
|
||||
|
||||
def sqlite_run(command, db=":memory:"):
|
||||
def sqlite_run(command, db=":memory:", return_output=False):
|
||||
"""Run the given SQLite command on our db
|
||||
|
||||
command must be a command that SQLite can run
|
||||
@ -31,6 +31,12 @@ def sqlite_run(command, db=":memory:"):
|
||||
c = conn.cursor()
|
||||
c.execute(command)
|
||||
conn.commit()
|
||||
|
||||
# Make sure we return an output if requested
|
||||
if return_output:
|
||||
rows = c.fetchall()
|
||||
return rows
|
||||
|
||||
conn.close()
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user