03 2023 档案
摘要:# in查询 ```python db.query(UserAccount #模型名称).filter(account_type.in_(['1','2','3'])).all() ``` # array_agg 聚合查询 ```python db.query(func.min(UserAccoun
阅读全文
摘要:配置文件 config-dev.ini # -*- coding: utf-8 -*- # 数据库配置 [pgsql] host=192.168.1.2 port=5432 dbname=test user=root passwd=xxxxxxxx # Redis配置 [redis] host=19
阅读全文
摘要:#!/usr/bin/python # -*- coding: utf-8 -*- # @time : 2023/2/3 15:21 # @author : pugongying # @description : 日志配置 # 获取日志目录 import logging import os from
阅读全文
摘要:作用 用于所有表都需要使用的字段或者方法 实现代码 base.py #!/usr/bin/python # -*- coding: utf-8 -*- # @time : 2023/2/13 17:43 # @author : pugongying # @description : from sql
阅读全文
摘要:作用 需要在应用程序启动之前或者关闭时进行,例如数据库迁移,定时任务····· 实际代码 main.py import uvicorn from app import create_app app = create_app() if __name__ == '__main__': uvicorn.r
阅读全文
摘要:cat python_oss.py #!/usr/bin/python # -*- coding: utf-8 -*- # @time : 2023/2/23 14:29 # @author : pugongying # @description : from __future__ import p
阅读全文
摘要:cat docker-compose.yaml version: '3.3' services: es8: image: elasticsearch:8.4.2 container_name: es8 ports: - 9200:9200 - 9300:9300 environment: xpack
阅读全文