8000 Query with NOW() - INTERVAL '? seconds' error: expected 0 arguments · Issue #3631 · go-gorm/gorm · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Query with NOW() - INTERVAL '? seconds' error: expected 0 arguments #3631
Closed
@frederikhors

Description

@frederikhors

GORM Playground Link

go-gorm/playground#1

Description

I'm using this:

var hours float64
var seconds int
// ...
result := dbPG.Where("created_at < NOW() - INTERVAL '? hours' OR updated_at < NOW() - INTERVAL '? seconds'", hours, seconds).Delete(&tweet)

The query created is:

DELETE FROM "tweets" WHERE created_at < NOW() - INTERVAL '720.000000 hours' OR updated_at < NOW() - INTERVAL '10 seconds'

The error is:

DBG C:/pkg/tweet/main.go:10 expected 0 arguments, got 2

Why?

What I have to use instead?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0