Answers for "how to set default value in sqlalchemy"

SQL
0

sqlalchemy function for default value for column

def mydefault(context):
    return context.get_current_parameters()['counter'] + 12

t = Table('mytable', meta,
    Column('counter', Integer),
    Column('counter_plus_twelve', Integer, default=mydefault, onupdate=mydefault)
)
Posted by: Guest on February-11-2021

Code answers related to "how to set default value in sqlalchemy"

Code answers related to "SQL"

Browse Popular Code Answers by Language