📜  sqlalchemy 列的默认值 - SQL 代码示例

📅  最后修改于: 2022-03-11 15:05:11.854000             🧑  作者: 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),
)