Skip to content

Instantly share code, notes, and snippets.

@MaximusMcCann
MaximusMcCann / upsert_query_generator.py
Created July 24, 2019 22:22
Bulk upsert into Postgres query generator.
#!/usr/bin/env python
import os
print("")
print("------------------------")
print(" Note, this query depends on there being a `thumbprint` column and it having a unique index on it.")
print(" The query assumes you'll have a {stage_table} (or tmp table) to initially load data and then the {target_table} to upsert into.")
print(" See below for general flow for bulk upserting to a table")
print("")
Verifying my Blockstack ID is secured with the address 1FGC4xC5z4cgeU3ooSzkRBst1n4PDXbuHx https://explorer.blockstack.org/address/1FGC4xC5z4cgeU3ooSzkRBst1n4PDXbuHx

Keybase proof

I hereby claim:

  • I am maximusmccann on github.
  • I am maximus_mccann (https://keybase.io/maximus_mccann) on keybase.
  • I have a public key ASCoVQVJPTI6X0a3AxSUG8qfwp_zvDQBMid2M-2qZZ4AbQo

To claim this, I am signing this object: