gorm icon indicating copy to clipboard operation
gorm copied to clipboard

The Exec function does not accept parameters in the form of a slice

Open dangquyitt opened this issue 7 months ago • 1 comments

tx.Exec("CREATE VIEW myview AS SELECT * FROM licenses WHERE status IN ?", []string{"ACTIVE", "INACTIVE"}).Error

Query log:

CREATE VIEW myview AS SELECT * FROM licenses WHERE status IN ('ACTIVE','INACTIVE')

Error log:

expected 0 arguments, got 2

The SQL query works fine when I copy the log and run it on a PostgreSQL server

dangquyitt avatar Jul 15 '24 05:07 dangquyitt