sql

package
v0.0.0-...-5973960 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const PostgreSQLName = "postgresql"

Variables

This section is empty.

Functions

func CleanSQL

func CleanSQL(sql string) string

Types

type PreparedStmtField

type PreparedStmtField struct {
	SourceName   string
	PreparedName string
}

func (PreparedStmtField) GetPrepared

func (self PreparedStmtField) GetPrepared(statements *Statements) *sql.Stmt

func (PreparedStmtField) GetSource

func (self PreparedStmtField) GetSource(statements *Statements) string

func (PreparedStmtField) SetPrepared

func (self PreparedStmtField) SetPrepared(statements *Statements, stmt *sql.Stmt)

type SQLBackend

type SQLBackend struct {
	DropTablesFirst bool
	// contains filtered or unexported fields
}

func NewSQLBackend

func NewSQLBackend(driver string, dataSource string, packageFormat string, maxModificationDurationSeconds float64, log commonlog.Logger) *SQLBackend

func (*SQLBackend) CancelDeploymentModification

func (self *SQLBackend) CancelDeploymentModification(context contextpkg.Context, modificationToken string) error

(backend.Backend interface)

func (*SQLBackend) Connect

func (self *SQLBackend) Connect(context contextpkg.Context) error

(backend.Backend interface)

func (*SQLBackend) CreateDeployment

func (self *SQLBackend) CreateDeployment(context contextpkg.Context, deployment *backend.Deployment) error

(backend.Backend interface)

func (*SQLBackend) DeleteDeployment

func (self *SQLBackend) DeleteDeployment(context contextpkg.Context, deploymentId string) error

(backend.Backend interface)

func (*SQLBackend) DeletePlugin

func (self *SQLBackend) DeletePlugin(context contextpkg.Context, pluginId backend.PluginID) error

(backend.Backend interface)

func (*SQLBackend) DeleteSite

func (self *SQLBackend) DeleteSite(context contextpkg.Context, siteId string) error

(backend.Backend interface)

func (*SQLBackend) DeleteTemplate

func (self *SQLBackend) DeleteTemplate(context contextpkg.Context, templateId string) error

(backend.Backend interface)

func (*SQLBackend) EndDeploymentModification

func (self *SQLBackend) EndDeploymentModification(context contextpkg.Context, modificationToken string, package_ tkoutil.Package, validation *validationpkg.Validation) (string, error)

(backend.Backend interface)

func (*SQLBackend) GetDeployment

func (self *SQLBackend) GetDeployment(context contextpkg.Context, deploymentId string) (*backend.Deployment, error)

(backend.Backend interface)

func (*SQLBackend) GetPlugin

func (self *SQLBackend) GetPlugin(context contextpkg.Context, pluginId backend.PluginID) (*backend.Plugin, error)

(backend.Backend interface)

func (*SQLBackend) GetSite

func (self *SQLBackend) GetSite(context contextpkg.Context, siteId string) (*backend.Site, error)

(backend.Backend interface)

func (*SQLBackend) GetTemplate

func (self *SQLBackend) GetTemplate(context contextpkg.Context, templateId string) (*backend.Template, error)

(backend.Backend interface)

func (*SQLBackend) ListDeployments

func (self *SQLBackend) ListDeployments(context contextpkg.Context, selectDeployments backend.SelectDeployments, window backend.Window) (util.Results[backend.DeploymentInfo], error)

(backend.Backend interface)

func (*SQLBackend) ListPlugins

func (self *SQLBackend) ListPlugins(context contextpkg.Context, selectPlugins backend.SelectPlugins, window backend.Window) (util.Results[backend.Plugin], error)

(backend.Backend interface)

func (*SQLBackend) ListSites

func (self *SQLBackend) ListSites(context contextpkg.Context, selectSites backend.SelectSites, window backend.Window) (util.Results[backend.SiteInfo], error)

(backend.Backend interface)

func (*SQLBackend) ListTemplates

func (self *SQLBackend) ListTemplates(context contextpkg.Context, selectTemplates backend.SelectTemplates, window backend.Window) (util.Results[backend.TemplateInfo], error)

(backend.Backend interface)

func (*SQLBackend) PurgeDeployments

func (self *SQLBackend) PurgeDeployments(context contextpkg.Context, selectDeployments backend.SelectDeployments) error

(backend.Backend interface)

func (*SQLBackend) PurgePlugins

func (self *SQLBackend) PurgePlugins(context contextpkg.Context, selectPlugins backend.SelectPlugins) error

(backend.Backend interface)

func (*SQLBackend) PurgeSites

func (self *SQLBackend) PurgeSites(context contextpkg.Context, selectSites backend.SelectSites) error

(backend.Backend interface)

func (*SQLBackend) PurgeTemplates

func (self *SQLBackend) PurgeTemplates(context contextpkg.Context, selectTemplates backend.SelectTemplates) error

(backend.Backend interface)

func (*SQLBackend) Release

func (self *SQLBackend) Release(context contextpkg.Context) error

(backend.Backend interface)

func (*SQLBackend) SetPlugin

func (self *SQLBackend) SetPlugin(context contextpkg.Context, plugin *backend.Plugin) error

(backend.Backend interface)

func (*SQLBackend) SetSite

func (self *SQLBackend) SetSite(context contextpkg.Context, site *backend.Site) error

(backend.Backend interface)

func (*SQLBackend) SetTemplate

func (self *SQLBackend) SetTemplate(context contextpkg.Context, template *backend.Template) error

(backend.Backend interface)

func (*SQLBackend) StartDeploymentModification

func (self *SQLBackend) StartDeploymentModification(context contextpkg.Context, deploymentId string) (string, *backend.Deployment, error)

(backend.Backend interface)

func (*SQLBackend) String

func (self *SQLBackend) String() string

(fmt.Stringer interface) (backend.Backend interface)

type SqlArgs

type SqlArgs struct {
	Args []any
}

func (*SqlArgs) Add

func (self *SqlArgs) Add(arg any) string

func (*SqlArgs) AddValue

func (self *SqlArgs) AddValue(arg any)

type SqlWhere

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

func (*SqlWhere) Add

func (self *SqlWhere) Add(e string)

func (*SqlWhere) Apply

func (self *SqlWhere) Apply(sql string) string

type SqlWith

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

func (*SqlWith) Add

func (self *SqlWith) Add(select_ string, table string, ids ...string)

func (*SqlWith) Apply

func (self *SqlWith) Apply(sql string) string

type Statements

type Statements struct {
	CreateTemplates              string
	DropTemplates                string
	CreateTemplatesMetadata      string
	DropTemplatesMetadata        string
	CreateTemplatesMetadataIndex string
	DropTemplatesMetadataIndex   string
	CreateTemplatesDeployments   string
	DropTemplatesDeployments     string

	UpsertTemplate           string
	UpsertTemplateMetadata   string
	UpsertTemplateDeployment string
	SelectTemplate           string
	DeleteTemplate           string
	DeleteTemplateMetadata   string
	DeleteTemplateDeployment string
	DeleteTemplates          string
	SelectTemplates          string

	CreateSites              string
	DropSites                string
	CreateSitesMetadata      string
	DropSitesMetadata        string
	CreateSitesMetadataIndex string
	DropSitesMetadataIndex   string
	CreateSitesDeployments   string
	DropSitesDeployments     string

	UpsertSite           string
	UpsertSiteMetadata   string
	UpsertSiteDeployment string
	SelectSite           string
	DeleteSite           string
	DeleteSiteMetadata   string
	DeleteSiteDeployment string
	DeleteSites          string
	SelectSites          string

	CreateDeployments                  string
	DropDeployments                    string
	CreateDeploymentsMetadata          string
	DropDeploymentsMetadata            string
	CreateDeploymentsMetadataIndex     string
	DropDeploymentsMetadataIndex       string
	CreateDeploymentsPreparedIndex     string
	DropDeploymentsPreparedIndex       string
	CreateDeploymentsApprovedIndex     string
	DropDeploymentsApprovedIndex       string
	CreateDeploymentsModificationIndex string
	DropDeploymentsModificationIndex   string

	InsertDeployment                 string
	UpdateDeployment                 string
	UpsertDeploymentMetadata         string
	SelectDeployment                 string
	SelectDeploymentWithModification string
	SelectDeploymentByModification   string
	UpdateDeploymentModification     string
	ResetDeploymentModification      string
	DeleteDeployment                 string
	DeleteDeploymentMetadata         string
	DeleteDeployments                string
	SelectDeployments                string

	CreatePlugins              string
	DropPlugins                string
	CreatePluginsTypeIndex     string
	DropPluginsTypeIndex       string
	CreatePluginsExecutorIndex string
	DropPluginsExecutorIndex   string
	CreatePluginsTriggers      string
	DropPluginsTriggers        string
	CreatePluginsTriggersIndex string
	DropPluginsTriggersIndex   string

	UpsertPlugin         string
	InsertPluginTrigger  string
	SelectPlugin         string
	DeletePlugin         string
	DeletePluginTriggers string
	DeletePlugins        string
	SelectPlugins        string

	PreparedUpsertTemplate                        *sql.Stmt
	PreparedUpsertTemplateMetadata                *sql.Stmt
	PreparedUpsertTemplateDeployment              *sql.Stmt
	PreparedSelectTemplate                        *sql.Stmt
	PreparedDeleteTemplate                        *sql.Stmt
	PreparedDeleteTemplateMetadata                *sql.Stmt
	PreparedDeleteTemplateDeployment              *sql.Stmt
	PreparedDeleteTemplateDeploymentsByDeployment *sql.Stmt
	PreparedUpsertSite                            *sql.Stmt
	PreparedUpsertSiteMetadata                    *sql.Stmt
	PreparedUpsertSiteDeployment                  *sql.Stmt
	PreparedSelectSite                            *sql.Stmt
	PreparedDeleteSite                            *sql.Stmt
	PreparedDeleteSiteMetadata                    *sql.Stmt
	PreparedDeleteSiteDeployment                  *sql.Stmt
	PreparedInsertDeployment                      *sql.Stmt
	PreparedUpdateDeployment                      *sql.Stmt
	PreparedUpsertDeploymentMetadata              *sql.Stmt
	PreparedSelectDeployment                      *sql.Stmt
	PreparedSelectDeploymentWithModification      *sql.Stmt
	PreparedSelectDeploymentByModification        *sql.Stmt
	PreparedUpdateDeploymentModification          *sql.Stmt
	PreparedResetDeploymentModification           *sql.Stmt
	PreparedDeleteDeployment                      *sql.Stmt
	PreparedDeleteDeploymentMetadata              *sql.Stmt
	PreparedUpsertPlugin                          *sql.Stmt
	PreparedInsertPluginTrigger                   *sql.Stmt
	PreparedSelectPlugin                          *sql.Stmt
	PreparedDeletePlugin                          *sql.Stmt
	PreparedDeletePluginTriggers                  *sql.Stmt
	// contains filtered or unexported fields
}

func NewPostgresqlStatements

func NewPostgresqlStatements(db *sql.DB, log commonlog.Logger) *Statements

func NewStatements

func NewStatements(driver string, db *sql.DB, log commonlog.Logger) *Statements

func (*Statements) CreateTables

func (self *Statements) CreateTables(context contextpkg.Context) error

func (*Statements) DropTables

func (self *Statements) DropTables(context contextpkg.Context) error

func (*Statements) Prepare

func (self *Statements) Prepare(context contextpkg.Context) error

func (*Statements) Release

func (self *Statements) Release()

Jump to

Keyboard shortcuts

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