github.com/semaphoreui/semaphore/db/sql
No package summary is available.
Package
Files: 24. Third party imports: 7. Imports from organisation: 0. Tests: 0. Benchmarks: 0.
Constants
Vars
Types
SqlDb
This type doesn't have documentation.
| Field name | Field type | Comment |
|---|---|---|
| sql |
|
No comment on field. |
migration_2_10_24
This type doesn't have documentation.
| Field name | Field type | Comment |
|---|---|---|
| db |
|
No comment on field. |
migration_2_8_26
This type doesn't have documentation.
| Field name | Field type | Comment |
|---|---|---|
| db |
|
No comment on field. |
migration_2_8_42
This type doesn't have documentation.
| Field name | Field type | Comment |
|---|---|---|
| db |
|
No comment on field. |
Functions
func InsertTemplateFromType
func (*SqlDb) AddEmailOtpVerification
func (*SqlDb) AddTotpVerification
func (*SqlDb) ApplyMigration
ApplyMigration runs executes a database migration
Uses: fmt.Printf, fmt.Println, log.Fatal, log.Warnf, tz.Now.func (*SqlDb) ClearRunnerCache
func (*SqlDb) Close
func (*SqlDb) Connect
func (*SqlDb) CreateAPIToken
func (*SqlDb) CreateAccessKey
func (*SqlDb) CreateAnsibleTaskError
func (*SqlDb) CreateAnsibleTaskHost
func (*SqlDb) CreateEnvironment
func (*SqlDb) CreateEvent
func (*SqlDb) CreateIntegration
func (*SqlDb) CreateIntegrationAlias
func (*SqlDb) CreateIntegrationExtractValue
func (*SqlDb) CreateIntegrationMatcher
func (*SqlDb) CreateInventory
func (*SqlDb) CreateObject
func (*SqlDb) CreateProject
func (*SqlDb) CreateProjectUser
func (*SqlDb) CreateRepository
func (*SqlDb) CreateRunner
func (*SqlDb) CreateSchedule
func (*SqlDb) CreateSession
func (*SqlDb) CreateTask
func (*SqlDb) CreateTaskOutput
func (*SqlDb) CreateTaskStage
func (*SqlDb) CreateTaskStageResult
func (*SqlDb) CreateTemplate
func (*SqlDb) CreateTemplateVault
func (*SqlDb) CreateUser
func (*SqlDb) CreateUserWithoutPassword
func (*SqlDb) CreateView
func (*SqlDb) DeleteAPIToken
func (*SqlDb) DeleteAccessKey
func (*SqlDb) DeleteEmailOtpVerification
func (*SqlDb) DeleteEnvironment
func (*SqlDb) DeleteGlobalRunner
func (*SqlDb) DeleteIntegration
func (*SqlDb) DeleteIntegrationAlias
func (*SqlDb) DeleteIntegrationExtractValue
func (*SqlDb) DeleteIntegrationMatcher
func (*SqlDb) DeleteInventory
func (*SqlDb) DeleteOption
func (*SqlDb) DeleteOptions
func (*SqlDb) DeleteProject
func (*SqlDb) DeleteProjectUser
func (*SqlDb) DeleteRepository
func (*SqlDb) DeleteRunner
func (*SqlDb) DeleteSchedule
func (*SqlDb) DeleteTaskWithOutputs
func (*SqlDb) DeleteTemplate
func (*SqlDb) DeleteTotpVerification
func (*SqlDb) DeleteUser
func (*SqlDb) DeleteView
func (*SqlDb) EndTaskStage
func (*SqlDb) ExpireAPIToken
func (*SqlDb) ExpireSession
func (*SqlDb) GetAPIToken
func (*SqlDb) GetAPITokens
func (*SqlDb) GetAccessKey
func (*SqlDb) GetAccessKeyRefs
func (*SqlDb) GetAccessKeys
func (*SqlDb) GetAllAdmins
func (*SqlDb) GetAllObjects
func (*SqlDb) GetAllObjectsByForeignKey
func (*SqlDb) GetAllProjects
func (*SqlDb) GetAllRunners
func (*SqlDb) GetAnsibleTaskErrors
func (*SqlDb) GetAnsibleTaskHosts
func (*SqlDb) GetEnvironment
func (*SqlDb) GetEnvironmentRefs
func (*SqlDb) GetEnvironmentSecrets
func (*SqlDb) GetEnvironments
func (*SqlDb) GetEvents
func (*SqlDb) GetGlobalRunner
func (*SqlDb) GetIntegration
func (*SqlDb) GetIntegrationAliases
func (*SqlDb) GetIntegrationExtractValue
func (*SqlDb) GetIntegrationExtractValueRefs
func (*SqlDb) GetIntegrationExtractValues
func (*SqlDb) GetIntegrationMatcher
func (*SqlDb) GetIntegrationMatcherRefs
func (*SqlDb) GetIntegrationMatchers
func (*SqlDb) GetIntegrationRefs
func (*SqlDb) GetIntegrations
func (*SqlDb) GetIntegrationsByAlias
func (*SqlDb) GetInventories
func (*SqlDb) GetInventory
func (*SqlDb) GetInventoryRefs
func (*SqlDb) GetObject
func (*SqlDb) GetObjectReferences
Find Object Referrers for objectID based on referring column taken from referringObjectProps Example: GetObjectReferences(db.WebhookMatchers, db.WebhookExtractorProps, integrationID)
Uses: db.ObjectReferrer, reflect.New, reflect.SliceOf.func (*SqlDb) GetObjectsByForeignKeyQuery
func (*SqlDb) GetOption
func (*SqlDb) GetOptions
func (*SqlDb) GetProUserCount
func (*SqlDb) GetProject
func (*SqlDb) GetProjectSchedules
func (*SqlDb) GetProjectTasks
func (*SqlDb) GetProjectUser
func (*SqlDb) GetProjectUsers
func (*SqlDb) GetProjects
func (*SqlDb) GetReferencesForForeignKey
Retrieve the Matchers & Values referencing `id' from WebhookExtractor
Examples: referrerCollection := db.ObjectReferrers{}
d.GetReferencesForForeignKey(db.ProjectProps, id, map[string]db.ObjectProps{
'Templates': db.TemplateProps,
'Inventories': db.InventoryProps,
'Repositories': db.RepositoryProps
}, &referrerCollection)
//
referrerCollection := db.WebhookExtractorReferrers{}
d.GetReferencesForForeignKey(db.WebhookProps, id, map[string]db.ObjectProps{
"Matchers": db.WebhookMatcherProps,
"Values": db.WebhookExtractValueProps
}, &referrerCollection)
Uses: reflect.ValueOf.
func (*SqlDb) GetRepositories
func (*SqlDb) GetRepository
func (*SqlDb) GetRepositoryRefs
func (*SqlDb) GetRunner
func (*SqlDb) GetRunnerByToken
func (*SqlDb) GetRunnerTags
func (*SqlDb) GetRunners
func (*SqlDb) GetSchedule
func (*SqlDb) GetSchedules
func (*SqlDb) GetSession
func (*SqlDb) GetTask
func (*SqlDb) GetTaskOutputs
func (*SqlDb) GetTaskStageOutputs
func (*SqlDb) GetTaskStageResult
func (*SqlDb) GetTaskStages
func (*SqlDb) GetTaskStats
func (*SqlDb) GetTemplate
func (*SqlDb) GetTemplateRefs
func (*SqlDb) GetTemplateSchedules
func (*SqlDb) GetTemplateTasks
func (*SqlDb) GetTemplateVaults
func (*SqlDb) GetTemplates
func (*SqlDb) GetUser
GetUser retrieves a user from the database by ID
Uses: db.ErrNotFound, db.UserTotp, errors.Is.func (*SqlDb) GetUserByLoginOrEmail
func (*SqlDb) GetUserCount
func (*SqlDb) GetUserEvents
func (*SqlDb) GetUsers
func (*SqlDb) GetView
func (*SqlDb) GetViews
func (*SqlDb) IsInitialized
func (*SqlDb) IsMigrationApplied
IsMigrationApplied queries the database to see if a migration table with this version id exists already
func (*SqlDb) PermanentConnection
func (*SqlDb) PrepareQuery
func (*SqlDb) RekeyAccessKeys
func (*SqlDb) SetOption
func (*SqlDb) SetScheduleActive
func (*SqlDb) SetScheduleCommitHash
func (*SqlDb) SetScheduleLastCommitHash
func (*SqlDb) SetSessionVerificationMethod
func (*SqlDb) SetTemplateDescription
func (*SqlDb) SetUserPassword
func (*SqlDb) SetViewPositions
func (*SqlDb) Sql
func (*SqlDb) TouchRunner
func (*SqlDb) TouchSession
func (*SqlDb) TryRollbackMigration
TryRollbackMigration attempts to rollback the database to an earlier version if a rollback exists
Uses: fmt.Printf, fmt.Println, log.Error, log.Fields, log.WithError.func (*SqlDb) UpdateAccessKey
func (*SqlDb) UpdateEnvironment
func (*SqlDb) UpdateIntegration
func (*SqlDb) UpdateIntegrationExtractValue
func (*SqlDb) UpdateIntegrationMatcher
func (*SqlDb) UpdateInventory
func (*SqlDb) UpdateProject
func (*SqlDb) UpdateProjectUser
func (*SqlDb) UpdateRepository
func (*SqlDb) UpdateRunner
func (*SqlDb) UpdateSchedule
func (*SqlDb) UpdateTask
func (*SqlDb) UpdateTemplate
func (*SqlDb) UpdateTemplateVaults
func (*SqlDb) UpdateUser
func (*SqlDb) UpdateView
func (*SqlDb) VerifySession
func (migration_2_10_24) PreApply
func (migration_2_8_26) PostApply
func (migration_2_8_42) PostApply
Private functions
func connect
func createDb
func escapeLike
func getQueryForParams
func getVersionErrPath
getVersionErrPath is the humanoid version with '.err' and file format appended
func getVersionPath
getVersionPath is the humanoid version with the file format appended
func getVersionSQL
getVersionSQL takes a path to an SQL file and returns it from embed.FS a slice of strings separated by newlines
References: log.WithError, path.Join, strings.ReplaceAll, strings.Split, strings.Trim.func handleRollbackError
func validateAPIToken
func validateMutationResult
validateMutationResult checks the success of the update query
References: db.ErrInvalidOperation, strings.Contains.func clearTasks
func deleteByReferrer
func deleteObject
func deleteObjectByReferencedID
func exec
func execTx
func getEvents
func getObject
func getObjectByReferrer
func getObjectRefs
func getObjectRefsFrom
func getObjects
func getObjectsByReferrer
func getOption
func getTaskStage
func getTaskStages
func getTasks
func insert
func makeObjectsQuery
func prepareMigration
prepareMigration converts migration SQLite-query to current dialect. Supported MySQL and Postgres dialects.
References: strings.Join.func prepareQueryWithDialect
func selectAll
func selectOne
func validateTask
Tests
Files: 1. Third party imports: 1. Imports from organisation: 0. Tests: 1. Benchmarks: 0.