postgres

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2019 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 = `` /* 789-byte string literal not displayed */

	// CreateBuildRepoIDNumberIndex represents a query to create an
	// index on the builds table for the repo_id and number columns.
	CreateBuildRepoIDNumberIndex = `
CREATE INDEX
IF NOT EXISTS
builds_repo_id_number
ON builds (repo_id, number);
`

	// 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 (
	// 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);
`

	// CreateLogStepIDIndex represents a query to create an
	// index on the logs table for the step_id column.
	CreateLogStepIDIndex = `
CREATE INDEX
IF NOT EXISTS
logs_step_id
ON logs (step_id);
`

	// CreateLogServiceIDIndex represents a query to create an
	// index on the logs table for the service_id column.
	CreateLogServiceIDIndex = `
CREATE INDEX
IF NOT EXISTS
logs_service_id
ON logs (service_id);
`
)
View Source
const (
	// CreateRepoTable represents a query to
	// create the repos table for Vela.
	CreateRepoTable = `` /* 489-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);
`

	// CreateRepoFullNameIndex represents a query to create an
	// index on the repos table for the full_name column.
	CreateRepoFullNameIndex = `
CREATE INDEX
IF NOT EXISTS
repos_full_name
ON repos (full_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.
	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.
	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.
	CreateSecretTypeOrg = `
CREATE INDEX
IF NOT EXISTS
secrets_type_org
ON secrets (type, org);
`

	// CreateSecretType represents a query to create an
	// index on the secrets table for the type column.
	CreateSecretType = `
CREATE INDEX
IF NOT EXISTS
secrets_type
ON secrets (type);
`
)
View Source
const (
	// CreateServiceTable represents a query to
	// create the services table for Vela.
	CreateServiceTable = `` /* 358-byte string literal not displayed */

	// CreateServiceBuildIDNumberIndex represents a query to create an
	// index on the services table for the build_id and number columns.
	CreateServiceBuildIDNumberIndex = `
CREATE INDEX
IF NOT EXISTS
services_build_id_number
ON services (build_id, number);
`
)
View Source
const (
	// CreateStepTable represents a query to
	// create the steps table for Vela.
	CreateStepTable = `` /* 471-byte string literal not displayed */

	// CreateStepBuildIDNumberIndex represents a query to create an
	// index on the steps table for the build_id and number columns.
	CreateStepBuildIDNumberIndex = `
CREATE INDEX
IF NOT EXISTS
steps_build_id_number
ON steps (build_id, number);
`
)
View Source
const (
	// CreateUserTable represents a query to
	// create the users table for Vela.
	CreateUserTable = `` /* 181-byte string literal not displayed */

	// CreateUserNameIndex represents a query to create an
	// index on the users table for the name column.
	CreateUserNameIndex = `
CREATE INDEX
IF NOT EXISTS
users_name
ON users (name);
`
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Map

type Map struct {
	BuildService   *Service
	LogService     *Service
	RepoService    *Service
	SecretService  *Service
	ServiceService *Service
	StepService    *Service
	UserService    *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