jrichie911
jrichie911

Reputation: 137

SQLBoiler ORM, how to execute raw query without binding?

I'm trying this ORM generator here https://github.com/vattle/sqlboiler

and I'm trying to execute a raw query using boil.SQL which I can see in their documentation. But when I do boil.SQL()., I see that the only methods available are Bind. Is there a way I can execute the query without binding to an object? Because I do not need any results back.

Thanks.

Upvotes: 2

Views: 3369

Answers (1)

DylanJ
DylanJ

Reputation: 2413

boil.SQL() returns a *boil.Query. You can pass this into boil.ExecQuery() if you don't care about the results.

q := boil.SQL("execute foo()")
_, err := boil.ExecQuery(q)

https://godoc.org/github.com/vattle/sqlboiler/boil#ExecQuery

Upvotes: 1

Related Questions