Don't use LastInsertId() with postgres
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
f83970446e
commit
4f6ea0efb2
|
@ -319,15 +319,16 @@ func (b *memoryBackend) FollowURL(uid string, url string) (microsub.Feed, error)
|
|||
}
|
||||
}
|
||||
|
||||
result, err := b.database.Exec(
|
||||
`INSERT INTO "feeds" ("channel_id", "url") VALUES ($1, $2)`,
|
||||
row := b.database.QueryRow(
|
||||
`INSERT INTO "feeds" ("channel_id", "url") VALUES ($1, $2) RETURNING "id"`,
|
||||
channelID,
|
||||
feed.URL,
|
||||
)
|
||||
if err != nil {
|
||||
return microsub.Feed{}, err
|
||||
if row == nil {
|
||||
return microsub.Feed{}, fmt.Errorf("no feed_id")
|
||||
}
|
||||
feedID, _ := result.LastInsertId()
|
||||
var feedID int
|
||||
_ = row.Scan(&feedID)
|
||||
|
||||
resp, err := b.Fetch3(uid, feed.URL)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue
Block a user