Skip to content

Ensuring HNSW Indexes Exist #111

Answered by zh217
techieAgnostic asked this question in Q&A
Discussion options

You must be logged in to vote

We will work out a way. Note that :replace may not be what you want: it removes everything from the old relation if it exists!

Meanwhile you can try ... catch ... in the host language. If you use Python:

try:
    for s in schema:
        db.run(s)
except QueryException as e:
    if e.code == 'eval::stored_relation_conflict':
        logger.warning('Database already initialized.')
    else:
        raise

For indices (every kind of indices), look for e.code == 'tx::index_already_exists' instead.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@andrewbaxter
Comment options

Answer selected by techieAgnostic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants