postgres

package
v0.7.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2021 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package postgres provides the Postgres data definition language (DDL) for Vela.

Usage:

import "github.com/go-vela/server/database/ddl/postgres"

Index

Constants

View Source
const (
	// CreateBuildTable represents a query to
	// create the builds table for Vela.
	CreateBuildTable = `` /* 937-byte string literal not displayed */

	// CreateBuildRepoIDIndex represents a query to create an
	// index on the builds table for the repo_id column.
	CreateBuildRepoIDIndex = `
CREATE INDEX
IF NOT EXISTS
builds_repo_id
ON builds (repo_id);
`

	// CreateBuildStatusIndex represents a query to create an
	// index on the builds table for the status column.
	CreateBuildStatusIndex = `
CREATE INDEX
IF NOT EXISTS
builds_status
ON builds (status);
`
)
View Source
const (
	// CreateHookTable represents a query to
	// create the hooks table for Vela.
	CreateHookTable = `` /* 351-byte string literal not displayed */

	// CreateHookRepoIDIndex represents a query to create an
	// index on the hooks table for the repo_id column.
	CreateHookRepoIDIndex = `
CREATE INDEX
IF NOT EXISTS
hooks_repo_id
ON hooks (repo_id);
`
)
View Source
const (
	// CreateLogTable represents a query to
	// create the logs table for Vela.
	CreateLogTable = `` /* 229-byte string literal not displayed */

	// CreateLogBuildIDIndex represents a query to create an
	// index on the logs table for the build_id column.
	CreateLogBuildIDIndex = `
CREATE INDEX
IF NOT EXISTS
logs_build_id
ON logs (build_id);
`
)
View Source
const (
	// CreateRepoTable represents a query to
	// create the repos table for Vela.
	CreateRepoTable = `` /* 559-byte string literal not displayed */

	// CreateRepoOrgNameIndex represents a query to create an
	// index on the repos table for the org and name columns.
	CreateRepoOrgNameIndex = `
CREATE INDEX
IF NOT EXISTS
repos_org_name
ON repos (org, name);
`
)
View Source
const (
	// CreateSecretTable represents a query to
	// create the secrets table for Vela.
	CreateSecretTable = `` /* 390-byte string literal not displayed */

	// CreateSecretTypeOrgRepo represents a query to create an
	// index on the secrets table for the type, org and repo columns.
	//
	// nolint: gosec // ignore false positive
	CreateSecretTypeOrgRepo = `
CREATE INDEX
IF NOT EXISTS
secrets_type_org_repo
ON secrets (type, org, repo);
`

	// CreateSecretTypeOrgTeam represents a query to create an
	// index on the secrets table for the type, org and team columns.
	//
	// nolint: gosec // ignore false positive
	CreateSecretTypeOrgTeam = `
CREATE INDEX
IF NOT EXISTS
secrets_type_org_team
ON secrets (type, org, team);
`

	// CreateSecretTypeOrg represents a query to create an
	// index on the secrets table for the type, and org columns.
	//
	// nolint: gosec // ignore false positive
	CreateSecretTypeOrg = `
CREATE INDEX
IF NOT EXISTS
secrets_type_org
ON secrets (type, org);
`
)
View Source
const (
	// CreateUserTable represents a query to
	// create the users table for Vela.
	CreateUserTable = `` /* 290-byte string literal not displayed */

	// CreateRefreshIndex represents a query to create an
	// index on the users table for the refresh_token column.
	CreateRefreshIndex = `
CREATE INDEX
IF NOT EXISTS
users_refresh
ON users (refresh_token);
`
)
View Source
const (
	// CreateWorkerTable represents a query to
	// create the workers table for Vela.
	CreateWorkerTable = `` /* 275-byte string literal not displayed */

	// CreateWorkersHostnameAddressIndex represents a query to create an
	// index on the workers table for the hostname and address columns.
	CreateWorkersHostnameAddressIndex = `
CREATE INDEX
IF NOT EXISTS
workers_hostname_address
ON workers (hostname, address);
`
)
View Source
const (
	// CreateServiceTable represents a query to
	// create the services table for Vela.
	CreateServiceTable = `` /* 474-byte string literal not displayed */

)
View Source
const (
	// CreateStepTable represents a query to
	// create the steps table for Vela.
	CreateStepTable = `` /* 500-byte string literal not displayed */

)

Variables

This section is empty.

Functions

This section is empty.

Types

type Map

type Map struct {
	BuildService   *Service
	HookService    *Service
	LogService     *Service
	RepoService    *Service
	SecretService  *Service
	ServiceService *Service
	StepService    *Service
	UserService    *Service
	WorkerService  *Service
}

Map represents the Postgres DDL services in a struct for lookups.

func NewMap

func NewMap() *Map

NewMap returns the Postgres Map for DDL lookups.

type Service

type Service struct {
	Create  string
	Indexes []string
}

Service represents the Postgres DDL for a table in the database.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL