Post-Migrator/services/migration/get-all-migrated-post-ids.go

25 lines
473 B
Go

package migration
import (
"database/sql"
"federated.computer/wp-sync-slowtwitch/services/shared"
)
func GetAllMigratedPostIds(db *sql.DB) ([]int, error) {
var output []int
rows, err := db.Query("SELECT SlowtwitchId FROM PostResults")
if err != nil {
return output, err
}
defer rows.Close()
for rows.Next() {
var id shared.Id
err = rows.Scan(&id.Id)
if err != nil {
return output, err
}
output = append(output, int(id.Id))
}
return output, nil
}