Documentation
¶
Index ¶
- Variables
- func AlterTableAddFieldSQL(engine, tableName string, f *models.FieldInfo) ([]string, error)
- func ApplyLitestreamConnectionPragmas(ctx context.Context, orm *bun.DB, engine string) error
- func ApplyTursoSyncConnectionPragmas(ctx context.Context, orm *bun.DB, engine string) error
- func BuildCombinedMetaQuery(keys dataloader.Keys, param *QueryBuilderParam) ([]byte, error)
- func BuildCombinedRelationQuery(cfg *models.Config, relationType string, parentModel string, ...) (string, []interface{}, *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 PhysicalSQLColumnForSystemRelationField(identifier string, modelType *models.ModelType) string
- func PreflightSQLiteRelationParentTablesForAddRelation(ctx context.Context, db bun.IDB, engine string, ...) error
- func RootConnectionResolverQueryBuilder(cfg *models.Config, param *models.CommonSystemParams) (string, error)
- func RootResolverMediaQueryBuilder(param *graphql.ResolveParams) (string, error)
- func RootResolverQueryBuilder(cfg *models.Config, param *models.CommonSystemParams, returnCount bool) (string, []interface{}, error)
- func RunAnalyzeAfterIndexDDL(ctx context.Context, d *Driver)
- func RunSQLiteLikePostDDL(ctx context.Context, d *Driver) error
- func SelectBuilder(mv string, local string, modelType *models.ModelType, returnCount bool) []string
- func StripArangoEnvelopeKeysForSQLInsert(data map[string]interface{}, param *models.CommonSystemParams)
- type Driver
- func (d *Driver) AddATeamMemberToProject(ctx context.Context, req *models.TeamMemberAddRequest) error
- func (d *Driver) AddAuthAddOns(ctx context.Context, project *models.Project, auth map[string]interface{}) error
- func (d *Driver) AddDocumentToProject(ctx context.Context, param *models.CommonSystemParams, ...) (interface{}, error)
- func (d *Driver) AddFieldToModel(ctx context.Context, param *models.CommonSystemParams, isUpdate bool, ...) (*models.ModelType, error)
- func (d *Driver) AddModel(ctx context.Context, project *models.Project, model *models.ModelType) (*models.ProjectSchema, error)
- func (d *Driver) AddRelationFields(ctx context.Context, from *models.ConnectionType, to *models.ConnectionType) error
- func (s *Driver) AddRelationFields_AUTOGEN(ctx context.Context, from *models.ConnectionType, to *models.ConnectionType) error
- func (s *Driver) AddTeamMetaInfo(ctx context.Context, docs []*models.SystemUser) ([]*models.SystemUser, error)
- func (s *Driver) AggregateDocOfProject(ctx context.Context, param *models.CommonSystemParams) (interface{}, error)
- func (s *Driver) AggregateDocOfProjectBytes(ctx context.Context, param *models.CommonSystemParams) ([]byte, error)
- func (d *Driver) BuildFieldClassification(_fields []*models.FieldInfo) *FieldClassification
- func (s *Driver) CheckOneToOneRelationExists(ctx context.Context, param *models.ConnectDisconnectParam) (bool, error)
- func (d *Driver) CheckProjectExists(ctx context.Context, projectId string) (bool, error)
- func (a *Driver) CheckTableOrCollectionExists(ctx context.Context, param *models.CommonSystemParams) (bool, error)
- func (d *Driver) ConnectBuilder(ctx context.Context, root *models.CommonSystemParams) error
- func (s *Driver) ConvertModel(ctx context.Context, project *models.Project, modelName string) error
- func (d *Driver) CountDocOfProject(ctx context.Context, param *models.CommonSystemParams) (interface{}, error)
- func (d *Driver) CountDocOfProjectBytes(ctx context.Context, param *models.CommonSystemParams) ([]byte, error)
- func (d *Driver) CountMedias(ctx context.Context, projectId string, param *graphql.ResolveParams) (int, error)
- func (f *Driver) CountMultiDocumentOfProject(ctx context.Context, param *models.CommonSystemParams, previewMode bool) (int, error)
- func (d *Driver) CountProjectAuthUsersByRole(ctx context.Context, tenantID string) (map[string]int, error)
- func (s *Driver) CreateIndex(ctx context.Context, param *models.CommonSystemParams, fieldName string, ...) error
- func (d *Driver) CreateMediaDocument(ctx context.Context, projectId string, media *models.FileDetails) (*models.FileDetails, error)
- func (d *Driver) CreateModelTable(ctx context.Context, model *models.ModelType, ifNotExists bool) error
- func (d *Driver) CreateProjectAuthUser(ctx context.Context, user *models.ProjectAuthUser) (*models.ProjectAuthUser, error)
- func (d *Driver) CreateProjectFile(ctx context.Context, file *models.ProjectFile) (*models.ProjectFile, error)
- func (s *Driver) CreateRelation(ctx context.Context, projectId string, relation *models.EdgeRelation) error
- func (d *Driver) CreateTableOrCollection(ctx context.Context, param *models.CommonSystemParams, indexes []string) error
- func (d *Driver) DeleteDocumentFromProject(ctx context.Context, param *models.CommonSystemParams) error
- func (s *Driver) DeleteDocumentRelation(ctx context.Context, param *models.CommonSystemParams) error
- func (s *Driver) DeleteDocumentsFromProject(ctx context.Context, param *models.CommonSystemParams) error
- func (s *Driver) DeleteMediaFile(ctx context.Context, param models.CommonSystemParams) error
- func (d *Driver) DeleteProject(ctx context.Context, projectId string) error
- func (d *Driver) DeleteProjectAuthUser(ctx context.Context, userID string) error
- func (d *Driver) DeleteProjectBase(ctx context.Context, param *models.CommonSystemParams) error
- func (d *Driver) DeleteProjectFiles(ctx context.Context, ids []string) error
- func (s *Driver) DeleteRelation(ctx context.Context, param *models.ConnectDisconnectParam, id string) error
- func (d *Driver) DeleteRelationDocuments(ctx context.Context, projectId string, from *models.ConnectionType, ...) error
- func (s *Driver) DeleteRelationDocuments_AUTOGEN(ctx context.Context, projectId string, from *models.ConnectionType, ...) error
- func (d *Driver) DisconnectBuilder(ctx context.Context, param *models.CommonSystemParams) error
- func (d *Driver) DropField(ctx context.Context, param *models.CommonSystemParams) error
- func (s *Driver) DropIndex(ctx context.Context, param *models.CommonSystemParams, indexName string) error
- func (s *Driver) DropModel(ctx context.Context, project *models.Project, modelName string) error
- func (s *Driver) DuplicateModel(ctx context.Context, project *models.Project, modelName, newName string) (*models.ProjectSchema, error)
- func (d *Driver) EnsureFilesTable(ctx context.Context) error
- func (d *Driver) EnsureMetaFilesTables(ctx context.Context) error
- func (d *Driver) EnsureMetaMediaTables(ctx context.Context) error
- func (d *Driver) EnsureModelUserFieldColumns(ctx context.Context, model *models.ModelType) error
- func (d *Driver) EnsureRelationArtifactsFromSchema(ctx context.Context, modelsList []*models.ModelType) error
- func (d *Driver) EnsureSchemaOptimizationsV1(ctx context.Context) error
- func (d *Driver) EnsureUsersTable(ctx context.Context) error
- func (d *Driver) GetAllRelationDocumentsOfSingleDocument(ctx context.Context, from string, arg *models.CommonSystemParams) (interface{}, error)
- func (s *Driver) GetAllRelationDocumentsOfSingleDocument_AUTOGEN(ctx context.Context, from string, arg *models.CommonSystemParams) (interface{}, error)
- func (s *Driver) GetLoggedInProjectUser(ctx context.Context, param *models.CommonSystemParams) (*types.DefaultDocumentStructure, error)
- func (d *Driver) GetProjectAuthUser(ctx context.Context, userID string) (*models.ProjectAuthUser, error)
- func (d *Driver) GetProjectAuthUserByUsername(ctx context.Context, username string) (*models.ProjectAuthUser, error)
- func (d *Driver) GetProjectFile(ctx context.Context, fileID string) (*models.ProjectFile, error)
- func (s *Driver) GetProjectUser(ctx context.Context, phone, email, projectId string) (*types.DefaultDocumentStructure, error)
- func (s *Driver) GetProjectUsers(ctx context.Context, projectId string, keys []string) (map[string]*types.DefaultDocumentStructure, error)
- func (s *Driver) GetRelationDocument(ctx context.Context, param *models.ConnectDisconnectParam) (*models.EdgeRelation, error)
- func (s *Driver) GetRelationIds(ctx context.Context, param *models.ConnectDisconnectParam) ([]string, error)
- func (d *Driver) GetSingleProjectDocument(ctx context.Context, param *models.CommonSystemParams) (*types.DefaultDocumentStructure, error)
- func (d *Driver) GetSingleProjectDocumentBytes(ctx context.Context, param *models.CommonSystemParams) ([]byte, error)
- func (s *Driver) GetSingleProjectDocumentRevisions(ctx context.Context, param *models.CommonSystemParams) ([]*models.DocumentRevisionHistory, error)
- func (d *Driver) GetSingleRawDocumentFromProject(ctx context.Context, param *models.CommonSystemParams) (interface{}, error)
- func (d *Driver) InitProjectBase(ctx context.Context, param *models.CommonSystemParams, indexes []string) error
- func (d *Driver) IsRemoteSQLiteLikeTurso() bool
- func (d *Driver) ListMedias(ctx context.Context, projectId string, param *graphql.ResolveParams) ([]*models.FileDetails, error)
- func (d *Driver) ListProjectAuthUsersByEmail(ctx context.Context, tenantID, email string) ([]*models.ProjectAuthUser, error)
- func (d *Driver) ListProjectAuthUsersByGoogleSub(ctx context.Context, tenantID, googleSub string) ([]*models.ProjectAuthUser, error)
- func (d *Driver) ListProjectAuthUsersByPhone(ctx context.Context, tenantID, phone string) ([]*models.ProjectAuthUser, error)
- func (s *Driver) NewInsertableRelations(ctx context.Context, param *models.ConnectDisconnectParam) ([]string, error)
- func (d *Driver) QueryMultiDocumentOfProject(ctx context.Context, param *models.CommonSystemParams) ([]*types.DefaultDocumentStructure, error)
- func (d *Driver) QueryMultiDocumentOfProjectBytes(ctx context.Context, param *models.CommonSystemParams) ([]byte, error)
- func (d *Driver) RelationshipDataLoader(ctx context.Context, param *models.CommonSystemParams, ...) (interface{}, error)
- func (d *Driver) RelationshipDataLoaderBytes(ctx context.Context, param *models.CommonSystemParams, ...) ([]byte, error)
- func (d *Driver) RemoveATeamMemberFromProject(ctx context.Context, projectId string, memberId string) error
- func (a *Driver) RemoveAuthAddOns(ctx context.Context, project *models.Project, option map[string]interface{}) error
- func (s *Driver) RenameField(ctx context.Context, oldFieldName string, parentField string, ...) error
- func (s *Driver) RenameModel(ctx context.Context, project *models.Project, modelName, newName string) error
- func (d *Driver) SQLDriverShell() *sqlcommon.Driver
- func (d *Driver) SQLEngineName() string
- func (d *Driver) SearchProjectAuthUsers(ctx context.Context, tenantID string, limit, offset int) ([]*models.ProjectAuthUser, int, error)
- func (d *Driver) SearchProjectFiles(ctx context.Context, param *models.CommonSystemParams) (*models.SearchResponse[models.ProjectFile], error)
- func (d *Driver) SumProjectFilesSize(ctx context.Context) (int64, error)
- func (d *Driver) TransferProject(ctx context.Context, userId, from, to string) error
- func (d *Driver) UpdateDocumentOfProject(ctx context.Context, param *models.CommonSystemParams, ...) error
- func (d *Driver) UpdateProjectAuthUser(ctx context.Context, user *models.ProjectAuthUser) error
- type FieldClassification
- type Meta2
- type QueryBuilderParam
Constants ¶
This section is empty.
Variables ¶
var ApplySQLiteConnectionPragmas = sqlcommon.ApplySQLiteConnectionPragmas
ApplySQLiteConnectionPragmas re-exported for pro/libsql callers.
var BuildPostgresDSN = sqlcommon.BuildPostgresDSN
BuildPostgresDSN re-export for cross-engine callers.
var FilterSuffix = map[string]string{
"eq": "==",
"ne": "!=",
"lt": "<",
"lte": "<=",
"gt": ">",
"gte": ">=",
"in": "IN",
"not_in": "NOT IN",
}
var QuoteMySQLIdent = sqlcommon.QuoteMySQLIdent
QuoteMySQLIdent re-export for DDL helpers.
var QuotePGIdent = sqlcommon.QuotePGIdent
QuotePGIdent re-export for DDL helpers.
Functions ¶
func AlterTableAddFieldSQL ¶
AlterTableAddFieldSQL returns DDL statements to add physical column(s) for one FieldInfo (locals expand to multiple columns). Engine must match DriverCredentials.Engine (e.g. postgresql, sqlite, libsql, mysql).
func ApplyLitestreamConnectionPragmas ¶
ApplyLitestreamConnectionPragmas configures SQLite for embedded Litestream local files.
func ApplyTursoSyncConnectionPragmas ¶
ApplyTursoSyncConnectionPragmas is deprecated; use ApplyLitestreamConnectionPragmas.
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 PhysicalSQLColumnForSystemRelationField ¶
PhysicalSQLColumnForSystemRelationField maps GraphQL/schema synthetic relation keys (system_<model>_id or system_<model>_as_<known>_id) to physical FK column names created by AddRelationFields. Pass modelType when available so legacy collapsed ids (e.g. system_foodcategory_id vs system_food_category_id) resolve to the same SQL column.
func PreflightSQLiteRelationParentTablesForAddRelation ¶
func PreflightSQLiteRelationParentTablesForAddRelation(ctx context.Context, db bun.IDB, engine string, from, to *models.ConnectionType) error
PreflightSQLiteRelationParentTablesForAddRelation fails fast when SQLite would later report "foreign key mismatch" because referenced parent lacks PRIMARY KEY involvement for `id`.
func RootResolverMediaQueryBuilder ¶
func RootResolverMediaQueryBuilder(param *graphql.ResolveParams) (string, error)
func RunAnalyzeAfterIndexDDL ¶
func SelectBuilder ¶
func StripArangoEnvelopeKeysForSQLInsert ¶
func StripArangoEnvelopeKeysForSQLInsert(data map[string]interface{}, param *models.CommonSystemParams)
StripArangoEnvelopeKeysForSQLInsert removes *DefaultDocumentStructure merge keys that SQL model DDL does not provision (PK is `id`; _key/_id are Arango compat; `type` mirrors the table when no field named type). Shared-DB SaaS only adds a physical tenant_id column (see prosql.ApplyModelPhysicalDDL); tenant_model is document metadata for drivers that store it in JSON/ext, not a SQL column.
Types ¶
type Driver ¶
Driver is the SQLite project SQL driver.
func (*Driver) AddATeamMemberToProject ¶
func (*Driver) AddAuthAddOns ¶
func (*Driver) AddDocumentToProject ¶
func (d *Driver) AddDocumentToProject(ctx context.Context, param *models.CommonSystemParams, doc *types.DefaultDocumentStructure) (interface{}, error)
func (*Driver) AddFieldToModel ¶
func (*Driver) AddRelationFields ¶
func (d *Driver) AddRelationFields(ctx context.Context, from *models.ConnectionType, to *models.ConnectionType) error
func (*Driver) AddRelationFields_AUTOGEN ¶
func (s *Driver) 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 (*Driver) AddTeamMetaInfo ¶
func (s *Driver) AddTeamMetaInfo(ctx context.Context, docs []*models.SystemUser) ([]*models.SystemUser, error)
AddTeamMetaInfo adds metadata information for a team in the project.
func (*Driver) AggregateDocOfProject ¶
func (s *Driver) AggregateDocOfProject(ctx context.Context, param *models.CommonSystemParams) (interface{}, error)
AggregateDocOfProject aggregates the documents in the project. Uses the same SQL shape as CountDocOfProject (RootResolverQueryBuilder with returnCount=true) so filters, tenant QueryFilterHook, and role-based predicates match list/count behavior.
func (*Driver) AggregateDocOfProjectBytes ¶
func (s *Driver) AggregateDocOfProjectBytes(ctx context.Context, param *models.CommonSystemParams) ([]byte, error)
AggregateDocOfProjectBytes aggregates the documents in the project and returns it as bytes.
func (*Driver) BuildFieldClassification ¶
func (d *Driver) BuildFieldClassification(_fields []*models.FieldInfo) *FieldClassification
func (*Driver) CheckOneToOneRelationExists ¶
func (s *Driver) CheckOneToOneRelationExists(ctx context.Context, param *models.ConnectDisconnectParam) (bool, error)
CheckOneToOneRelationExists checks if a one-to-one relation exists in the project.
func (*Driver) CheckProjectExists ¶
func (*Driver) CheckTableOrCollectionExists ¶
func (*Driver) ConnectBuilder ¶
func (*Driver) ConvertModel ¶
ConvertModel converts a model in the project.
func (*Driver) CountDocOfProject ¶
func (*Driver) CountDocOfProjectBytes ¶
func (*Driver) CountMedias ¶
func (*Driver) CountMultiDocumentOfProject ¶
func (*Driver) CountProjectAuthUsersByRole ¶
func (*Driver) CreateIndex ¶
func (s *Driver) CreateIndex(ctx context.Context, param *models.CommonSystemParams, fieldName string, parent_field string) error
CreateIndex creates an index for a model in the project.
func (*Driver) CreateMediaDocument ¶
func (d *Driver) CreateMediaDocument(ctx context.Context, projectId string, media *models.FileDetails) (*models.FileDetails, error)
func (*Driver) CreateModelTable ¶
func (d *Driver) CreateModelTable(ctx context.Context, model *models.ModelType, ifNotExists bool) error
CreateModelTable creates a model table with only an id primary key column. Use ifNotExists to guard against duplicate table errors during provisioning.
func (*Driver) CreateProjectAuthUser ¶
func (d *Driver) CreateProjectAuthUser(ctx context.Context, user *models.ProjectAuthUser) (*models.ProjectAuthUser, error)
func (*Driver) CreateProjectFile ¶
func (d *Driver) CreateProjectFile(ctx context.Context, file *models.ProjectFile) (*models.ProjectFile, error)
func (*Driver) CreateRelation ¶
func (s *Driver) CreateRelation(ctx context.Context, projectId string, relation *models.EdgeRelation) error
CreateRelation creates a relation in the project.
func (*Driver) CreateTableOrCollection ¶
func (d *Driver) CreateTableOrCollection(ctx context.Context, param *models.CommonSystemParams, indexes []string) error
CreateTableOrCollection creates the physical table for param.Model only. Project bootstrap (database + meta + media) is handled by InitProjectBase.
func (*Driver) DeleteDocumentFromProject ¶
func (*Driver) DeleteDocumentRelation ¶
func (s *Driver) DeleteDocumentRelation(ctx context.Context, param *models.CommonSystemParams) error
DeleteDocumentRelation deletes all relations or data in pivot tables from the project.
func (*Driver) DeleteDocumentsFromProject ¶
func (s *Driver) DeleteDocumentsFromProject(ctx context.Context, param *models.CommonSystemParams) error
DeleteDocumentsFromProject deletes multiple documents from the project.
func (*Driver) DeleteMediaFile ¶
DeleteMediaFile deletes a media file from the project files table.
func (*Driver) DeleteProject ¶
DeleteProject removes project storage: dedicated database for PostgreSQL / MySQL, or core tables for SQLite.
func (*Driver) DeleteProjectAuthUser ¶
func (*Driver) DeleteProjectBase ¶
DeleteProjectBase drops meta and files in the current database (SQLite file-backed layout).
func (*Driver) DeleteProjectFiles ¶
func (*Driver) DeleteRelation ¶
func (s *Driver) DeleteRelation(ctx context.Context, param *models.ConnectDisconnectParam, id string) error
DeleteRelation deletes a relation in the project.
func (*Driver) DeleteRelationDocuments ¶
func (d *Driver) DeleteRelationDocuments(ctx context.Context, projectId string, from *models.ConnectionType, to *models.ConnectionType) error
func (*Driver) DeleteRelationDocuments_AUTOGEN ¶
func (s *Driver) 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 (*Driver) DisconnectBuilder ¶
func (*Driver) DropIndex ¶
func (s *Driver) DropIndex(ctx context.Context, param *models.CommonSystemParams, indexName string) error
DropIndex drops an index from a model in the project.
func (*Driver) DuplicateModel ¶
func (s *Driver) DuplicateModel(ctx context.Context, project *models.Project, modelName, newName string) (*models.ProjectSchema, error)
DuplicateModel duplicates a model in the project.
func (*Driver) EnsureMetaFilesTables ¶
EnsureMetaFilesTables creates meta and files tables when missing (idempotent).
func (*Driver) EnsureMetaMediaTables ¶
EnsureMetaMediaTables is deprecated; use EnsureMetaFilesTables.
func (*Driver) EnsureModelUserFieldColumns ¶
EnsureModelUserFieldColumns runs ALTER TABLE ADD for each top-level model.Fields entry so physical tables match schema (e.g. SaaS tenant catalogue name/logo after CreateModelTable created id-only table). Idempotent: duplicate column errors are ignored.
func (*Driver) EnsureRelationArtifactsFromSchema ¶
func (d *Driver) EnsureRelationArtifactsFromSchema(ctx context.Context, modelsList []*models.ModelType) error
EnsureRelationArtifactsFromSchema creates missing SQL artifacts for schema-declared relations (pivot tables, FK columns, constraints) via AddRelationFields. Idempotent where supported. Needed when projects were authored on Arango (edges only) or bootstrap only created model tables.
func (*Driver) EnsureSchemaOptimizationsV1 ¶
EnsureSchemaOptimizationsV1 applies idempotent secondary indexes and document_revisions bootstrap for project databases created before meta/media secondary indexes existed. Uses _apito_db_meta sentinel so work runs at most once per database.
func (*Driver) GetAllRelationDocumentsOfSingleDocument ¶
func (*Driver) GetAllRelationDocumentsOfSingleDocument_AUTOGEN ¶
func (s *Driver) GetAllRelationDocumentsOfSingleDocument_AUTOGEN(ctx context.Context, from string, arg *models.CommonSystemParams) (interface{}, error)
GetAllRelationDocumentsOfSingleDocument retrieves all relation data of a single document by ID.
func (*Driver) GetLoggedInProjectUser ¶
func (s *Driver) GetLoggedInProjectUser(ctx context.Context, param *models.CommonSystemParams) (*types.DefaultDocumentStructure, error)
GetLoggedInProjectUser retrieves the logged-in user profile for the project.
func (*Driver) GetProjectAuthUser ¶
func (*Driver) GetProjectAuthUserByUsername ¶
func (*Driver) GetProjectFile ¶
func (*Driver) GetProjectUser ¶
func (s *Driver) GetProjectUser(ctx context.Context, phone, email, projectId string) (*types.DefaultDocumentStructure, error)
GetProjectUser retrieves a user profile by phone, email, and project ID.
func (*Driver) GetProjectUsers ¶
func (s *Driver) GetProjectUsers(ctx context.Context, projectId string, keys []string) (map[string]*types.DefaultDocumentStructure, error)
GetProjectUsers retrieves metadata for multiple users in the project.
func (*Driver) GetRelationDocument ¶
func (s *Driver) GetRelationDocument(ctx context.Context, param *models.ConnectDisconnectParam) (*models.EdgeRelation, error)
GetRelationDocument retrieves a relation document by ID.
func (*Driver) GetRelationIds ¶
func (s *Driver) GetRelationIds(ctx context.Context, param *models.ConnectDisconnectParam) ([]string, error)
GetRelationIds retrieves the IDs of every document related to a document.
func (*Driver) GetSingleProjectDocument ¶
func (d *Driver) GetSingleProjectDocument(ctx context.Context, param *models.CommonSystemParams) (*types.DefaultDocumentStructure, error)
func (*Driver) GetSingleProjectDocumentBytes ¶
func (*Driver) GetSingleProjectDocumentRevisions ¶
func (s *Driver) GetSingleProjectDocumentRevisions(ctx context.Context, param *models.CommonSystemParams) ([]*models.DocumentRevisionHistory, error)
GetSingleProjectDocumentRevisions retrieves the revision history of a single project document by ID.
func (*Driver) GetSingleRawDocumentFromProject ¶
func (*Driver) InitProjectBase ¶
func (d *Driver) InitProjectBase(ctx context.Context, param *models.CommonSystemParams, indexes []string) error
InitProjectBase creates the per-project database (PostgreSQL / MySQL) when needed, reconnects, and ensures meta + files tables. For SQLite it only ensures meta + files in the current file.
func (*Driver) IsRemoteSQLiteLikeTurso ¶
func (*Driver) ListMedias ¶
func (d *Driver) ListMedias(ctx context.Context, projectId string, param *graphql.ResolveParams) ([]*models.FileDetails, error)
func (*Driver) ListProjectAuthUsersByEmail ¶
func (*Driver) ListProjectAuthUsersByGoogleSub ¶
func (*Driver) ListProjectAuthUsersByPhone ¶
func (*Driver) NewInsertableRelations ¶
func (s *Driver) NewInsertableRelations(ctx context.Context, param *models.ConnectDisconnectParam) ([]string, error)
NewInsertableRelations retrieves new insertable relations in the project.
func (*Driver) QueryMultiDocumentOfProject ¶
func (d *Driver) QueryMultiDocumentOfProject(ctx context.Context, param *models.CommonSystemParams) ([]*types.DefaultDocumentStructure, error)
func (*Driver) QueryMultiDocumentOfProjectBytes ¶
func (*Driver) RelationshipDataLoader ¶
func (*Driver) RelationshipDataLoaderBytes ¶
func (*Driver) RemoveATeamMemberFromProject ¶
func (*Driver) RemoveAuthAddOns ¶
func (*Driver) RenameField ¶
func (s *Driver) RenameField(ctx context.Context, oldFieldName string, parentField string, param *models.CommonSystemParams) error
RenameField renames a field in a model along with its data key.
func (*Driver) RenameModel ¶
func (s *Driver) RenameModel(ctx context.Context, project *models.Project, modelName, newName string) error
RenameModel renames a model in the project.
func (*Driver) SQLDriverShell ¶
func (*Driver) SQLEngineName ¶
func (*Driver) SearchProjectAuthUsers ¶
func (*Driver) SearchProjectFiles ¶
func (d *Driver) SearchProjectFiles(ctx context.Context, param *models.CommonSystemParams) (*models.SearchResponse[models.ProjectFile], error)
func (*Driver) SumProjectFilesSize ¶
func (*Driver) TransferProject ¶
func (*Driver) UpdateDocumentOfProject ¶
func (d *Driver) UpdateDocumentOfProject(ctx context.Context, param *models.CommonSystemParams, doc *types.DefaultDocumentStructure, replace bool) error
func (*Driver) UpdateProjectAuthUser ¶
type FieldClassification ¶
type FieldClassification struct {
MultilineFields []string
PictureField []string
GalleryField []string
ListFields []string
RepeatedFields map[string][]*models.FieldInfo
ObjectField []string
BooleanFields []string // this is needed because in turso and sqlite boolean is stored as integer
DateFields []string
}
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"`
}
Source Files
¶
- bootstrap_open.go
- dataloader.go
- dialect.go
- driver_lock.go
- field_column_ddl.go
- files_ddl.go
- init.go
- missing_methods.go
- model_ddl.go
- mutation.go
- project_auth_users.go
- project_bootstrap.go
- project_files.go
- query.go
- query_builder.go
- query_filter_hook.go
- relation_ensure.go
- relation_preflight.go
- schema_optimization_migrate.go
- sqlite_optimizations.go
- sqlite_rebuild_drop_column.go
- sqlite_rowcount.go
- system_relation_sql_column.go