Skip to content

Instantly share code, notes, and snippets.

@colinfwren
Created November 14, 2022 19:48
Show Gist options
  • Save colinfwren/a1a3d01c0466f7bf00af101fc459469e to your computer and use it in GitHub Desktop.
Save colinfwren/a1a3d01c0466f7bf00af101fc459469e to your computer and use it in GitHub Desktop.
Database Setup script
import postgresql
db = postgresql.open('pq://user:pass@localhost:5434/db')
db.execute("create extension if not exists cube;")
db.execute("drop table if exists vectors")
db.execute("create table vectors (id serial, file varchar, image_id numeric, vec_low cube, vec_high cube);")
db.execute("create index vectors_vec_idx on vectors (vec_low, vec_high);")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment