Don't use transaction for querying values

This commit is contained in:
Tulir Asokan 2020-04-02 21:53:45 +03:00
parent 6a42de73d1
commit 064b5b8fed

View file

@ -10,8 +10,8 @@ func init() {
// SQLite doesn't support constraint updates, but it isn't that careful with constraints anyway.
return nil
}
res, _ := tx.Query(`SELECT EXISTS(SELECT constraint_name FROM information_schema.table_constraints
WHERE table_name='message' AND constraint_name='message_chat_jid_fkey');`)
res, _ := ctx.db.Query(`SELECT EXISTS(SELECT constraint_name FROM information_schema.table_constraints
WHERE table_name='message' AND constraint_name='message_chat_jid_fkey')`)
var exists bool
_ = res.Scan(&exists)
if exists {