摘要: 使用 contextmanager 来管理 from sqlalchemy import create_engine from sqlalchemy.orm import scoped_session,sessionmaker db_connect = "mysql+pymysql://root:p 阅读全文
posted @ 2020-07-19 16:43 John-Python 阅读(577) 评论(0) 推荐(0) 编辑
摘要: 关于Join 如上图所示,left join和inner join的取值范围还是有很明显的不同的,看网上不少文章优化left join也不交代上下文环境,直接就是教唆把left join换成inner join,只能说是章口就莱,文体两开花... 关于笛卡尔积 简言之就是强拼,不带条件的硬拼2(多) 阅读全文
posted @ 2020-07-19 15:34 John-Python 阅读(774) 评论(0) 推荐(0) 编辑
摘要: 安装 pip install alembic 初始化 alembic init alembic 修改配置alembic.ini sqlalchemy.url = driver://user:pass@localhost/dbname 修改env.py import sys from logging. 阅读全文
posted @ 2020-07-19 00:15 John-Python 阅读(786) 评论(0) 推荐(0) 编辑