Documentation
¶
Index ¶
- Variables
- func BuildCombinedMetaQuery(keys dataloader.Keys, param *QueryBuilderParam) ([]byte, error)
- func BuildCombinedRelationQuery(relationType string, parentModel string, arg *models.CommonSystemParams) (*string, *string, error)
- func CommonDocTransformation(model *models.ModelType, local string, result map[string]interface{}, ...) (*types.DefaultDocumentStructure, error)
- func ConditionBuilder(variable string, args map[string]interface{}, modelType *models.ModelType) (map[string][]string, error)
- func FilterBuilder(variable string, where map[string]interface{}, modelType *models.ModelType) ([]string, error)
- func LimitBuilder(param *graphql.ResolveParams) (int, int)
- func MediaDocTransformation(docType string, result map[string]interface{}) (*models.FileDetails, error)
- func RootConnectionResolverQueryBuilder(param *models.CommonSystemParams) (string, error)
- func RootResolverMediaQueryBuilder(param *graphql.ResolveParams) (string, error)
- func RootResolverQueryBuilder(param *models.CommonSystemParams, returnCount bool) (string, error)
- func SelectBuilder(mv string, local string, modelType *models.ModelType, returnCount bool) []string
- type FieldClassification
- type Meta2
- type QueryBuilderParam
- type SQLDriver
- func (S *SQLDriver) AddATeamMemberToProject(ctx context.Context, req *models.TeamMemberAddRequest) error
- func (S *SQLDriver) AddAuthAddOns(ctx context.Context, project *models.Project, auth map[string]interface{}) error
- func (S *SQLDriver) AddCollection(ctx context.Context, param *models.CommonSystemParams, ...) error
- func (S *SQLDriver) AddDocumentToProject(ctx context.Context, param *models.CommonSystemParams, ...) (interface{}, error)
- func (S *SQLDriver) AddFieldToModel(ctx context.Context, param *models.CommonSystemParams, isUpdate bool, ...) (*models.ModelType, error)
- func (S *SQLDriver) AddModel(ctx context.Context, project *models.Project, model *models.ModelType) (*models.ProjectSchema, error)
- func (S *SQLDriver) AddRelationFields(ctx context.Context, from *models.ConnectionType, to *models.ConnectionType) error
- func (s *SQLDriver) AddRelationFields_AUTOGEN(ctx context.Context, from *models.ConnectionType, to *models.ConnectionType) error
- func (s *SQLDriver) AddTeamMetaInfo(ctx context.Context, docs []*models.SystemUser) ([]*models.SystemUser, error)
- func (s *SQLDriver) AggregateDocOfProject(ctx context.Context, param *models.CommonSystemParams) (interface{}, error)
- func (s *SQLDriver) AggregateDocOfProjectBytes(ctx context.Context, param *models.CommonSystemParams) ([]byte, error)
- func (S *SQLDriver) BuildFieldClassification(_fields []*models.FieldInfo) *FieldClassification
- func (a *SQLDriver) CheckCollectionExists(ctx context.Context, param *models.CommonSystemParams, ...) (bool, error)
- func (s *SQLDriver) CheckOneToOneRelationExists(ctx context.Context, param *models.ConnectDisconnectParam) (bool, error)
- func (S *SQLDriver) CheckProjectExists(ctx context.Context, projectId string) (bool, error)
- func (S *SQLDriver) ConnectBuilder(ctx context.Context, param *models.CommonSystemParams) error
- func (s *SQLDriver) ConvertModel(ctx context.Context, project *models.Project, modelName string) error
- func (S *SQLDriver) CountDocOfProject(ctx context.Context, param *models.CommonSystemParams) (interface{}, error)
- func (S *SQLDriver) CountDocOfProjectBytes(ctx context.Context, param *models.CommonSystemParams) ([]byte, error)
- func (S *SQLDriver) CountMedias(ctx context.Context, projectId string, param *graphql.ResolveParams) (int, error)
- func (f *SQLDriver) CountMultiDocumentOfProject(ctx context.Context, param *models.CommonSystemParams, previewMode bool) (int, error)
- func (s *SQLDriver) CreateIndex(ctx context.Context, param *models.CommonSystemParams, fieldName string, ...) error
- func (S *SQLDriver) CreateMediaDocument(ctx context.Context, projectId string, media *models.FileDetails) (*models.FileDetails, error)
- func (s *SQLDriver) CreateRelation(ctx context.Context, projectId string, relation *models.EdgeRelation) error
- func (S *SQLDriver) DeleteDocumentFromProject(ctx context.Context, param *models.CommonSystemParams) error
- func (s *SQLDriver) DeleteDocumentRelation(ctx context.Context, param *models.CommonSystemParams) error
- func (s *SQLDriver) DeleteDocumentsFromProject(ctx context.Context, param *models.CommonSystemParams) error
- func (s *SQLDriver) DeleteMediaFile(ctx context.Context, param models.CommonSystemParams) error
- func (S *SQLDriver) DeleteProject(ctx context.Context, projectId string) error
- func (s *SQLDriver) DeleteRelation(ctx context.Context, param *models.ConnectDisconnectParam, id string) error
- func (S *SQLDriver) DeleteRelationDocuments(ctx context.Context, projectId string, from *models.ConnectionType, ...) error
- func (s *SQLDriver) DeleteRelationDocuments_AUTOGEN(ctx context.Context, projectId string, from *models.ConnectionType, ...) error
- func (S *SQLDriver) DisconnectBuilder(ctx context.Context, param *models.CommonSystemParams) error
- func (S *SQLDriver) DropField(ctx context.Context, param *models.CommonSystemParams) error
- func (s *SQLDriver) DropIndex(ctx context.Context, param *models.CommonSystemParams, indexName string) error
- func (s *SQLDriver) DropModel(ctx context.Context, project *models.Project, modelName string) error
- func (s *SQLDriver) DuplicateModel(ctx context.Context, project *models.Project, modelName, newName string) (*models.ProjectSchema, error)
- func (S *SQLDriver) GetAllRelationDocumentsOfSingleDocument(ctx context.Context, from string, arg *models.CommonSystemParams) (interface{}, error)
- func (s *SQLDriver) GetAllRelationDocumentsOfSingleDocument_AUTOGEN(ctx context.Context, from string, arg *models.CommonSystemParams) (interface{}, error)
- func (s *SQLDriver) GetLoggedInProjectUser(ctx context.Context, param *models.CommonSystemParams) (*types.DefaultDocumentStructure, error)
- func (s *SQLDriver) GetProjectUser(ctx context.Context, phone, email, projectId string) (*types.DefaultDocumentStructure, error)
- func (s *SQLDriver) GetProjectUsers(ctx context.Context, projectId string, keys []string) (map[string]*types.DefaultDocumentStructure, error)
- func (s *SQLDriver) GetRelationDocument(ctx context.Context, param *models.ConnectDisconnectParam) (*models.EdgeRelation, error)
- func (s *SQLDriver) GetRelationIds(ctx context.Context, param *models.ConnectDisconnectParam) ([]string, error)
- func (S *SQLDriver) GetSingleProjectDocument(ctx context.Context, param *models.CommonSystemParams) (*types.DefaultDocumentStructure, error)
- func (S *SQLDriver) GetSingleProjectDocumentBytes(ctx context.Context, param *models.CommonSystemParams) ([]byte, error)
- func (s *SQLDriver) GetSingleProjectDocumentRevisions(ctx context.Context, param *models.CommonSystemParams) ([]*models.DocumentRevisionHistory, error)
- func (S *SQLDriver) GetSingleRawDocumentFromProject(ctx context.Context, param *models.CommonSystemParams) (interface{}, error)
- func (S *SQLDriver) ListMedias(ctx context.Context, projectId string, param *graphql.ResolveParams) ([]*models.FileDetails, error)
- func (s *SQLDriver) NewInsertableRelations(ctx context.Context, param *models.ConnectDisconnectParam) ([]string, error)
- func (p *SQLDriver) Ping() error
- func (S *SQLDriver) QueryMultiDocumentOfProject(ctx context.Context, param *models.CommonSystemParams) ([]*types.DefaultDocumentStructure, error)
- func (S *SQLDriver) QueryMultiDocumentOfProjectBytes(ctx context.Context, param *models.CommonSystemParams) ([]byte, error)
- func (S *SQLDriver) RelationshipDataLoader(ctx context.Context, param *models.CommonSystemParams, ...) (interface{}, error)
- func (S *SQLDriver) RelationshipDataLoaderBytes(ctx context.Context, param *models.CommonSystemParams, ...) ([]byte, error)
- func (S *SQLDriver) RemoveATeamMemberFromProject(ctx context.Context, projectId string, memberId string) error
- func (a *SQLDriver) RemoveAuthAddOns(ctx context.Context, project *models.Project, option map[string]interface{}) error
- func (s *SQLDriver) RenameField(ctx context.Context, oldFieldName string, repeatedFieldGroup string, ...) error
- func (s *SQLDriver) RenameModel(ctx context.Context, project *models.Project, modelName, newName string) error
- func (S *SQLDriver) TransferProject(ctx context.Context, userId, from, to string) error
- func (S *SQLDriver) UpdateDocumentOfProject(ctx context.Context, param *models.CommonSystemParams, ...) error
Constants ¶
This section is empty.
Variables ¶
var FilterSuffix = map[string]string{
"eq": "==",
"ne": "!=",
"lt": "<",
"lte": "<=",
"gt": ">",
"gte": ">=",
"in": "IN",
"not_in": "NOT IN",
}
Functions ¶
func BuildCombinedMetaQuery ¶
func BuildCombinedMetaQuery(keys dataloader.Keys, param *QueryBuilderParam) ([]byte, error)
func CommonDocTransformation ¶
func CommonDocTransformation(model *models.ModelType, local string, result map[string]interface{}, classification *FieldClassification) (*types.DefaultDocumentStructure, error)
func ConditionBuilder ¶
func FilterBuilder ¶
func LimitBuilder ¶
func LimitBuilder(param *graphql.ResolveParams) (int, int)
func MediaDocTransformation ¶
func MediaDocTransformation(docType string, result map[string]interface{}) (*models.FileDetails, error)
func RootConnectionResolverQueryBuilder ¶
func RootConnectionResolverQueryBuilder(param *models.CommonSystemParams) (string, error)
func RootResolverMediaQueryBuilder ¶
func RootResolverMediaQueryBuilder(param *graphql.ResolveParams) (string, error)
func RootResolverQueryBuilder ¶
func RootResolverQueryBuilder(param *models.CommonSystemParams, returnCount bool) (string, error)
Types ¶
type FieldClassification ¶
type Meta2 ¶
type Meta2 struct { ID string `gorm:"primaryKey;column:id;not null"` DocID string `gorm:"column:doc_id;not null"` CreatedAt time.Time `gorm:"column:created_at;not null;default:current_date"` UpdatedAt time.Time `gorm:"column:updated_at;not null;default:current_date"` CreatedBy string `gorm:"column:created_by;not null"` UpdatedBy string `gorm:"column:updated_by;not null"` Status string `gorm:"column:status;not null"` }
type QueryBuilderParam ¶
type SQLDriver ¶
type SQLDriver struct { ORM *bun.DB DriverCredential *models.DriverCredentials }
func GetSQLDriver ¶
func GetSQLDriver(driverCredentials *models.DriverCredentials) (*SQLDriver, error)
func (*SQLDriver) AddATeamMemberToProject ¶
func (*SQLDriver) AddAuthAddOns ¶
func (*SQLDriver) AddCollection ¶
func (*SQLDriver) AddDocumentToProject ¶
func (S *SQLDriver) AddDocumentToProject(ctx context.Context, param *models.CommonSystemParams, doc *types.DefaultDocumentStructure) (interface{}, error)
func (*SQLDriver) AddFieldToModel ¶
func (*SQLDriver) AddRelationFields ¶
func (S *SQLDriver) AddRelationFields(ctx context.Context, from *models.ConnectionType, to *models.ConnectionType) error
func (*SQLDriver) AddRelationFields_AUTOGEN ¶
func (s *SQLDriver) AddRelationFields_AUTOGEN(ctx context.Context, from *models.ConnectionType, to *models.ConnectionType) error
AddRelationFields creates a relation field (has one or has many) between models.
func (*SQLDriver) AddTeamMetaInfo ¶
func (s *SQLDriver) AddTeamMetaInfo(ctx context.Context, docs []*models.SystemUser) ([]*models.SystemUser, error)
AddTeamMetaInfo adds metadata information for a team in the project.
func (*SQLDriver) AggregateDocOfProject ¶
func (s *SQLDriver) AggregateDocOfProject(ctx context.Context, param *models.CommonSystemParams) (interface{}, error)
AggregateDocOfProject aggregates the documents in the project.
func (*SQLDriver) AggregateDocOfProjectBytes ¶
func (s *SQLDriver) AggregateDocOfProjectBytes(ctx context.Context, param *models.CommonSystemParams) ([]byte, error)
AggregateDocOfProjectBytes aggregates the documents in the project and returns it as bytes.
func (*SQLDriver) BuildFieldClassification ¶
func (S *SQLDriver) BuildFieldClassification(_fields []*models.FieldInfo) *FieldClassification
func (*SQLDriver) CheckCollectionExists ¶
func (*SQLDriver) CheckOneToOneRelationExists ¶
func (s *SQLDriver) CheckOneToOneRelationExists(ctx context.Context, param *models.ConnectDisconnectParam) (bool, error)
CheckOneToOneRelationExists checks if a one-to-one relation exists in the project.
func (*SQLDriver) CheckProjectExists ¶
func (*SQLDriver) ConnectBuilder ¶
func (*SQLDriver) ConvertModel ¶
func (s *SQLDriver) ConvertModel(ctx context.Context, project *models.Project, modelName string) error
ConvertModel converts a model in the project.
func (*SQLDriver) CountDocOfProject ¶
func (*SQLDriver) CountDocOfProjectBytes ¶
func (*SQLDriver) CountMedias ¶
func (*SQLDriver) CountMultiDocumentOfProject ¶
func (*SQLDriver) CreateIndex ¶
func (s *SQLDriver) CreateIndex(ctx context.Context, param *models.CommonSystemParams, fieldName string, parent_field string) error
CreateIndex creates an index for a model in the project.
func (*SQLDriver) CreateMediaDocument ¶
func (S *SQLDriver) CreateMediaDocument(ctx context.Context, projectId string, media *models.FileDetails) (*models.FileDetails, error)
func (*SQLDriver) CreateRelation ¶
func (s *SQLDriver) CreateRelation(ctx context.Context, projectId string, relation *models.EdgeRelation) error
CreateRelation creates a relation in the project.
func (*SQLDriver) DeleteDocumentFromProject ¶
func (*SQLDriver) DeleteDocumentRelation ¶
func (s *SQLDriver) DeleteDocumentRelation(ctx context.Context, param *models.CommonSystemParams) error
DeleteDocumentRelation deletes all relations or data in pivot tables from the project.
func (*SQLDriver) DeleteDocumentsFromProject ¶
func (s *SQLDriver) DeleteDocumentsFromProject(ctx context.Context, param *models.CommonSystemParams) error
DeleteDocumentsFromProject deletes multiple documents from the project.
func (*SQLDriver) DeleteMediaFile ¶
DeleteMediaFile deletes a media file from the project.
func (*SQLDriver) DeleteProject ¶
func (*SQLDriver) DeleteRelation ¶
func (s *SQLDriver) DeleteRelation(ctx context.Context, param *models.ConnectDisconnectParam, id string) error
DeleteRelation deletes a relation in the project.
func (*SQLDriver) DeleteRelationDocuments ¶
func (S *SQLDriver) DeleteRelationDocuments(ctx context.Context, projectId string, from *models.ConnectionType, to *models.ConnectionType) error
func (*SQLDriver) DeleteRelationDocuments_AUTOGEN ¶
func (s *SQLDriver) DeleteRelationDocuments_AUTOGEN(ctx context.Context, projectId string, from *models.ConnectionType, to *models.ConnectionType) error
DeleteRelationDocuments drops pivot tables, relation keys, or collection tables and all documents within them.
func (*SQLDriver) DisconnectBuilder ¶
func (*SQLDriver) DropIndex ¶
func (s *SQLDriver) DropIndex(ctx context.Context, param *models.CommonSystemParams, indexName string) error
DropIndex drops an index from a model in the project.
func (*SQLDriver) DuplicateModel ¶
func (s *SQLDriver) DuplicateModel(ctx context.Context, project *models.Project, modelName, newName string) (*models.ProjectSchema, error)
DuplicateModel duplicates a model in the project.
func (*SQLDriver) GetAllRelationDocumentsOfSingleDocument ¶
func (*SQLDriver) GetAllRelationDocumentsOfSingleDocument_AUTOGEN ¶
func (s *SQLDriver) GetAllRelationDocumentsOfSingleDocument_AUTOGEN(ctx context.Context, from string, arg *models.CommonSystemParams) (interface{}, error)
GetAllRelationDocumentsOfSingleDocument retrieves all relation data of a single document by ID.
func (*SQLDriver) GetLoggedInProjectUser ¶
func (s *SQLDriver) GetLoggedInProjectUser(ctx context.Context, param *models.CommonSystemParams) (*types.DefaultDocumentStructure, error)
GetLoggedInProjectUser retrieves the logged-in user profile for the project.
func (*SQLDriver) GetProjectUser ¶
func (s *SQLDriver) GetProjectUser(ctx context.Context, phone, email, projectId string) (*types.DefaultDocumentStructure, error)
GetProjectUser retrieves a user profile by phone, email, and project ID.
func (*SQLDriver) GetProjectUsers ¶
func (s *SQLDriver) GetProjectUsers(ctx context.Context, projectId string, keys []string) (map[string]*types.DefaultDocumentStructure, error)
GetProjectUsers retrieves metadata for multiple users in the project.
func (*SQLDriver) GetRelationDocument ¶
func (s *SQLDriver) GetRelationDocument(ctx context.Context, param *models.ConnectDisconnectParam) (*models.EdgeRelation, error)
GetRelationDocument retrieves a relation document by ID.
func (*SQLDriver) GetRelationIds ¶
func (s *SQLDriver) GetRelationIds(ctx context.Context, param *models.ConnectDisconnectParam) ([]string, error)
GetRelationIds retrieves the IDs of every document related to a document.
func (*SQLDriver) GetSingleProjectDocument ¶
func (S *SQLDriver) GetSingleProjectDocument(ctx context.Context, param *models.CommonSystemParams) (*types.DefaultDocumentStructure, error)
func (*SQLDriver) GetSingleProjectDocumentBytes ¶
func (*SQLDriver) GetSingleProjectDocumentRevisions ¶
func (s *SQLDriver) GetSingleProjectDocumentRevisions(ctx context.Context, param *models.CommonSystemParams) ([]*models.DocumentRevisionHistory, error)
GetSingleProjectDocumentRevisions retrieves the revision history of a single project document by ID.
func (*SQLDriver) GetSingleRawDocumentFromProject ¶
func (*SQLDriver) ListMedias ¶
func (S *SQLDriver) ListMedias(ctx context.Context, projectId string, param *graphql.ResolveParams) ([]*models.FileDetails, error)
func (*SQLDriver) NewInsertableRelations ¶
func (s *SQLDriver) NewInsertableRelations(ctx context.Context, param *models.ConnectDisconnectParam) ([]string, error)
NewInsertableRelations retrieves new insertable relations in the project.
func (*SQLDriver) QueryMultiDocumentOfProject ¶
func (S *SQLDriver) QueryMultiDocumentOfProject(ctx context.Context, param *models.CommonSystemParams) ([]*types.DefaultDocumentStructure, error)
func (*SQLDriver) QueryMultiDocumentOfProjectBytes ¶
func (*SQLDriver) RelationshipDataLoader ¶
func (*SQLDriver) RelationshipDataLoaderBytes ¶
func (*SQLDriver) RemoveATeamMemberFromProject ¶
func (*SQLDriver) RemoveAuthAddOns ¶
func (*SQLDriver) RenameField ¶
func (s *SQLDriver) RenameField(ctx context.Context, oldFieldName string, repeatedFieldGroup string, param *models.CommonSystemParams) error
RenameField renames a field in a model along with its data key.
func (*SQLDriver) RenameModel ¶
func (s *SQLDriver) RenameModel(ctx context.Context, project *models.Project, modelName, newName string) error
RenameModel renames a model in the project.
func (*SQLDriver) TransferProject ¶
func (*SQLDriver) UpdateDocumentOfProject ¶
func (S *SQLDriver) UpdateDocumentOfProject(ctx context.Context, param *models.CommonSystemParams, doc *types.DefaultDocumentStructure, replace bool) error