db

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Code generated by go generate; DO NOT EDIT.

Code generated by go generate; DO NOT EDIT.

Code generated by go generate; DO NOT EDIT.

Code generated by go generate; DO NOT EDIT.

Code generated by go generate; DO NOT EDIT.

Code generated by go generate; DO NOT EDIT.

Index

Constants

This section is empty.

Variables

View Source
var DDLPostgres = []string{
	"create table if not exists runwebhook (id varchar NOT NULL, revision bigint NOT NULL, creation_time timestamptz NOT NULL, update_time timestamptz NOT NULL, payload bytea NOT NULL, project_id varchar NOT NULL, PRIMARY KEY (id))",
	"create table if not exists runwebhookdelivery (id varchar NOT NULL, revision bigint NOT NULL, creation_time timestamptz NOT NULL, update_time timestamptz NOT NULL, sequence bigint generated by default as identity NOT NULL UNIQUE, run_webhook_id varchar NOT NULL, delivery_status varchar NOT NULL, delivered_at timestamptz, status_code bigint NOT NULL, PRIMARY KEY (id), foreign key (run_webhook_id) references runwebhook(id))",
	"create table if not exists lastruneventsequence (id varchar NOT NULL, revision bigint NOT NULL, creation_time timestamptz NOT NULL, update_time timestamptz NOT NULL, value bigint NOT NULL, PRIMARY KEY (id))",
	"create table if not exists commitstatus (id varchar NOT NULL, revision bigint NOT NULL, creation_time timestamptz NOT NULL, update_time timestamptz NOT NULL, project_id varchar NOT NULL, state varchar NOT NULL, commit_sha varchar NOT NULL, run_counter bigint NOT NULL, description varchar NOT NULL, context varchar NOT NULL, PRIMARY KEY (id))",
	"create table if not exists commitstatusdelivery (id varchar NOT NULL, revision bigint NOT NULL, creation_time timestamptz NOT NULL, update_time timestamptz NOT NULL, sequence bigint generated by default as identity NOT NULL UNIQUE, commit_status_id varchar NOT NULL, delivery_status varchar NOT NULL, delivered_at timestamptz, PRIMARY KEY (id), foreign key (commit_status_id) references commitstatus(id))",

	"create index if not exists runwebhookdelivery_sequence_idx on runwebhookdelivery(sequence)",
	"create index if not exists commitstatusdelivery_sequence_idx on commitstatusdelivery(sequence)",
}
View Source
var DDLSqlite3 = []string{
	"create table if not exists runwebhook (id varchar NOT NULL, revision bigint NOT NULL, creation_time timestamp NOT NULL, update_time timestamp NOT NULL, payload blob NOT NULL, project_id varchar NOT NULL, PRIMARY KEY (id))",
	"create table if not exists runwebhookdelivery (id varchar NOT NULL, revision bigint NOT NULL, creation_time timestamp NOT NULL, update_time timestamp NOT NULL, sequence integer NOT NULL UNIQUE, run_webhook_id varchar NOT NULL, delivery_status varchar NOT NULL, delivered_at timestamp, status_code bigint NOT NULL, PRIMARY KEY (id), foreign key (run_webhook_id) references runwebhook(id))",
	"create table if not exists lastruneventsequence (id varchar NOT NULL, revision bigint NOT NULL, creation_time timestamp NOT NULL, update_time timestamp NOT NULL, value bigint NOT NULL, PRIMARY KEY (id))",
	"create table if not exists commitstatus (id varchar NOT NULL, revision bigint NOT NULL, creation_time timestamp NOT NULL, update_time timestamp NOT NULL, project_id varchar NOT NULL, state varchar NOT NULL, commit_sha varchar NOT NULL, run_counter bigint NOT NULL, description varchar NOT NULL, context varchar NOT NULL, PRIMARY KEY (id))",
	"create table if not exists commitstatusdelivery (id varchar NOT NULL, revision bigint NOT NULL, creation_time timestamp NOT NULL, update_time timestamp NOT NULL, sequence integer NOT NULL UNIQUE, commit_status_id varchar NOT NULL, delivery_status varchar NOT NULL, delivered_at timestamp, PRIMARY KEY (id), foreign key (commit_status_id) references commitstatus(id))",

	"create index if not exists runwebhookdelivery_sequence_idx on runwebhookdelivery(sequence)",
	"create index if not exists commitstatusdelivery_sequence_idx on commitstatusdelivery(sequence)",
}
View Source
var MigrationRunWebhookLimit = runWebhookLimit
View Source
var Sequences = []sqlg.Sequence{
	{
		Name:   "runwebhookdelivery_sequence_seq",
		Table:  "runwebhookdelivery",
		Column: "sequence",
	},
	{
		Name:   "commitstatusdelivery_sequence_seq",
		Table:  "commitstatusdelivery",
		Column: "sequence",
	},
}

Functions

This section is empty.

Types

type DB

type DB struct {
	// contains filtered or unexported fields
}

func NewDB

func NewDB(log zerolog.Logger, sdb *sql.DB) (*DB, error)

func (*DB) CommitStatusArray

func (d *DB) CommitStatusArray() []any

func (*DB) CommitStatusDeliveryArray

func (d *DB) CommitStatusDeliveryArray() []any

func (*DB) CommitStatusDeliveryFromArray

func (d *DB) CommitStatusDeliveryFromArray(a []any, txID string) (*types.CommitStatusDelivery, string, error)

func (*DB) CommitStatusFromArray

func (d *DB) CommitStatusFromArray(a []any, txID string) (*types.CommitStatus, string, error)

func (*DB) DB

func (d *DB) DB() *sql.DB

func (*DB) DBType

func (d *DB) DBType() sql.Type

func (*DB) DDL

func (d *DB) DDL() []string

func (*DB) DeleteCommitStatus

func (d *DB) DeleteCommitStatus(tx *sql.Tx, id string) error

func (*DB) DeleteCommitStatusDeliveriesByCommitStatusID

func (d *DB) DeleteCommitStatusDeliveriesByCommitStatusID(tx *sql.Tx, commitStatusID string) error

func (*DB) DeleteCommitStatusDelivery

func (d *DB) DeleteCommitStatusDelivery(tx *sql.Tx, id string) error

func (*DB) DeleteLastRunEventSequence

func (d *DB) DeleteLastRunEventSequence(tx *sql.Tx, id string) error

func (*DB) DeleteRunWebhook

func (d *DB) DeleteRunWebhook(tx *sql.Tx, id string) error

func (*DB) DeleteRunWebhookDeliveriesByRunWebhookID

func (d *DB) DeleteRunWebhookDeliveriesByRunWebhookID(tx *sql.Tx, runWebhookID string) error

func (*DB) DeleteRunWebhookDelivery

func (d *DB) DeleteRunWebhookDelivery(tx *sql.Tx, id string) error

func (*DB) Do

func (d *DB) Do(ctx context.Context, f func(tx *sql.Tx) error) error

func (*DB) FetchObjects

func (d *DB) FetchObjects(tx *sql.Tx, kind string, q sq.Builder) ([]sqlg.Object, error)

func (*DB) Flavor

func (d *DB) Flavor() sq.Flavor

func (*DB) GetCommitStatusByID

func (d *DB) GetCommitStatusByID(tx *sql.Tx, commitStatusID string) (*types.CommitStatus, error)

func (*DB) GetCommitStatusDeliveriesAfterSequence

func (d *DB) GetCommitStatusDeliveriesAfterSequence(tx *sql.Tx, afterSequence uint64, limit int) ([]*types.CommitStatusDelivery, error)

func (*DB) GetCommitStatusDeliveriesByCommitStatusID

func (d *DB) GetCommitStatusDeliveriesByCommitStatusID(tx *sql.Tx, commitStatusID string, deliveryStatusFilter []types.DeliveryStatus, limit int, sortDirection types.SortDirection) ([]*types.CommitStatusDelivery, error)

func (*DB) GetCommitStatusDeliveryByID

func (d *DB) GetCommitStatusDeliveryByID(tx *sql.Tx, commitStatusDeliveryID string) (*types.CommitStatusDelivery, error)

func (*DB) GetCommitStatuses

func (d *DB) GetCommitStatuses(tx *sql.Tx, limit int) ([]*types.CommitStatus, error)

func (*DB) GetCommitStatusesAfterCommitStatusID

func (d *DB) GetCommitStatusesAfterCommitStatusID(tx *sql.Tx, afterCommitStatusID string, limit int) ([]*types.CommitStatus, error)

func (*DB) GetLastRunEventSequence

func (d *DB) GetLastRunEventSequence(tx *sql.Tx) (*types.LastRunEventSequence, error)

func (*DB) GetProjectCommitStatusDeliveriesAfterSequenceByProjectID

func (d *DB) GetProjectCommitStatusDeliveriesAfterSequenceByProjectID(tx *sql.Tx, afterSequence uint64, projectID string, deliveryStatusFilter []types.DeliveryStatus, limit int, sortDirection types.SortDirection) ([]*types.CommitStatusDelivery, error)

func (*DB) GetProjectRunWebhookDeliveriesAfterSequenceByProjectID

func (d *DB) GetProjectRunWebhookDeliveriesAfterSequenceByProjectID(tx *sql.Tx, afterSequence uint64, projectID string, deliveryStatusFilter []types.DeliveryStatus, limit int, sortDirection types.SortDirection) ([]*types.RunWebhookDelivery, error)

func (*DB) GetRunWebhookByID

func (d *DB) GetRunWebhookByID(tx *sql.Tx, runWebhookID string) (*types.RunWebhook, error)

func (*DB) GetRunWebhookDeliveriesAfterSequence

func (d *DB) GetRunWebhookDeliveriesAfterSequence(tx *sql.Tx, afterSequence uint64, limit int) ([]*types.RunWebhookDelivery, error)

func (*DB) GetRunWebhookDeliveriesByRunWebhookID

func (d *DB) GetRunWebhookDeliveriesByRunWebhookID(tx *sql.Tx, runWebhookID string, deliveryStatusFilter []types.DeliveryStatus, limit int, sortDirection types.SortDirection) ([]*types.RunWebhookDelivery, error)

func (*DB) GetRunWebhookDeliveryByID

func (d *DB) GetRunWebhookDeliveryByID(tx *sql.Tx, runWebhookDeliveryID string) (*types.RunWebhookDelivery, error)

func (*DB) GetRunWebhooks

func (d *DB) GetRunWebhooks(tx *sql.Tx, limit int) ([]*types.RunWebhook, error)

func (*DB) GetRunWebhooksAfterRunWebhookID

func (d *DB) GetRunWebhooksAfterRunWebhookID(tx *sql.Tx, afterRunWebhookID string, limit int) ([]*types.RunWebhook, error)

func (*DB) GetSequence

func (d *DB) GetSequence(tx *sql.Tx, sequenceName string) (uint64, error)

func (*DB) InsertCommitStatus

func (d *DB) InsertCommitStatus(tx *sql.Tx, v *types.CommitStatus) error

func (*DB) InsertCommitStatusDelivery

func (d *DB) InsertCommitStatusDelivery(tx *sql.Tx, v *types.CommitStatusDelivery) error

func (*DB) InsertLastRunEventSequence

func (d *DB) InsertLastRunEventSequence(tx *sql.Tx, v *types.LastRunEventSequence) error

func (*DB) InsertOrUpdateCommitStatus

func (d *DB) InsertOrUpdateCommitStatus(tx *sql.Tx, v *types.CommitStatus) error

func (*DB) InsertOrUpdateCommitStatusDelivery

func (d *DB) InsertOrUpdateCommitStatusDelivery(tx *sql.Tx, v *types.CommitStatusDelivery) error

func (*DB) InsertOrUpdateLastRunEventSequence

func (d *DB) InsertOrUpdateLastRunEventSequence(tx *sql.Tx, v *types.LastRunEventSequence) error

func (*DB) InsertOrUpdateRunWebhook

func (d *DB) InsertOrUpdateRunWebhook(tx *sql.Tx, v *types.RunWebhook) error

func (*DB) InsertOrUpdateRunWebhookDelivery

func (d *DB) InsertOrUpdateRunWebhookDelivery(tx *sql.Tx, v *types.RunWebhookDelivery) error

func (*DB) InsertRawObject

func (d *DB) InsertRawObject(tx *sql.Tx, obj sqlg.Object) error

func (*DB) InsertRunWebhook

func (d *DB) InsertRunWebhook(tx *sql.Tx, v *types.RunWebhook) error

func (*DB) InsertRunWebhookDelivery

func (d *DB) InsertRunWebhookDelivery(tx *sql.Tx, v *types.RunWebhookDelivery) error

func (*DB) LastRunEventSequenceArray

func (d *DB) LastRunEventSequenceArray() []any

func (*DB) LastRunEventSequenceFromArray

func (d *DB) LastRunEventSequenceFromArray(a []any, txID string) (*types.LastRunEventSequence, string, error)

func (*DB) MigrateFuncs

func (d *DB) MigrateFuncs() map[uint]sqlg.MigrateFunc

func (*DB) ObjectToExportJSON

func (d *DB) ObjectToExportJSON(obj sqlg.Object, e *json.Encoder) error

func (*DB) ObjectsInfo

func (d *DB) ObjectsInfo() []sqlg.ObjectInfo

func (*DB) PopulateSequences

func (d *DB) PopulateSequences(tx *sql.Tx) error

func (*DB) RunWebhookArray

func (d *DB) RunWebhookArray() []any

func (*DB) RunWebhookDeliveryArray

func (d *DB) RunWebhookDeliveryArray() []any

func (*DB) RunWebhookDeliveryFromArray

func (d *DB) RunWebhookDeliveryFromArray(a []any, txID string) (*types.RunWebhookDelivery, string, error)

func (*DB) RunWebhookFromArray

func (d *DB) RunWebhookFromArray(a []any, txID string) (*types.RunWebhook, string, error)

func (*DB) SelectObject

func (d *DB) SelectObject(kind string) *sq.SelectBuilder

func (*DB) Sequences

func (d *DB) Sequences() []sqlg.Sequence

func (*DB) UnmarshalExportObject

func (d *DB) UnmarshalExportObject(data []byte) (sqlg.Object, error)

func (*DB) UpdateCommitStatus

func (d *DB) UpdateCommitStatus(tx *sql.Tx, v *types.CommitStatus) error

func (*DB) UpdateCommitStatusDelivery

func (d *DB) UpdateCommitStatusDelivery(tx *sql.Tx, v *types.CommitStatusDelivery) error

func (*DB) UpdateLastRunEventSequence

func (d *DB) UpdateLastRunEventSequence(tx *sql.Tx, v *types.LastRunEventSequence) error

func (*DB) UpdateRunWebhook

func (d *DB) UpdateRunWebhook(tx *sql.Tx, v *types.RunWebhook) error

func (*DB) UpdateRunWebhookDelivery

func (d *DB) UpdateRunWebhookDelivery(tx *sql.Tx, v *types.RunWebhookDelivery) error

func (*DB) Version

func (d *DB) Version() uint

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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