0

我们是否必须在 asyncpg 中注册适配器才能执行查询,就像在 psycopg 中一样?

http://initd.org/psycopg/docs/extensions.html#psycopg2.extensions.register_adapter

4

1 回答 1

1

发现这里使用了 set_type_codec。它们更容易,不需要类型自省。

这里有一些很好的参考:https ://magicstack.github.io/asyncpg/current/api/index.html#asyncpg.connection.Connection.set_type_codec

https://github.com/MagicStack/asyncpg/blob/master/docs/usage.rst#custom-type-conversions

https://github.com/MagicStack/asyncpg/issues/242

于 2018-01-18T00:31:04.263 回答