We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
python 的列表和字符串变量不能直接向这两个类型存入,不然会报错,可以添加一些自动方法么?
The text was updated successfully, but these errors were encountered:
没看懂你问题
Sorry, something went wrong.
比如 PostgreSQL 不支持 python 的 bool 类型,必须转换:
def boolean(var): """python bool to postgres boolean""" if not var or not isinstance(var, bool): return "false" else: return "true"
不支持 python 的 list 文本类型,也必须转换:
def list_text(var): """python list to []text""" if not var or not isinstance(var, list): return None return '{"' + '","'.join(var) + '"}'
python 字符串需要转 character varying
def str2char_var(var): """python string to postgres character varying""" if not var or not isinstance(var, str): return None else: return f"{var}"
目前来看比较麻烦,看后面如何做到兼容
No branches or pull requests
python 的列表和字符串变量不能直接向这两个类型存入,不然会报错,可以添加一些自动方法么?
The text was updated successfully, but these errors were encountered: