gino.dialects package

Submodules

gino.dialects.asyncpg module

class gino.dialects.asyncpg.AsyncEnum(*enums, **kw)[源代码]

基类:sqlalchemy.dialects.postgresql.base.ENUM

Construct an ENUM.

Arguments are the same as that of types.Enum, but also including the following parameters.

参数:create_type -- Defaults to True. Indicates that CREATE TYPE should be emitted, after optionally checking for the presence of the type, when the parent table is being created; and additionally that DROP TYPE is called when the table is dropped. When False, no check will be performed and no CREATE TYPE or DROP TYPE is emitted, unless create() or drop() are called directly. Setting to False is helpful when invoking a creation scheme to a SQL file without access to the actual database - the create() and drop() methods can be used to emit SQL to a target bind.
coroutine create_async(bind=None, checkfirst=True)[源代码]
coroutine drop_async(bind=None, checkfirst=True)[源代码]
class gino.dialects.asyncpg.AsyncpgCompiler(dialect, statement, column_keys=None, inline=False, **kwargs)[源代码]

基类:sqlalchemy.dialects.postgresql.base.PGCompiler

Construct a new SQLCompiler object.

参数:
  • dialect -- Dialect to be used
  • statement -- ClauseElement to be compiled
  • column_keys -- a list of column names to be compiled into an INSERT or UPDATE statement.
  • inline -- whether to generate INSERT statements as "inline", e.g. not formatted to return any generated defaults
  • kwargs -- additional keyword arguments to be consumed by the superclass.
bindtemplate
class gino.dialects.asyncpg.AsyncpgCursor(context, cursor)[源代码]

基类:gino.dialects.base.Cursor

coroutine forward(n, *, timeout=<object object>)[源代码]
coroutine many(n, *, timeout=<object object>)[源代码]
coroutine next(*, timeout=<object object>)[源代码]
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, **kwargs)[源代码]

基类:sqlalchemy.dialects.postgresql.base.PGDialect, gino.dialects.base.AsyncDialectMixin

colspecs = {<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 'sqlalchemy.dialects.postgresql.json.JSONPathType'>, <class 'sqlalchemy.sql.sqltypes.JSON'>: <class 'sqlalchemy.dialects.postgresql.json.JSON'>, <class 'sqlalchemy.sql.sqltypes.ARRAY'>: <class 'sqlalchemy.dialects.postgresql.array.ARRAY'>, <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

AsyncpgExecutionContext 的别名

coroutine get_isolation_level(connection)[源代码]

Given an asyncpg connection, return its isolation level.

coroutine has_schema(connection, schema)[源代码]
coroutine has_sequence(connection, sequence_name, schema=None)[源代码]

Check the existence of a particular sequence in the database.

Given a Connection object and a string sequence_name, return True if the given sequence exists in the database, False otherwise.

coroutine has_table(connection, table_name, schema=None)[源代码]

Check the existence of a particular table in the database.

Given a Connection object and a string table_name, return True if the given table (possibly within the specified schema) exists in the database, False otherwise.

coroutine has_type(connection, type_name, schema=None)[源代码]
init_kwargs = {'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', 'server_settings', 'setup', 'ssl', 'statement_cache_size', 'timeout', 'user'}
coroutine init_pool(url, loop, pool_class=None)[源代码]
on_connect()[源代码]

return a callable which sets up a newly created DBAPI connection.

This is used to set dialect-wide per-connection options such as isolation modes, unicode modes, etc.

If a callable is returned, it will be assembled into a pool listener that receives the direct DBAPI connection, with all wrappers removed.

If None is returned, no listener will be generated.

coroutine 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.AsyncpgIterator(context, iterator)[源代码]

基类:object

class gino.dialects.asyncpg.DBAPICursor(dbapi_conn)[源代码]

基类:gino.dialects.base.DBAPICursor

coroutine async_execute(query, timeout, args, limit=0, many=False)[源代码]
description
get_statusmsg()[源代码]
coroutine prepare(context, clause=None)[源代码]
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)[源代码]

基类:gino.dialects.base.Pool

coroutine acquire(*, timeout=None)[源代码]
coroutine close()[源代码]
raw_pool
coroutine release(conn)[源代码]
class gino.dialects.asyncpg.Pool(url, loop, **kwargs)[源代码]

基类:gino.dialects.base.Pool

coroutine acquire(*, timeout=None)[源代码]
coroutine close()[源代码]
raw_pool
coroutine release(conn)[源代码]
class gino.dialects.asyncpg.PreparedStatement(prepared, clause=None)[源代码]

基类:gino.dialects.base.PreparedStatement

class gino.dialects.asyncpg.Transaction(tx)[源代码]

基类:gino.dialects.base.Transaction

coroutine begin()[源代码]
coroutine commit()[源代码]
raw_transaction
coroutine rollback()[源代码]

gino.dialects.base module

class gino.dialects.base.AsyncDialectMixin[源代码]

基类:object

compile(elem, *multiparams, **params)[源代码]
cursor_cls

DBAPICursor 的别名

classmethod dbapi()[源代码]
dbapi_class

BaseDBAPI 的别名

coroutine init_pool(url, loop)[源代码]
transaction(raw_conn, args, kwargs)[源代码]
class gino.dialects.base.BaseDBAPI[源代码]

基类:object

static Binary(x)[源代码]
Error

builtins.Exception 的别名

paramstyle = 'numeric'
class gino.dialects.base.Cursor[源代码]

基类:object

coroutine forward(n, *, timeout=<object object>)[源代码]
coroutine many(n, *, timeout=<object object>)[源代码]
coroutine next(*, timeout=<object object>)[源代码]
class gino.dialects.base.DBAPICursor[源代码]

基类:object

coroutine async_execute(query, timeout, args, limit=0, many=False)[源代码]
description
execute(statement, parameters)[源代码]
executemany(statement, parameters)[源代码]
get_statusmsg()[源代码]
coroutine prepare(context, clause=None)[源代码]
class gino.dialects.base.ExecutionContextOverride[源代码]

基类:object

get_result_proxy()[源代码]
loader
model
process_rows(rows, return_model=True)[源代码]
return_model
timeout
class gino.dialects.base.Pool[源代码]

基类:object

coroutine acquire(*, timeout=None)[源代码]
coroutine close()[源代码]
raw_pool
coroutine release(conn)[源代码]
class gino.dialects.base.PreparedStatement(clause=None)[源代码]

基类:object

coroutine all(*multiparams, **params)[源代码]
coroutine first(*multiparams, **params)[源代码]
iterate(*params, **kwargs)[源代码]
coroutine scalar(*multiparams, **params)[源代码]
coroutine status(*multiparams, **params)[源代码]
class gino.dialects.base.Transaction[源代码]

基类:object

coroutine begin()[源代码]
coroutine commit()[源代码]
raw_transaction
coroutine rollback()[源代码]

Module contents