mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 03:32:25 -05:00
[chore/performance] Remove remaining 'whereEmptyOrNull' funcs (#1946)
This commit is contained in:
parent
3d16962173
commit
d9c69f6ce0
6 changed files with 13 additions and 38 deletions
|
|
@ -102,7 +102,7 @@ func (a *adminDB) NewSignup(ctx context.Context, username string, reason string,
|
|||
NewSelect().
|
||||
Model(acct).
|
||||
Where("? = ?", bun.Ident("account.username"), username).
|
||||
WhereGroup(" AND ", whereEmptyOrNull("account.domain")).
|
||||
Where("? IS NULL", bun.Ident("account.domain")).
|
||||
Scan(ctx); err != nil {
|
||||
err = a.conn.ProcessError(err)
|
||||
if err != db.ErrNoEntries {
|
||||
|
|
@ -199,7 +199,7 @@ func (a *adminDB) CreateInstanceAccount(ctx context.Context) db.Error {
|
|||
TableExpr("? AS ?", bun.Ident("accounts"), bun.Ident("account")).
|
||||
Column("account.id").
|
||||
Where("? = ?", bun.Ident("account.username"), username).
|
||||
WhereGroup(" AND ", whereEmptyOrNull("account.domain"))
|
||||
Where("? IS NULL", bun.Ident("account.domain"))
|
||||
|
||||
exists, err := a.conn.Exists(ctx, q)
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue