MCPcopy Index your code
hub / github.com/dbcli/pgcli / escape_for_sql_statement

Function escape_for_sql_statement

pgcli/packages/formatter/sqlformatter.py:16–23  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

14
15
16def escape_for_sql_statement(value):
17 if value is None:
18 return "NULL"
19
20 if isinstance(value, bytes):
21 return f"X'{value.hex()}'"
22
23 return "'{}'".format(value)
24
25
26def adapter(data, headers, table_format=None, **kwargs):

Calls

no outgoing calls