Skip to content

Instantly share code, notes, and snippets.

@AwokeKnowing
Created December 6, 2019 21:47
Show Gist options
  • Save AwokeKnowing/45af3054414e9c6c39b37dc90fc5382c to your computer and use it in GitHub Desktop.
Save AwokeKnowing/45af3054414e9c6c39b37dc90fc5382c to your computer and use it in GitHub Desktop.
import sys
import re
import uuid
def literal_uuid(m):
return str(uuid.uuid4())
unfixed=""
with open(sys.argv[1],'r') as sqlfile:
unfixed = sqlfile.read()
fixed = re.sub("UUID\(\)", literal_uuid, unfixed)
with open(sys.argv[1]+'.uuid.sql','w') as sqlfixed:
sqlfixed.write(fixed)
print(fixed)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment