MCPcopy Create free account
hub / github.com/Boris-code/feapder / format_sql_value

Function format_sql_value

feapder/utils/tools.py:2083–2096  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

2081
2082############### 数据库相关 #######################
2083def format_sql_value(value):
2084 if isinstance(value, str):
2085 value = value.strip()
2086
2087 elif isinstance(value, (list, dict)):
2088 value = dumps_json(value, indent=None)
2089
2090 elif isinstance(value, (datetime.date, datetime.time)):
2091 value = str(value)
2092
2093 elif isinstance(value, bool):
2094 value = int(value)
2095
2096 return value
2097
2098
2099def list2str(datas):

Callers 3

make_insert_sqlFunction · 0.85
make_update_sqlFunction · 0.85
make_batch_sqlFunction · 0.85

Calls 1

dumps_jsonFunction · 0.85

Tested by

no test coverage detected