You've already forked reloading-manager
happy monday _ bleh _ (#9)
Some checks failed
🧪 ✨ Unit Tests Workflow / 🧪 📜 JavaScript Tests (push) Successful in 1m23s
🧪 ✨ Unit Tests Workflow / 🧪 🐹 GolangCI-Lint (push) Successful in 1m32s
🧪 ✨ Unit Tests Workflow / 🔍 🐹 Go Tests (push) Successful in 3m35s
🏗️ ✨ Build Workflow / 🖼️ 🔨 Build Frontend (push) Successful in 6m11s
🏗️ ✨ Build Workflow / 🖥️ 🔨 Build Backend (push) Successful in 6m47s
🏗️ ✨ Build Workflow / 🚀 ✨ Deploy Application (push) Failing after 53s
Some checks failed
🧪 ✨ Unit Tests Workflow / 🧪 📜 JavaScript Tests (push) Successful in 1m23s
🧪 ✨ Unit Tests Workflow / 🧪 🐹 GolangCI-Lint (push) Successful in 1m32s
🧪 ✨ Unit Tests Workflow / 🔍 🐹 Go Tests (push) Successful in 3m35s
🏗️ ✨ Build Workflow / 🖼️ 🔨 Build Frontend (push) Successful in 6m11s
🏗️ ✨ Build Workflow / 🖥️ 🔨 Build Backend (push) Successful in 6m47s
🏗️ ✨ Build Workflow / 🚀 ✨ Deploy Application (push) Failing after 53s
Reviewed-on: Siteworxpro/reloading-manager#9 Co-authored-by: Ron Rise <ron@siteworxpro.com> Co-committed-by: Ron Rise <ron@siteworxpro.com>
This commit was merged in pull request #9.
This commit is contained in:
@@ -73,6 +73,16 @@ func (q *Queries) DeleteCartridge(ctx context.Context, id pgtype.UUID) error {
|
||||
return err
|
||||
}
|
||||
|
||||
const deleteLoad = `-- name: DeleteLoad :exec
|
||||
delete from loads
|
||||
where id = $1
|
||||
`
|
||||
|
||||
func (q *Queries) DeleteLoad(ctx context.Context, id pgtype.UUID) error {
|
||||
_, err := q.db.Exec(ctx, deleteLoad, id)
|
||||
return err
|
||||
}
|
||||
|
||||
const getCartridgeById = `-- name: GetCartridgeById :one
|
||||
select c.id as id, c.name, c.meta
|
||||
from cartridges c
|
||||
@@ -126,6 +136,7 @@ func (q *Queries) GetCartridges(ctx context.Context) ([]GetCartridgesRow, error)
|
||||
|
||||
const getLoadById = `-- name: GetLoadById :one
|
||||
select l.id as id,
|
||||
l.photo as photo,
|
||||
c.id as cartridge_id,
|
||||
c.name as cartridge_name,
|
||||
c.meta as cartridge_meta,
|
||||
@@ -147,6 +158,7 @@ where l.id = $1
|
||||
|
||||
type GetLoadByIdRow struct {
|
||||
ID pgtype.UUID `json:"id"`
|
||||
Photo []byte `json:"photo"`
|
||||
CartridgeID pgtype.UUID `json:"cartridge_id"`
|
||||
CartridgeName string `json:"cartridge_name"`
|
||||
CartridgeMeta []byte `json:"cartridge_meta"`
|
||||
@@ -165,6 +177,7 @@ func (q *Queries) GetLoadById(ctx context.Context, id pgtype.UUID) (GetLoadByIdR
|
||||
var i GetLoadByIdRow
|
||||
err := row.Scan(
|
||||
&i.ID,
|
||||
&i.Photo,
|
||||
&i.CartridgeID,
|
||||
&i.CartridgeName,
|
||||
&i.CartridgeMeta,
|
||||
@@ -376,3 +389,43 @@ func (q *Queries) TotalLoads(ctx context.Context) (int64, error) {
|
||||
err := row.Scan(&count)
|
||||
return count, err
|
||||
}
|
||||
|
||||
const updateLoad = `-- name: UpdateLoad :exec
|
||||
update loads set
|
||||
cartridge_id = $1,
|
||||
col = $2,
|
||||
powder_id = $3,
|
||||
powder_gr = $4,
|
||||
primer_id = $5,
|
||||
bullet_id = $6,
|
||||
photo = $7,
|
||||
meta = $8
|
||||
where id = $9
|
||||
`
|
||||
|
||||
type UpdateLoadParams struct {
|
||||
CartridgeID pgtype.UUID `json:"cartridge_id"`
|
||||
Col float32 `json:"col"`
|
||||
PowderID pgtype.UUID `json:"powder_id"`
|
||||
PowderGr float32 `json:"powder_gr"`
|
||||
PrimerID pgtype.UUID `json:"primer_id"`
|
||||
BulletID pgtype.UUID `json:"bullet_id"`
|
||||
Photo []byte `json:"photo"`
|
||||
Meta []byte `json:"meta"`
|
||||
ID pgtype.UUID `json:"id"`
|
||||
}
|
||||
|
||||
func (q *Queries) UpdateLoad(ctx context.Context, arg UpdateLoadParams) error {
|
||||
_, err := q.db.Exec(ctx, updateLoad,
|
||||
arg.CartridgeID,
|
||||
arg.Col,
|
||||
arg.PowderID,
|
||||
arg.PowderGr,
|
||||
arg.PrimerID,
|
||||
arg.BulletID,
|
||||
arg.Photo,
|
||||
arg.Meta,
|
||||
arg.ID,
|
||||
)
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user