Description
SQL 拼接看起来正常,但是实际运行报错。
tx := db.GetPGEngine().Exec("UPDATE t_customer_seat SET expire_time = ?, customer_id = ? WHERE customer_id = ? AND expire_time >= ?",
gorm.Expr("(expire_time + interval ?)", "1 days"),
53,
123,
time.Now())
[25.590ms] [rows:0] UPDATE t_customer_seat SET expire_time = (expire_time + interval '1 days'), customer_id = 53 WHERE customer_id = 123 AND expire_time >= '2024-01-11 22:11:12.645'
Error: syntax error at or near "$1"
Comment From: evoking6
表结构 / table struct: create table t_customer_seat ( id bigserial constraint t_customer_seat_pk primary key, order_id bigint, tenant_id bigint, seat_name varchar(32), day integer, customer_id bigint, active_time timestamp, expire_time timestamp, create_time timestamp default CURRENT_TIMESTAMP );
Comment From: github-actions[bot]
The issue has been automatically marked as stale as it missing playground pull request link, which is important to help others understand your issue effectively and make sure the issue hasn't been fixed on latest master, checkout https://github.com/go-gorm/playground for details. it will be closed in 30 days if no further activity occurs. if you are asking question, please use the Question template, most likely your question already answered https://github.com/go-gorm/gorm/issues or described in the document https://gorm.io ✨ Search Before Asking ✨