Skip to content

Commit

Permalink
Fix SQL error
Browse files Browse the repository at this point in the history
  • Loading branch information
patapancakes committed Nov 20, 2024
1 parent 7c4691e commit bed8220
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion db/package.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func FetchPackageLatestRevision(id int) (int, error) {

func FetchPackage(id int, rev int) (common.Package, error) {
var pkg common.Package
err := handle.QueryRow("SELECT id, rev, type, name, dataname, author, description, data FROM packages WHERE id = ? AND rev = ?", id, rev).Scan(&pkg.ID, &pkg.Revision, &pkg.Type, &pkg.Name, &pkg.Dataname, &pkg.Author, &pkg.Description, &pkg.Data)
err := handle.QueryRow("SELECT id, rev, type, name, dataname, COALESCE(author, \"\"), COALESCE(description, \"\"), data FROM packages WHERE id = ? AND rev = ?", id, rev).Scan(&pkg.ID, &pkg.Revision, &pkg.Type, &pkg.Name, &pkg.Dataname, &pkg.Author, &pkg.Description, &pkg.Data)
if err != nil {
return pkg, err
}
Expand Down

0 comments on commit bed8220

Please sign in to comment.