MCPcopy
hub / github.com/rilldata/rill / InsertDeployment

Method InsertDeployment

admin/database/postgres/postgres.go:718–733  ·  view source on GitHub ↗
(ctx context.Context, opts *database.InsertDeploymentOptions)

Source from the content-addressed store, hash-verified

716}
717
718func (c *connection) InsertDeployment(ctx context.Context, opts *database.InsertDeploymentOptions) (*database.Deployment, error) {
719 if err := database.Validate(opts); err != nil {
720 return nil, err
721 }
722
723 res := &database.Deployment{}
724 err := c.getDB(ctx).QueryRowxContext(ctx, `
725 INSERT INTO deployments (project_id, owner_user_id, environment, branch, editable, runtime_host, runtime_instance_id, runtime_audience, status, status_message, desired_status, desired_status_updated_on)
726 VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, now()) RETURNING *`,
727 opts.ProjectID, opts.OwnerUserID, opts.Environment, opts.Branch, opts.Editable, opts.RuntimeHost, opts.RuntimeInstanceID, opts.RuntimeAudience, opts.Status, opts.StatusMessage, opts.DesiredStatus,
728 ).StructScan(res)
729 if err != nil {
730 return nil, parseErr("deployment", err)
731 }
732 return res, nil
733}
734
735func (c *connection) DeleteDeployment(ctx context.Context, id string) error {
736 res, err := c.getDB(ctx).ExecContext(ctx, "DELETE FROM deployments WHERE id=$1", id)

Callers

nothing calls this directly

Calls 3

getDBMethod · 0.95
ValidateFunction · 0.92
parseErrFunction · 0.85

Tested by

no test coverage detected