代码之家  ›  专栏  ›  技术社区  ›  Eugen Konkov

当使用DBIx::Class更新列值时,如何将其重置为默认值?

  •  0
  • Eugen Konkov  · 技术社区  · 7 年前

    在postgresql中更新列时,我们可以将其值重置为 DEFAULT

    UPDATE table SET column = DEFAULT
    

    DBIx::类中是否有模拟?就像这样:

    $schame->result_set( 'table' )->update({ column => DEFAULT })
    
    1 回复  |  直到 7 年前
        1
  •  0
  •   simbabque    7 年前

    谢谢你 . 我需要 ref 要使用文字SQL:

    $schame->result_set( 'table' )->update({ column => \'DEFAULT' })