"""
def add():
user = User(xxxx)
session.add(user)
session.add_all([user1, user2])
session.commit()
def search():
all()
first()
filter(User.name == ‘xxx‘)
filter_by(name=‘xxx)
def update():
先查询, 再修改, 再提交
# 回滚
session.rollback()
session.commit()
def del():
session.delete(对象)
session.commit()
# 常见的数据类型
String Float Boolean Time Enum LONGTEXT Text DECIMAL
Int Date DateTime Integer
Column常用的参数
default name nullable autoincrement primary_key onupdate
聚合函数
from sqlachemy import func
max min sum count avg
result = session.query(func.max(Artical.price)).first()
"""
原文:https://www.cnblogs.com/zhansheng/p/13911867.html