📜  用于列默认值的 sqlalchemy 函数 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:39.842000             🧑  作者: Mango

代码示例2
# a function which counts upwards
i = 0
def mydefault():
    global i
    i += 1
    return i

t = Table("mytable", meta,
    Column('id', Integer, primary_key=True, default=mydefault),
)