MCPcopy Index your code
hub / github.com/rilldata/rill / InsertProject

Method InsertProject

admin/database/postgres/postgres.go:440–495  ·  view source on GitHub ↗
(ctx context.Context, opts *database.InsertProjectOptions)

Source from the content-addressed store, hash-verified

438}
439
440func (c *connection) InsertProject(ctx context.Context, opts *database.InsertProjectOptions) (*database.Project, error) {
441 if err := database.Validate(opts); err != nil {
442 return nil, err
443 }
444
445 res := &projectDTO{}
446 err := c.getDB(ctx).QueryRowxContext(ctx, `
447 INSERT INTO projects (
448 org_id,
449 name,
450 description,
451 public,
452 created_by_user_id,
453 directory_name,
454 provisioner,
455 prod_slots,
456 subpath,
457 primary_branch,
458 archive_asset_id,
459 git_remote,
460 github_installation_id,
461 github_repo_id,
462 managed_git_repo_id,
463 prod_ttl_seconds,
464 prod_version,
465 dev_slots,
466 dev_ttl_seconds,
467 override_disk_gb
468 )
469 VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20) RETURNING *`,
470 opts.OrganizationID,
471 opts.Name,
472 opts.Description,
473 opts.Public,
474 opts.CreatedByUserID,
475 opts.DirectoryName,
476 opts.Provisioner,
477 opts.ProdSlots,
478 opts.Subpath,
479 opts.PrimaryBranch,
480 opts.ArchiveAssetID,
481 opts.GitRemote,
482 opts.GithubInstallationID,
483 opts.GithubRepoID,
484 opts.ManagedGitRepoID,
485 opts.ProdTTLSeconds,
486 opts.ProdVersion,
487 opts.DevSlots,
488 opts.DevTTLSeconds,
489 opts.OverrideDiskGB,
490 ).StructScan(res)
491 if err != nil {
492 return nil, parseErr("project", err)
493 }
494 return c.projectFromDTO(res)
495}
496
497func (c *connection) DeleteProject(ctx context.Context, id string) error {

Callers

nothing calls this directly

Calls 4

getDBMethod · 0.95
projectFromDTOMethod · 0.95
ValidateFunction · 0.92
parseErrFunction · 0.85

Tested by

no test coverage detected