graph/db+sqldb: add HighestChanID to SQLStore
This commit is contained in:
5 files changed
+54
-1
No files matched your search
@@ -429,6 +429,21 @@ func (q *Queries) GetSourceNodesByVersion(ctx context.Context, version int16) ([
|
||||
return items, nil
|
||||
}
|
||||
|
||||
const highestSCID = `-- name: HighestSCID :one
|
||||
SELECT scid
|
||||
FROM channels
|
||||
WHERE version = $1
|
||||
ORDER BY scid DESC
|
||||
LIMIT 1
|
||||
`
|
||||
|
||||
func (q *Queries) HighestSCID(ctx context.Context, version int16) ([]byte, error) {
|
||||
row := q.db.QueryRowContext(ctx, highestSCID, version)
|
||||
var scid []byte
|
||||
err := row.Scan(&scid)
|
||||
return scid, err
|
||||
}
|
||||
|
||||
const insertChannelFeature = `-- name: InsertChannelFeature :exec
|
||||
/* ─────────────────────────────────────────────
|
||||
channel_features table queries
|
||||
|
||||
Reference in new issue
Block a user