- 欢迎来到 GINO 的文档
- 上手教程
- 进阶用法
- 原理说明
- 参考手册
- API 参考
- gino.bakery module
- gino.api module
- gino.declarative module
- gino.schema module
- gino.crud module
- gino.json_support module
- gino.engine module
- gino.loader module
- gino.dialects.asyncpg module
- gino.dialects.base module
- gino.transaction module
- gino.dialects package
- gino.dialects.aiomysql module
- gino.ext package
- gino.aiocontextvars module
- gino.exceptions module
- gino.strategies module
- 扩展
- 版本历史
- API 参考
gino.dialects.asyncpg module
- class
gino.dialects.asyncpg.
AsyncEnum
(*enums, **kw)¶ 基类:
sqlalchemy.dialects.postgresql.base.ENUM
- async
create_async
(bind=None, checkfirst=True)¶
- async
drop_async
(bind=None, checkfirst=True)¶
- async
- class
gino.dialects.asyncpg.
AsyncpgCompiler
(dialect, statement, column_keys=None, inline=False, **kwargs)¶ 基类:
sqlalchemy.dialects.postgresql.base.PGCompiler
- property
bindtemplate
¶
- property
- class
gino.dialects.asyncpg.
AsyncpgCursor
(context, cursor)¶ - async
forward
(n, *, timeout=<object object>)¶
- async
many
(n, *, timeout=<object object>)¶
- async
next
(*, timeout=<object object>)¶
- async
- class
gino.dialects.asyncpg.
AsyncpgDBAPI
¶ 基类:
gino.dialects.base.BaseDBAPI
Error
= (<class 'asyncpg.exceptions._base.PostgresError'>, <class 'asyncpg.exceptions._base.InterfaceError'>)¶
- class
gino.dialects.asyncpg.
AsyncpgDialect
(*args, bakery=None, **kwargs)¶ 基类:
sqlalchemy.dialects.postgresql.base.PGDialect
,gino.dialects.base.AsyncDialectMixin
colspecs
= {<class 'sqlalchemy.sql.sqltypes.ARRAY'>: <class 'sqlalchemy.dialects.postgresql.array.ARRAY'>, <class 'sqlalchemy.sql.sqltypes.Interval'>: <class 'sqlalchemy.dialects.postgresql.base.INTERVAL'>, <class 'sqlalchemy.sql.sqltypes.Enum'>: <class 'gino.dialects.asyncpg.AsyncEnum'>, <class 'sqlalchemy.sql.sqltypes.JSON.JSONPathType'>: <class 'gino.dialects.asyncpg.AsyncpgJSONPathType'>, <class 'sqlalchemy.sql.sqltypes.JSON'>: <class 'sqlalchemy.dialects.postgresql.json.JSON'>, <class 'sqlalchemy.dialects.postgresql.base.ENUM'>: <class 'gino.dialects.asyncpg.AsyncEnum'>, <class 'sqlalchemy.sql.sqltypes.NullType'>: <class 'gino.dialects.asyncpg.GinoNullType'>}¶
cursor_cls
¶DBAPICursor
的别名
dbapi_class
¶AsyncpgDBAPI
的别名
driver
= 'asyncpg'¶
execution_ctx_cls
¶
- async
get_isolation_level
(connection)¶ Given an asyncpg connection, return its isolation level.
- async
has_schema
(connection, schema)¶
- async
has_sequence
(connection, sequence_name, schema=None)¶ Check the existence of a particular sequence in the database.
Given a
_engine.Connection
object and a string sequence_name, return True if the given sequence exists in the database, False otherwise.
- async
has_table
(connection, table_name, schema=None)¶ Check the existence of a particular table in the database.
Given a
_engine.Connection
object and a string table_name, return True if the given table (possibly within the specified schema) exists in the database, False otherwise.
- async
has_type
(connection, type_name, schema=None)¶
init_kwargs
= {'bakery', 'command_timeout', 'connection_class', 'database', 'host', 'init', 'loop', 'max_cacheable_statement_size', 'max_cached_statement_lifetime', 'max_inactive_connection_lifetime', 'max_queries', 'max_size', 'min_size', 'passfile', 'password', 'port', 'prebake', 'server_settings', 'setup', 'ssl', 'statement_cache_size', 'timeout', 'user'}¶
- async
init_pool
(url, loop, pool_class=None)¶
on_connect
()¶Return a callable which sets up a newly created DBAPI connection.
The callable should accept a single argument "conn" which is the DBAPI connection itself. The inner callable has no return value.
E.g.:
class MyDialect(default.DefaultDialect): # ... def on_connect(self): def do_on_connect(connection): connection.execute("SET SPECIAL FLAGS etc") return do_on_connect
This is used to set dialect-wide per-connection options such as isolation modes, Unicode modes, etc.
The "do_on_connect" callable is invoked by using the
_events.PoolEvents.first_connect()
and_events.PoolEvents.connect()
event hooks, then unwrapping the DBAPI connection and passing it into the callable. The reason it is invoked for both events is so that any dialect-level initialization that occurs upon first connection, which also makes use of the_events.PoolEvents.first_connect()
method, will proceed after this hook has been called. This currently means the hook is in fact called twice for the very first connection in which a dialect creates; and once per connection afterwards.If None is returned, no event listener is generated.
- 返回
a callable that accepts a single DBAPI connection as an argument, or None.
参见
Dialect.connect()
- allows the DBAPIconnect()
sequence itself to be controlled.
- async
set_isolation_level
(connection, level)¶ Given an asyncpg connection, set its isolation level.
statement_compiler
¶AsyncpgCompiler
的别名
supports_native_decimal
= True¶
transaction
(raw_conn, args, kwargs)¶
- class
gino.dialects.asyncpg.
AsyncpgExecutionContext
¶ 基类:
gino.dialects.base.ExecutionContextOverride
,sqlalchemy.dialects.postgresql.base.PGExecutionContext
- class
gino.dialects.asyncpg.
AsyncpgJSONPathType
¶ 基类:
sqlalchemy.dialects.postgresql.json.JSONPathType
bind_processor
(dialect)¶Return a conversion function for processing bind values.
Returns a callable which will receive a bind parameter value as the sole positional argument and will return a value to send to the DB-API.
If processing is not necessary, the method should return
None
.- 参数
dialect -- Dialect instance in use.
- class
gino.dialects.asyncpg.
DBAPICursor
(dbapi_conn)¶ 基类:
gino.dialects.base.DBAPICursor
- async
async_execute
(query, timeout, args, limit=0, many=False)¶
- property
description
¶
- async
execute_baked
(baked_query, timeout, args, one)¶
get_statusmsg
()¶
- async
prepare
(context, clause=None)¶
- async
- class
gino.dialects.asyncpg.
GinoNullType
¶ 基类:
sqlalchemy.sql.sqltypes.NullType
result_processor
(dialect, coltype)¶Return a conversion function for processing result row values.
Returns a callable which will receive a result row column value as the sole positional argument and will return a value to return to the user.
If processing is not necessary, the method should return
None
.- 参数
dialect -- Dialect instance in use.
coltype -- DBAPI coltype argument received in cursor.description.
- class
gino.dialects.asyncpg.
NullPool
(url, loop, **kwargs)¶ - async
acquire
(*, timeout=None)¶
- async
close
()¶
- property
raw_pool
¶
- async
release
(conn)¶
repr
(color)¶
- async
- class
gino.dialects.asyncpg.
Pool
(url, loop, bakery=None, prebake=True, **kwargs)¶ - async
acquire
(*, timeout=None)¶
- async
close
()¶
- property
raw_pool
¶
- async
release
(conn)¶
repr
(color)¶
- async
- class
gino.dialects.asyncpg.
PreparedStatement
(prepared, clause=None)¶
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论