mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2024-10-31 22:18:52 +00:00
use select that returns no data
This commit is contained in:
parent
a9b85b7013
commit
49247130c4
1 changed files with 7 additions and 9 deletions
|
@ -21,7 +21,6 @@ import (
|
|||
"context"
|
||||
"errors"
|
||||
|
||||
"github.com/superseriousbusiness/gotosocial/internal/config"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/log"
|
||||
"github.com/uptrace/bun"
|
||||
|
@ -126,14 +125,13 @@ func (b *basicDB) DropTable(ctx context.Context, i interface{}) error {
|
|||
}
|
||||
|
||||
func (b *basicDB) Ready(ctx context.Context) error {
|
||||
// Simple select of the ID
|
||||
// of our instance account.
|
||||
return b.db.
|
||||
NewSelect().
|
||||
Table("instances").
|
||||
Column("id").
|
||||
Where("? = ?", bun.Ident("domain"), config.GetHost()).
|
||||
Scan(ctx, new(string))
|
||||
if _, err := b.db.
|
||||
NewRaw("SELECT NULL FROM ? LIMIT 0", bun.Ident("instances")).
|
||||
Exec(ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (b *basicDB) Close() error {
|
||||
|
|
Loading…
Reference in a new issue