Skip to content

Instantly share code, notes, and snippets.

@joaofig
Created July 2, 2023 17:35
Show Gist options
  • Save joaofig/e2c97c0ef8d3c45d42922a59af7a1d6f to your computer and use it in GitHub Desktop.
Save joaofig/e2c97c0ef8d3c45d42922a59af7a1d6f to your computer and use it in GitHub Desktop.
Inserts the expanded triples list
def insert_triples(traj_id: int,
triples: list[(int,int,int)]):
db = TrajDb()
sql = "insert into triple (traj_id, t0, t1, t2) values (?, ?, ?, ?)"
params = [(traj_id, t0, t1, t2) for t0, t1, t2 in triples]
db.execute_sql(sql, params, many=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment