diff --git a/data/yaml/tmp-sql-to-weapons.py b/data/yaml/tmp-sql-to-weapons.py new file mode 100644 index 0000000..b98d5d2 --- /dev/null +++ b/data/yaml/tmp-sql-to-weapons.py @@ -0,0 +1,31 @@ +import sqlite3 +import yaml +import pprint + +def main(): + conn = sqlite3.connect('../../pf2.db') + conn.row_factory = sqlite3.Row + + q = """ + SELECT + price_gp, + dice_size, + bulk, + hands, + range, + reload, + name, + descr, + (SELECT name FROM actions) as action_name -- use this as template for subqueries + FROM weapons; + """ + + c = conn.cursor() + c.execute(q) + data = [dict(row) for row in c.fetchall()] + pprint.pprint(data) + + + +if __name__ == '__main__': + main() \ No newline at end of file