Remove unused internal/db.GetPkg() function
This commit is contained in:
parent
fc3782c7aa
commit
bc4dec246c
@ -2,7 +2,6 @@ package db
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/genjidb/genji"
|
"github.com/genjidb/genji"
|
||||||
"github.com/genjidb/genji/document"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Package is a LURE package's database representation
|
// Package is a LURE package's database representation
|
||||||
@ -62,17 +61,6 @@ func GetPkgs(db *genji.DB, where string, args ...any) (*genji.Result, error) {
|
|||||||
return stream, nil
|
return stream, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetPkg returns a single package matching the where conditions
|
|
||||||
func GetPkg(db *genji.DB, where string, args ...any) (*Package, error) {
|
|
||||||
doc, err := db.QueryDocument("SELECT * FROM pkgs WHERE "+where, args...)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
out := &Package{}
|
|
||||||
err = document.StructScan(doc, out)
|
|
||||||
return out, err
|
|
||||||
}
|
|
||||||
|
|
||||||
// DeletePkgs deletes all packages matching the where conditions
|
// DeletePkgs deletes all packages matching the where conditions
|
||||||
func DeletePkgs(db *genji.DB, where string, args ...any) error {
|
func DeletePkgs(db *genji.DB, where string, args ...any) error {
|
||||||
return db.Exec("DELETE * FROM pkgs WHERE "+where, args...)
|
return db.Exec("DELETE * FROM pkgs WHERE "+where, args...)
|
||||||
|
Loading…
Reference in New Issue
Block a user