MCPcopy Create free account
hub / github.com/Vanderhoof/PyDBML / prepare_text_for_sql

Function prepare_text_for_sql

pydbml/renderer/sql/default/note.py:7–18  ·  view source on GitHub ↗

- Process special escape sequence: slash before line break, which means no line break https://www.dbml.org/docs/#multi-line-string - replace all single quotes with double quotes

(model: Note)

Source from the content-addressed store, hash-verified

5
6
7def prepare_text_for_sql(model: Note) -> str:
8 '''
9 - Process special escape sequence: slash before line break, which means no line break
10 https://www.dbml.org/docs/#multi-line-string
11 - replace all single quotes with double quotes
12 '''
13
14 pattern = re.compile(r'\\\n')
15 result = pattern.sub('', model.text)
16
17 result = result.replace("'", '"')
18 return result
19
20
21def generate_comment_on(model: Note, entity: str, name: str) -> str:

Callers 4

render_column_notesFunction · 0.90
generate_comment_onFunction · 0.85
render_noteFunction · 0.85

Calls

no outgoing calls

Tested by 1