Documentation
¶
Index ¶
- type Driver
- func (d *Driver) AddATeamMemberToProject(ctx context.Context, req *models.TeamMemberAddRequest) error
- func (d *Driver) AddSystemUserMetaInfo(ctx context.Context, doc *types.DefaultDocumentStructure) (*types.DefaultDocumentStructure, error)
- func (d *Driver) AddTeamMetaInfo(ctx context.Context, docs []*models.SystemUser) ([]*models.SystemUser, error)
- func (d *Driver) AddWebhookToProject(ctx context.Context, doc *models.Webhook) (*models.Webhook, error)
- func (d *Driver) AssignProjectToOrganization(ctx context.Context, orgId, userId, projectId string) error
- func (d *Driver) AssignTeamToOrganization(ctx context.Context, orgId, userId, teamId string) error
- func (d *Driver) BlacklistAToken(ctx context.Context, token map[string]interface{}) error
- func (d *Driver) CheckProjectName(ctx context.Context, name string) error
- func (d *Driver) CheckProjectWithRoles(ctx context.Context, userId, projectId string) (*models.ProjectWithRoles, error)
- func (d *Driver) CheckTeamMemberExists(ctx context.Context, projectId string, memberID string) error
- func (d *Driver) CheckTokenBlacklisted(ctx context.Context, tokenId string) error
- func (d *Driver) Close() error
- func (d *Driver) CountProjectUsersByRole(ctx context.Context, projectID string) (map[string]int, error)
- func (d *Driver) CreateOrganization(ctx context.Context, org *models.Organization) (*models.Organization, error)
- func (d *Driver) CreateProject(ctx context.Context, userId string, project *models.Project) (*models.Project, error)
- func (d *Driver) CreateSchemaOperation(ctx context.Context, op *models.SchemaOperation) error
- func (d *Driver) CreateSystemUser(ctx context.Context, user *models.SystemUser) (*models.SystemUser, error)
- func (d *Driver) CreateTeam(ctx context.Context, team *models.Team) (*models.Team, error)
- func (d *Driver) CreateUser(ctx context.Context, row *models.User) (*models.User, error)
- func (d *Driver) DeleteModelType(ctx context.Context, projectID, modelName string) error
- func (d *Driver) DeleteProjectFromSystem(ctx context.Context, projectId string) error
- func (d *Driver) DeleteUser(ctx context.Context, projectID, userID string) error
- func (d *Driver) DeleteWebhook(ctx context.Context, projectId, hookId string) error
- func (d *Driver) EnsureBootstrapAdmin(ctx context.Context) error
- func (d *Driver) EnsureBootstrapOrgTeamProjectWithStarterCreate(ctx context.Context, fn bootstrapmeta.CreateStarterProjectFn) error
- func (d *Driver) EnsureBootstrapProjectSettingsRow(ctx context.Context, projectID string) error
- func (d *Driver) EnsureSystemBootstrap(ctx context.Context) error
- func (d *Driver) FindOrganizationAdmin(ctx context.Context, orgId string) (*models.SystemUser, error)
- func (d *Driver) FindUserOrganizations(ctx context.Context, userId string) ([]*models.Organization, error)
- func (d *Driver) FindUserProjects(ctx context.Context, userId string) ([]*models.Project, error)
- func (d *Driver) FindUserProjectsWithRoles(ctx context.Context, userId string) ([]*models.ProjectWithRoles, error)
- func (d *Driver) FindUserTeams(ctx context.Context, userId string) ([]*models.Team, error)
- func (d *Driver) GetOrganizations(ctx context.Context, userId string) (*models.SearchResponse[models.Organization], error)
- func (d *Driver) GetProject(ctx context.Context, id string) (*models.Project, error)
- func (d *Driver) GetProjectTeams(ctx context.Context, projectId string) (*models.Team, error)
- func (d *Driver) GetProjectWithRolesAndPermission(ctx context.Context, userId string) ([]*models.ProjectWithRoles, error)
- func (d *Driver) GetProjects(ctx context.Context, keys []string) ([]*models.Project, error)
- func (d *Driver) GetSQLBase() *sqlcommon.Base
- func (d *Driver) GetSchemaOperation(ctx context.Context, id string) (*models.SchemaOperation, error)
- func (d *Driver) GetSystemUser(ctx context.Context, id string) (*models.SystemUser, error)
- func (d *Driver) GetSystemUserByEmail(ctx context.Context, email string) (*models.SystemUser, error)
- func (d *Driver) GetSystemUsers(ctx context.Context, keys []string) ([]*models.SystemUser, error)
- func (d *Driver) GetTeams(ctx context.Context, userId string) ([]*models.Team, error)
- func (d *Driver) GetTeamsMembers(ctx context.Context, projectId string) ([]*models.SystemUser, error)
- func (d *Driver) GetUser(ctx context.Context, projectID, userID string) (*models.User, error)
- func (d *Driver) GetUserByUsername(ctx context.Context, projectID, username string) (*models.User, error)
- func (d *Driver) GetWebHook(ctx context.Context, projectId, hookId string) (*models.Webhook, error)
- func (d *Driver) ListAllProjects(ctx context.Context, userId string) ([]*models.Project, error)
- func (d *Driver) ListAllUsers(ctx context.Context) ([]*models.SystemUser, error)
- func (d *Driver) ListSchemaOperationsByStatus(ctx context.Context, projectID string, statuses []string, limit int) ([]*models.SchemaOperation, error)
- func (d *Driver) ListTeams(ctx context.Context, projectId string) ([]*models.SystemUser, error)
- func (d *Driver) ListUsersByEmail(ctx context.Context, projectID, email string) ([]*models.User, error)
- func (d *Driver) ListUsersByGoogleSub(ctx context.Context, projectID, googleSub string) ([]*models.User, error)
- func (d *Driver) ListUsersByPhone(ctx context.Context, projectID, phone string) ([]*models.User, error)
- func (d *Driver) PersistProjectModelTypes(ctx context.Context, projectID string, schemaModels []*models.ModelType) error
- func (d *Driver) Ping() error
- func (d *Driver) RemoveATeamFromOrganization(ctx context.Context, orgId, userId, teamId string) error
- func (d *Driver) RemoveATeamMemberFromProject(ctx context.Context, projectId string, memberID string) error
- func (d *Driver) RemoveProjectFromOrganization(ctx context.Context, orgId, userId, projectId string) error
- func (d *Driver) RunMigration(ctx context.Context) error
- func (d *Driver) SaveAuditLog(ctx context.Context, auditLog *models.AuditLogs) error
- func (d *Driver) SaveProjectAuthenticationSettings(ctx context.Context, projectID string, auth *models.AuthenticationSettings) error
- func (d *Driver) SaveProjectStorageSettings(ctx context.Context, projectID string, storage *models.StorageSettings) error
- func (d *Driver) SaveRawData(ctx context.Context, collection string, data map[string]interface{}) error
- func (d *Driver) SearchAuditLogs(ctx context.Context, param *models.CommonSystemParams) (*models.SearchResponse[models.AuditLogs], error)
- func (d *Driver) SearchFunctions(ctx context.Context, param *models.CommonSystemParams) (*models.SearchResponse[models.ApitoFunction], error)
- func (d *Driver) SearchProjectUsers(ctx context.Context, projectID string, limit, offset int) ([]*models.User, int, error)
- func (d *Driver) SearchProjects(ctx context.Context, param *models.CommonSystemParams) (*models.SearchResponse[models.Project], error)
- func (d *Driver) SearchResource(ctx context.Context, param *models.CommonSystemParams) (*models.SearchResponse[any], error)
- func (d *Driver) SearchSystemUsers(ctx context.Context, param *models.CommonSystemParams) (*models.SearchResponse[models.SystemUser], error)
- func (d *Driver) SearchWebHooks(ctx context.Context, param *models.CommonSystemParams) (*models.SearchResponse[models.Webhook], error)
- func (d *Driver) TouchProjectUpdatedAt(ctx context.Context, projectID string) error
- func (d *Driver) UpdateProject(ctx context.Context, project *models.Project, replace bool) error
- func (d *Driver) UpdateSchemaOperation(ctx context.Context, op *models.SchemaOperation) error
- func (d *Driver) UpdateSystemUser(ctx context.Context, user *models.SystemUser, replace bool) error
- func (d *Driver) UpdateUser(ctx context.Context, row *models.User) error
- func (d *Driver) UpsertModelType(ctx context.Context, projectID string, m *models.ModelType) error
- type SystemSQLDriver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Driver ¶
func GetMariaDBSystemDriver ¶
func (*Driver) AddATeamMemberToProject ¶
func (d *Driver) AddATeamMemberToProject(ctx context.Context, req *models.TeamMemberAddRequest) error
AddATeamMemberToProject adds a team member to a project using SQL
func (*Driver) AddSystemUserMetaInfo ¶
func (d *Driver) AddSystemUserMetaInfo(ctx context.Context, doc *types.DefaultDocumentStructure) (*types.DefaultDocumentStructure, error)
AddSystemUserMetaInfo adds metadata to a system user using SQL
func (*Driver) AddTeamMetaInfo ¶
func (d *Driver) AddTeamMetaInfo(ctx context.Context, docs []*models.SystemUser) ([]*models.SystemUser, error)
AddTeamMetaInfo adds metadata to team members using SQL
func (*Driver) AddWebhookToProject ¶
func (d *Driver) AddWebhookToProject(ctx context.Context, doc *models.Webhook) (*models.Webhook, error)
AddWebhookToProject adds a webhook to a project using SQL
func (*Driver) AssignProjectToOrganization ¶
func (d *Driver) AssignProjectToOrganization(ctx context.Context, orgId, userId, projectId string) error
AssignProjectToOrganization assigns a project to an organization using SQL
func (*Driver) AssignTeamToOrganization ¶
AssignTeamToOrganization assigns a team to an organization using SQL
func (*Driver) BlacklistAToken ¶
BlacklistAToken adds a token to the blacklist using SQL
func (*Driver) CheckProjectName ¶
CheckProjectName checks if a project name already exists using SQL
func (*Driver) CheckProjectWithRoles ¶
func (d *Driver) 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 (*Driver) CheckTeamMemberExists ¶
func (d *Driver) CheckTeamMemberExists(ctx context.Context, projectId string, memberID string) error
CheckTeamMemberExists checks if a team member exists in a project using SQL
func (*Driver) CheckTokenBlacklisted ¶
CheckTokenBlacklisted checks if a token is blacklisted using SQL
func (*Driver) CountProjectUsersByRole ¶
func (*Driver) CreateOrganization ¶
func (d *Driver) CreateOrganization(ctx context.Context, org *models.Organization) (*models.Organization, error)
CreateOrganization creates a new organization using SQL
func (*Driver) CreateProject ¶
func (d *Driver) CreateProject(ctx context.Context, userId string, project *models.Project) (*models.Project, error)
CreateProject creates a new project using SQL
func (*Driver) CreateSchemaOperation ¶
func (*Driver) CreateSystemUser ¶
func (d *Driver) CreateSystemUser(ctx context.Context, user *models.SystemUser) (*models.SystemUser, error)
CreateSystemUser creates a new system user using SQL
func (*Driver) CreateTeam ¶
CreateTeam creates a new team using SQL
func (*Driver) CreateUser ¶
func (*Driver) DeleteModelType ¶
DeleteModelType implements interfaces.ApitoSystemDB — delete one model_types row.
func (*Driver) DeleteProjectFromSystem ¶
DeleteProjectFromSystem deletes a project and all related data using SQL
func (*Driver) DeleteUser ¶
func (*Driver) DeleteWebhook ¶
DeleteWebhook deletes a webhook using SQL
func (*Driver) EnsureBootstrapAdmin ¶
EnsureBootstrapAdmin creates the default admin user if missing (idempotent). Exported for pro layered system bootstrap (e.g. libsql starter provisioned outside OSS driver defaults).
func (*Driver) EnsureBootstrapOrgTeamProjectWithStarterCreate ¶
func (d *Driver) EnsureBootstrapOrgTeamProjectWithStarterCreate(ctx context.Context, fn bootstrapmeta.CreateStarterProjectFn) error
EnsureBootstrapOrgTeamProjectWithStarterCreate seeds default team/org and links the starter project. fn is called only when the starter project row is missing (GetProject returns sql.ErrNoRows). Exported for pro builds that replace OSS starter driver creation (e.g. Turso platform provisioning).
func (*Driver) EnsureBootstrapProjectSettingsRow ¶
EnsureBootstrapProjectSettingsRow ensures a project_settings row exists (idempotent). Exported for pro layered bootstrap that skips open-core ensureStarterProjectDriver.
func (*Driver) EnsureSystemBootstrap ¶
func (*Driver) FindOrganizationAdmin ¶
func (d *Driver) FindOrganizationAdmin(ctx context.Context, orgId string) (*models.SystemUser, error)
FindOrganizationAdmin implements interfaces.ApitoSystemDB.
func (*Driver) FindUserOrganizations ¶
func (d *Driver) FindUserOrganizations(ctx context.Context, userId string) ([]*models.Organization, error)
FindUserOrganizations retrieves all organizations for a given user using SQL
func (*Driver) FindUserProjects ¶
FindUserProjects retrieves all projects for a given user using SQL
func (*Driver) FindUserProjectsWithRoles ¶
func (d *Driver) FindUserProjectsWithRoles(ctx context.Context, userId string) ([]*models.ProjectWithRoles, error)
FindUserProjectsWithRoles implements interfaces.ApitoSystemDB.
func (*Driver) FindUserTeams ¶
FindUserTeams retrieves all teams for a given user using SQL
func (*Driver) GetOrganizations ¶
func (d *Driver) GetOrganizations(ctx context.Context, userId string) (*models.SearchResponse[models.Organization], error)
GetOrganizations implements interfaces.ApitoSystemDB.
func (*Driver) GetProject ¶
GetProject retrieves a project by ID using SQL
func (*Driver) GetProjectTeams ¶
GetProjectTeams retrieves team information for a project using SQL
func (*Driver) GetProjectWithRolesAndPermission ¶
func (d *Driver) GetProjectWithRolesAndPermission(ctx context.Context, userId string) ([]*models.ProjectWithRoles, error)
GetProjectWithRolesAndPermission retrieves projects with roles and permissions for a user using SQL
func (*Driver) GetProjects ¶
GetProjects retrieves multiple projects by their IDs using SQL
func (*Driver) GetSQLBase ¶
func (*Driver) GetSchemaOperation ¶
func (*Driver) GetSystemUser ¶
GetSystemUser retrieves a system user by ID using SQL
func (*Driver) GetSystemUserByEmail ¶
func (d *Driver) GetSystemUserByEmail(ctx context.Context, email string) (*models.SystemUser, error)
GetSystemUserByEmail retrieves a system user by email using SQL
func (*Driver) GetSystemUsers ¶
GetSystemUsers retrieves multiple system users by their IDs using SQL
func (*Driver) GetTeamsMembers ¶
func (d *Driver) GetTeamsMembers(ctx context.Context, projectId string) ([]*models.SystemUser, error)
GetTeamsMembers implements interfaces.ApitoSystemDB.
func (*Driver) GetUserByUsername ¶
func (*Driver) GetWebHook ¶
GetWebHook retrieves a specific webhook by ID using SQL
func (*Driver) ListAllProjects ¶
ListAllProjects lists all projects for a user (with admin check) using SQL
func (*Driver) ListAllUsers ¶
ListAllUsers lists all system users using SQL
func (*Driver) ListSchemaOperationsByStatus ¶
func (*Driver) ListUsersByEmail ¶
func (*Driver) ListUsersByGoogleSub ¶
func (*Driver) ListUsersByPhone ¶
func (*Driver) PersistProjectModelTypes ¶
func (d *Driver) PersistProjectModelTypes(ctx context.Context, projectID string, schemaModels []*models.ModelType) error
PersistProjectModelTypes implements interfaces.ApitoSystemDB: deletes model_types rows for projectID whose name is not in schemaModels, then inserts or updates each model row. schemaModels nil means no-op (reserved). An empty slice deletes all model_types for the project.
func (*Driver) RemoveATeamFromOrganization ¶
func (d *Driver) RemoveATeamFromOrganization(ctx context.Context, orgId, userId, teamId string) error
RemoveATeamFromOrganization removes a team from an organization using SQL
func (*Driver) RemoveATeamMemberFromProject ¶
func (d *Driver) RemoveATeamMemberFromProject(ctx context.Context, projectId string, memberID string) error
RemoveATeamMemberFromProject removes a team member from a project using SQL
func (*Driver) RemoveProjectFromOrganization ¶
func (d *Driver) RemoveProjectFromOrganization(ctx context.Context, orgId, userId, projectId string) error
RemoveProjectFromOrganization removes a project from an organization using SQL
func (*Driver) SaveAuditLog ¶
SaveAuditLog implements interfaces.ApitoSystemDB.
func (*Driver) SaveProjectAuthenticationSettings ¶
func (*Driver) SaveProjectStorageSettings ¶
func (*Driver) SaveRawData ¶
func (d *Driver) SaveRawData(ctx context.Context, collection string, data map[string]interface{}) error
SaveRawData saves raw data using SQL for payment-related operations
func (*Driver) SearchAuditLogs ¶
func (d *Driver) SearchAuditLogs(ctx context.Context, param *models.CommonSystemParams) (*models.SearchResponse[models.AuditLogs], error)
SearchAuditLogs implements interfaces.ApitoSystemDB.
func (*Driver) SearchFunctions ¶
func (d *Driver) SearchFunctions(ctx context.Context, param *models.CommonSystemParams) (*models.SearchResponse[models.ApitoFunction], error)
SearchFunctions searches for cloud functions in a project using SQL
func (*Driver) SearchProjectUsers ¶
func (*Driver) SearchProjects ¶
func (d *Driver) SearchProjects(ctx context.Context, param *models.CommonSystemParams) (*models.SearchResponse[models.Project], error)
SearchProjects searches for projects based on common system parameters using SQL
func (*Driver) SearchResource ¶
func (d *Driver) SearchResource(ctx context.Context, param *models.CommonSystemParams) (*models.SearchResponse[any], error)
SearchResource implements interfaces.ApitoSystemDB.
func (*Driver) SearchSystemUsers ¶
func (d *Driver) SearchSystemUsers(ctx context.Context, param *models.CommonSystemParams) (*models.SearchResponse[models.SystemUser], error)
SearchSystemUsers searches for system users based on parameters using SQL
func (*Driver) SearchWebHooks ¶
func (d *Driver) SearchWebHooks(ctx context.Context, param *models.CommonSystemParams) (*models.SearchResponse[models.Webhook], error)
SearchWebHooks searches for webhooks in a project using SQL
func (*Driver) TouchProjectUpdatedAt ¶
TouchProjectUpdatedAt implements interfaces.ApitoSystemDB.
func (*Driver) UpdateProject ¶
UpdateProject updates a project using SQL
func (*Driver) UpdateSchemaOperation ¶
func (*Driver) UpdateSystemUser ¶
UpdateSystemUser updates a system user using SQL
func (*Driver) UpdateUser ¶
type SystemSQLDriver ¶
type SystemSQLDriver = Driver