MCPcopy Index your code
hub / github.com/danfengcao/binlog2sql / fix_object

Function fix_object

binlog2sql/binlog2sql_util.py:137–146  ·  view source on GitHub ↗

Fixes python objects so that they can be properly inserted into SQL queries

(value)

Source from the content-addressed store, hash-verified

135
136
137def fix_object(value):
138 """Fixes python objects so that they can be properly inserted into SQL queries"""
139 if isinstance(value, set):
140 value = ','.join(value)
141 if PY3PLUS and isinstance(value, bytes):
142 return value.decode('utf-8')
143 elif not PY3PLUS and isinstance(value, unicode):
144 return value.encode('utf-8')
145 else:
146 return value
147
148
149def is_dml_event(event):

Callers 2

test_fix_objectMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_fix_objectMethod · 0.68