Created
December 6, 2019 21:47
-
-
Save AwokeKnowing/d3b975e3f844f9f1709a2ba3ffa1f663 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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