chore: clean binary entries

This commit is contained in:
Steven
2023-12-11 22:16:39 +08:00
parent 52f399a154
commit c608877c3e
33 changed files with 20 additions and 954 deletions

View File

@ -12,13 +12,6 @@ func (d *DB) CreateWebhook(ctx context.Context, create *storepb.Webhook) (*store
fields := []string{"`name`", "`url`", "`creator_id`"}
placeholder := []string{"?", "?", "?"}
args := []any{create.Name, create.Url, create.CreatorId}
if create.Id != 0 {
fields = append(fields, "`id`")
placeholder = append(placeholder, "?")
args = append(args, create.Id)
}
stmt := "INSERT INTO `webhook` (" + strings.Join(fields, ", ") + ") VALUES (" + strings.Join(placeholder, ", ") + ") RETURNING `id`, `created_ts`, `updated_ts`, `row_status`"
var rowStatus string
if err := d.db.QueryRowContext(ctx, stmt, args...).Scan(