Mercurial Hosting > traffic-intelligence
comparison python/storage.py @ 831:a8ff35e6fb43
forgotten change
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Wed, 29 Jun 2016 17:56:52 -0400 |
parents | 2a5856961933 |
children | 119c4efe6398 |
comparison
equal
deleted
inserted
replaced
830:2a5856961933 | 831:a8ff35e6fb43 |
---|---|
64 def createIndicatorTable(cursor): | 64 def createIndicatorTable(cursor): |
65 cursor.execute('CREATE TABLE IF NOT EXISTS indicators (interaction_id INTEGER, indicator_type INTEGER, frame_number INTEGER, value REAL, FOREIGN KEY(interaction_id) REFERENCES interactions(id), PRIMARY KEY(interaction_id, indicator_type, frame_number))') | 65 cursor.execute('CREATE TABLE IF NOT EXISTS indicators (interaction_id INTEGER, indicator_type INTEGER, frame_number INTEGER, value REAL, FOREIGN KEY(interaction_id) REFERENCES interactions(id), PRIMARY KEY(interaction_id, indicator_type, frame_number))') |
66 | 66 |
67 def insertTrajectoryQuery(tableName): | 67 def insertTrajectoryQuery(tableName): |
68 return "INSERT INTO "+tableName+" (trajectory_id, frame_number, x_coordinate, y_coordinate) VALUES (?,?,?,?)" | 68 return "INSERT INTO "+tableName+" (trajectory_id, frame_number, x_coordinate, y_coordinate) VALUES (?,?,?,?)" |
69 | 69 |
70 def createIndex(connection, tableName, columnName, unique = False): | 70 def createIndex(connection, tableName, columnName, unique = False): |
71 '''Creates an index for the column in the table | 71 '''Creates an index for the column in the table |
72 I will make querying with a condition on this column faster''' | 72 I will make querying with a condition on this column faster''' |
73 try: | 73 try: |
74 #connection = sqlite3.connect(filename) | 74 #connection = sqlite3.connect(filename) |