Created
October 18, 2017 19:46
-
-
Save tfaris/734f6169485828aaa1ec1cf49515964b to your computer and use it in GitHub Desktop.
[ArmedXpert] One method for running an arbitrary SQL SELECT query using the ArmedXpert plugin editor.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
editor.ClearLog() | |
import clr | |
clr.AddReference('System.Data.SQLite') | |
from nichevision.forensics.armedxpert.dnada.datalayer import Database | |
from System.Data.SQLite import SQLiteCommand | |
cmd = SQLiteCommand("select * from AlleleCombination", Database.SharedDatasource.Connection) | |
reader = cmd.ExecuteReader() | |
try: | |
while reader.Read(): | |
v = list(reader.GetValues()) | |
output = ','.join(['%s = %s%s' % ( | |
name, | |
str(reader[name])[:50], | |
'...' if len(str(reader[name])) > 50 else '') | |
for name in v]) | |
print output | |
finally: | |
reader.Close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment