首页
/ Peewee-Async 项目教程

Peewee-Async 项目教程

2024-08-26 09:58:36作者:柯茵沙

1. 项目的目录结构及介绍

Peewee-Async 是一个基于 asyncio 的异步 ORM 库,用于支持 Peewee ORM。以下是项目的目录结构及其介绍:

peewee-async/
├── docs/                # 文档目录
├── peewee_async/        # 主要代码目录
│   ├── __init__.py      # 初始化文件
│   ├── _async.py        # 异步相关实现
│   ├── _base.py         # 基础类实现
│   ├── _fields.py       # 字段相关实现
│   ├── _models.py       # 模型相关实现
│   ├── _query.py        # 查询相关实现
│   ├── _utils.py        # 工具函数
│   └── _wrappers.py     # 包装类
├── tests/               # 测试目录
│   ├── __init__.py      # 初始化文件
│   ├── test_async.py    # 异步测试
│   ├── test_base.py     # 基础测试
│   ├── test_fields.py   # 字段测试
│   ├── test_models.py   # 模型测试
│   ├── test_query.py    # 查询测试
│   └── test_utils.py    # 工具函数测试
├── .gitignore           # Git 忽略文件
├── LICENSE              # 许可证文件
├── README.md            # 项目说明文档
├── setup.py             # 安装脚本
└── tox.ini              # 测试配置文件

2. 项目的启动文件介绍

Peewee-Async 项目的启动文件主要是 peewee_async/__init__.py。这个文件包含了项目的初始化代码和主要的导出模块。以下是该文件的主要内容:

from ._async import *
from ._base import *
from ._fields import *
from ._models import *
from ._query import *
from ._utils import *
from ._wrappers import *

__all__ = (
    'AioModel', 'AioManager', 'AioDatabase', 'AioPostgresqlDatabase',
    'AioMySQLDatabase', 'AioPooledPostgresqlDatabase', 'AioPooledMySQLDatabase',
    'AioTransaction', 'AioQuery', 'AioSelectQuery', 'AioUpdateQuery',
    'AioDeleteQuery', 'AioInsertQuery', 'AioRawQuery', 'AioField',
    'AioCharField', 'AioTextField', 'AioIntegerField', 'AioFloatField',
    'AioBooleanField', 'AioDateTimeField', 'AioDateField', 'AioTimeField',
    'AioDecimalField', 'AioUUIDField', 'AioForeignKeyField', 'AioManyToManyField',
    'AioAutoField', 'AioBigIntegerField', 'AioBlobField', 'AioDoubleField',
    'AioIPAddressField', 'AioPrimaryKeyField', 'AioSmallIntegerField',
    'AioTextField', 'AioTimestampField', 'AioUnknownField', 'AioCompositeKey',
    'AioDeferredForeignKey', 'AioDeferredThroughModel', 'AioThroughModel',
    'AioModelAlias', 'AioModelIndex', 'AioModelSelect', 'AioModelUpdate',
    'AioModelDelete', 'AioModelInsert', 'AioModelRaw', 'AioModelQuery',
    'AioModelSelectQuery', 'AioModelUpdateQuery', 'AioModelDeleteQuery',
    'AioModelInsertQuery', 'AioModelRawQuery', 'AioModelQueryWrapper',
    'AioModelQueryExecutor', 'AioModelQueryCompiler', 'AioModelQueryPlanner',
    'AioModelQueryContext', 'AioModelQueryResult', 'AioModelQueryIterator',
    'AioModelQueryCache', 'AioModelQueryLogger', 'AioModelQueryProfiler',
    'AioModelQueryDebugger', 'AioModelQueryValidator', 'AioModelQueryOptimizer',
    'AioModelQueryAnalyzer', 'AioModelQueryBuilder', 'AioModelQueryGenerator',
    'AioModelQueryParser', 'AioModelQueryInterpreter', 'AioModelQueryExecutor',
    'AioModelQueryCompiler', 'AioModelQueryPlanner', 'AioModelQueryContext',
    'AioModelQueryResult', 'Aio
登录后查看全文
热门项目推荐