sql

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2025 License: Apache-2.0 Imports: 21 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PostgreSQLDriver

type PostgreSQLDriver struct {
	ORM              *bun.DB
	DriverCredential *models.DriverCredentials
}

func GetSystemSQLDriver

func GetSystemSQLDriver(driverCredentials *models.DriverCredentials) (*PostgreSQLDriver, error)

func (*PostgreSQLDriver) AddATeamMemberToProject

func (p *PostgreSQLDriver) AddATeamMemberToProject(ctx context.Context, req *models.TeamMemberAddRequest) error

AddATeamMemberToProject adds a team member to a project using SQL

func (*PostgreSQLDriver) AddSystemUserMetaInfo

AddSystemUserMetaInfo adds metadata to a system user using SQL

func (*PostgreSQLDriver) AddTeamMetaInfo

func (p *PostgreSQLDriver) AddTeamMetaInfo(ctx context.Context, docs []*models.SystemUser) ([]*models.SystemUser, error)

AddTeamMetaInfo adds metadata to team members using SQL

func (*PostgreSQLDriver) AddWebhookToProject

func (p *PostgreSQLDriver) AddWebhookToProject(ctx context.Context, doc *models.Webhook) (*models.Webhook, error)

AddWebhookToProject adds a webhook to a project using SQL

func (*PostgreSQLDriver) AssignProjectToOrganization

func (p *PostgreSQLDriver) AssignProjectToOrganization(ctx context.Context, orgId, userId, projectId string) error

AssignProjectToOrganization assigns a project to an organization using SQL

func (*PostgreSQLDriver) AssignTeamToOrganization

func (p *PostgreSQLDriver) AssignTeamToOrganization(ctx context.Context, orgId, userId, teamId string) error

AssignTeamToOrganization assigns a team to an organization using SQL

func (*PostgreSQLDriver) BlacklistAToken

func (p *PostgreSQLDriver) BlacklistAToken(ctx context.Context, token map[string]interface{}) error

BlacklistAToken adds a token to the blacklist using SQL

func (*PostgreSQLDriver) CheckProjectName

func (p *PostgreSQLDriver) CheckProjectName(ctx context.Context, name string) error

CheckProjectName checks if a project name already exists using SQL

func (*PostgreSQLDriver) CheckProjectWithRoles

func (p *PostgreSQLDriver) CheckProjectWithRoles(ctx context.Context, userId, projectId string) (*models.ProjectWithRoles, error)

CheckProjectWithRoles checks if a user belongs to a project and returns roles/permissions using SQL

func (*PostgreSQLDriver) CheckTeamMemberExists

func (p *PostgreSQLDriver) CheckTeamMemberExists(ctx context.Context, projectId string, memberID string) error

CheckTeamMemberExists checks if a team member exists in a project using SQL

func (*PostgreSQLDriver) CheckTokenBlacklisted

func (p *PostgreSQLDriver) CheckTokenBlacklisted(ctx context.Context, tokenId string) error

CheckTokenBlacklisted checks if a token is blacklisted using SQL

func (*PostgreSQLDriver) CreateOrganization

func (p *PostgreSQLDriver) CreateOrganization(ctx context.Context, org *models.Organization) (*models.Organization, error)

CreateOrganization creates a new organization using SQL

func (*PostgreSQLDriver) CreateProject

func (p *PostgreSQLDriver) CreateProject(ctx context.Context, userId string, project *models.Project) (*models.Project, error)

CreateProject creates a new project using SQL

func (*PostgreSQLDriver) CreateSystemUser

func (p *PostgreSQLDriver) CreateSystemUser(ctx context.Context, user *models.SystemUser) (*models.SystemUser, error)

CreateSystemUser creates a new system user using SQL

func (*PostgreSQLDriver) CreateTeam

func (p *PostgreSQLDriver) CreateTeam(ctx context.Context, team *models.Team) (*models.Team, error)

CreateTeam creates a new team using SQL

func (*PostgreSQLDriver) DeleteProjectFromSystem

func (p *PostgreSQLDriver) DeleteProjectFromSystem(ctx context.Context, projectId string) error

DeleteProjectFromSystem deletes a project and all related data using SQL

func (*PostgreSQLDriver) DeleteWebhook

func (p *PostgreSQLDriver) DeleteWebhook(ctx context.Context, projectId, hookId string) error

DeleteWebhook deletes a webhook using SQL

func (*PostgreSQLDriver) FindOrganizationAdmin

func (p *PostgreSQLDriver) FindOrganizationAdmin(ctx context.Context, orgId string) (*models.SystemUser, error)

FindOrganizationAdmin retrieves the admin of an organization using SQL

func (*PostgreSQLDriver) FindUserOrganizations

func (p *PostgreSQLDriver) FindUserOrganizations(ctx context.Context, userId string) ([]*models.Organization, error)

FindUserOrganizations retrieves all organizations for a given user using SQL

func (*PostgreSQLDriver) FindUserProjects

func (p *PostgreSQLDriver) FindUserProjects(ctx context.Context, userId string) ([]*models.Project, error)

FindUserProjects retrieves all projects for a given user using SQL

func (*PostgreSQLDriver) FindUserProjectsWithRoles

func (p *PostgreSQLDriver) FindUserProjectsWithRoles(ctx context.Context, userId string) ([]*models.ProjectWithRoles, error)

FindUserProjectsWithRoles retrieves user projects with their roles and permissions using SQL

func (*PostgreSQLDriver) FindUserTeams

func (p *PostgreSQLDriver) FindUserTeams(ctx context.Context, userId string) ([]*models.Team, error)

FindUserTeams retrieves all teams for a given user using SQL

func (*PostgreSQLDriver) GetOrganizations

func (p *PostgreSQLDriver) GetOrganizations(ctx context.Context, userId string) (*models.SearchResponse[models.Organization], error)

GetOrganizations retrieves organizations for a given user using SQL

func (*PostgreSQLDriver) GetProject

func (p *PostgreSQLDriver) GetProject(ctx context.Context, id string) (*models.Project, error)

GetProject retrieves a project by ID using SQL

func (*PostgreSQLDriver) GetProjectTeams

func (p *PostgreSQLDriver) GetProjectTeams(ctx context.Context, projectId string) (*models.Team, error)

GetProjectTeams retrieves team information for a project using SQL

func (*PostgreSQLDriver) GetProjectWithRolesAndPermission

func (p *PostgreSQLDriver) GetProjectWithRolesAndPermission(ctx context.Context, userId string) ([]*models.ProjectWithRoles, error)

GetProjectWithRolesAndPermission retrieves projects with roles and permissions for a user using SQL

func (*PostgreSQLDriver) GetProjects

func (p *PostgreSQLDriver) GetProjects(ctx context.Context, keys []string) ([]*models.Project, error)

GetProjects retrieves multiple projects by their IDs using SQL

func (*PostgreSQLDriver) GetSystemUser

func (p *PostgreSQLDriver) GetSystemUser(ctx context.Context, id string) (*models.SystemUser, error)

GetSystemUser retrieves a system user by ID using SQL

func (*PostgreSQLDriver) GetSystemUserByEmail

func (p *PostgreSQLDriver) GetSystemUserByEmail(ctx context.Context, email string) (*models.SystemUser, error)

GetSystemUserByEmail retrieves a system user by email using SQL

func (*PostgreSQLDriver) GetSystemUsers

func (p *PostgreSQLDriver) GetSystemUsers(ctx context.Context, keys []string) ([]*models.SystemUser, error)

GetSystemUsers retrieves multiple system users by their IDs using SQL

func (*PostgreSQLDriver) GetTeams

func (p *PostgreSQLDriver) GetTeams(ctx context.Context, userId string) ([]*models.Team, error)

GetTeams retrieves teams for a given user using SQL

func (*PostgreSQLDriver) GetTeamsMembers

func (p *PostgreSQLDriver) GetTeamsMembers(ctx context.Context, projectId string) ([]*models.SystemUser, error)

GetTeamsMembers retrieves team members for a project using SQL

func (*PostgreSQLDriver) GetWebHook

func (p *PostgreSQLDriver) GetWebHook(ctx context.Context, projectId, hookId string) (*models.Webhook, error)

GetWebHook retrieves a specific webhook by ID using SQL

func (*PostgreSQLDriver) ListAllProjects

func (p *PostgreSQLDriver) ListAllProjects(ctx context.Context, userId string) ([]*models.Project, error)

ListAllProjects lists all projects for a user (with admin check) using SQL

func (*PostgreSQLDriver) ListAllUsers

func (p *PostgreSQLDriver) ListAllUsers(ctx context.Context) ([]*models.SystemUser, error)

ListAllUsers lists all system users using SQL

func (*PostgreSQLDriver) ListTeams

func (p *PostgreSQLDriver) ListTeams(ctx context.Context, projectId string) ([]*models.SystemUser, error)

ListTeams lists team members for a project using SQL

func (*PostgreSQLDriver) Ping added in v1.0.7

func (p *PostgreSQLDriver) Ping() error

func (*PostgreSQLDriver) RemoveATeamFromOrganization

func (p *PostgreSQLDriver) RemoveATeamFromOrganization(ctx context.Context, orgId, userId, teamId string) error

RemoveATeamFromOrganization removes a team from an organization using SQL

func (*PostgreSQLDriver) RemoveATeamMemberFromProject

func (p *PostgreSQLDriver) RemoveATeamMemberFromProject(ctx context.Context, projectId string, memberID string) error

RemoveATeamMemberFromProject removes a team member from a project using SQL

func (*PostgreSQLDriver) RemoveProjectFromOrganization

func (p *PostgreSQLDriver) RemoveProjectFromOrganization(ctx context.Context, orgId, userId, projectId string) error

RemoveProjectFromOrganization removes a project from an organization using SQL

func (*PostgreSQLDriver) RunMigration

func (p *PostgreSQLDriver) RunMigration(ctx context.Context) error

func (*PostgreSQLDriver) SaveAuditLog

func (p *PostgreSQLDriver) SaveAuditLog(ctx context.Context, auditLog *models.AuditLogs) error

SaveAuditLog saves an audit log entry using SQL

func (*PostgreSQLDriver) SaveRawData

func (p *PostgreSQLDriver) SaveRawData(ctx context.Context, collection string, data map[string]interface{}) error

SaveRawData saves raw data using SQL for payment-related operations

func (*PostgreSQLDriver) SearchAuditLogs

SearchAuditLogs searches for audit logs based on common system parameters using SQL

func (*PostgreSQLDriver) SearchFunctions

SearchFunctions searches for cloud functions in a project using SQL

func (*PostgreSQLDriver) SearchProjects

SearchProjects searches for projects based on common system parameters using SQL

func (*PostgreSQLDriver) SearchResource

SearchResource searches for resources based on common system parameters using SQL

func (*PostgreSQLDriver) SearchUsers

SearchUsers searches for system users based on parameters using SQL

func (*PostgreSQLDriver) SearchWebHooks

SearchWebHooks searches for webhooks in a project using SQL

func (*PostgreSQLDriver) UpdateProject

func (p *PostgreSQLDriver) UpdateProject(ctx context.Context, project *models.Project, replace bool) error

UpdateProject updates a project using SQL

func (*PostgreSQLDriver) UpdateSystemUser

func (p *PostgreSQLDriver) UpdateSystemUser(ctx context.Context, user *models.SystemUser, replace bool) error

UpdateSystemUser updates a system user using SQL

Jump to

Keyboard shortcuts

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