Skip to content

Instantly share code, notes, and snippets.

View ekiauhce's full-sized avatar
🙂
Hi there!

Daniil Belyak ekiauhce

🙂
Hi there!
View GitHub Profile
@ekiauhce
ekiauhce / sqlparse_delimiters.py
Created March 7, 2023 19:51 — forked from srittau/sqlparse_delimiters.py
sqlparse with delimiter support
# Split SQL file using sqlparse with delimiter handling.
#
# The SQL string is pre-processed before handing it off to sqlparse.split:
# DELIMITER statements are removed, semicolons within non-standard
# delimiter blocks are replaced by the Unicode Object Replacement
# Character, and custom delimiters replaced with semicolons. After
# processing the string with sqlparse.split, the Object Replacement Characters
# are replaced with semicolons again.
import re