Documentation
¶
Overview ¶
Package dalgostore implements datatug.ProjectStore over a caller-supplied dal.DB (dalgo-project-store plan). It depends on the github.com/dal-go/dalgo and github.com/dal-go/record interfaces only: no DALgo driver (dalgo2ingitdb, dalgo2ingitdb4github, dalgo2openvaultdb) is imported here, and no code in this package branches on which concrete driver backs db (REQ:project-store-is-a-dalgo-database). The driver is selected at the edge — whichever code constructs the dal.DB this package is handed (a later task in the plan).
Every DataTug record lives under the extension namespace ext/datatug/ (REQ:extension-namespace): a project's key path is ext/datatug/projects/<project-id>, and every project item nests below it (REQ:hierarchy-is-a-key-path).
Only the project record itself is implemented so far: LoadProjectFile, LoadProject and SaveProject read and write the record at that key path. Every other project-item collection (queries, boards, folders, entities, environments, env db servers/catalogs, project db drivers/servers, recordset definitions) is a stub that returns ErrNotImplemented; later tasks in the dalgo-project-store plan implement them one collection at a time. SaveProject and LoadProject also return ErrNotImplemented — writing or loading nothing — rather than silently dropping or omitting a collection they do not yet persist or load; see their doc comments.
Index ¶
- Variables
- type ProjectStore
- func (s *ProjectStore) DbServersStore(dbDriver string) datatug.ProjDbServersStore
- func (s *ProjectStore) DeleteBoard(context.Context, string) error
- func (s *ProjectStore) DeleteEntity(context.Context, string) error
- func (s *ProjectStore) DeleteEnvDbCatalog(context.Context, string, string, string) error
- func (s *ProjectStore) DeleteEnvDbServer(context.Context, string, string) error
- func (s *ProjectStore) DeleteEnvironment(context.Context, string) error
- func (s *ProjectStore) DeleteFolder(context.Context, string) error
- func (s *ProjectStore) DeleteProjDbDriver(context.Context, string) error
- func (s *ProjectStore) DeleteQuery(context.Context, string) error
- func (s *ProjectStore) LoadBoard(context.Context, string, ...datatug.StoreOption) (*datatug.Board, error)
- func (s *ProjectStore) LoadBoards(context.Context, ...datatug.StoreOption) (datatug.Boards, error)
- func (s *ProjectStore) LoadEntities(context.Context, ...datatug.StoreOption) (datatug.Entities, error)
- func (s *ProjectStore) LoadEntity(context.Context, string, ...datatug.StoreOption) (*datatug.Entity, error)
- func (s *ProjectStore) LoadEnvDbCatalog(context.Context, string, string, string, ...datatug.StoreOption) (datatug.DbCatalog, error)
- func (s *ProjectStore) LoadEnvDbCatalogs(context.Context, string, ...datatug.StoreOption) (datatug.DbCatalogs, error)
- func (s *ProjectStore) LoadEnvDbServer(context.Context, string, string, ...datatug.StoreOption) (*datatug.EnvDbServer, error)
- func (s *ProjectStore) LoadEnvDbServers(context.Context, string, ...datatug.StoreOption) (datatug.EnvDbServers, error)
- func (s *ProjectStore) LoadEnvironment(context.Context, string, ...datatug.StoreOption) (*datatug.Environment, error)
- func (s *ProjectStore) LoadEnvironmentSummary(context.Context, string) (*datatug.EnvironmentSummary, error)
- func (s *ProjectStore) LoadEnvironments(context.Context, ...datatug.StoreOption) (datatug.Environments, error)
- func (s *ProjectStore) LoadFolder(context.Context, string, ...datatug.StoreOption) (*datatug.Folder, error)
- func (s *ProjectStore) LoadFolders(context.Context, ...datatug.StoreOption) (datatug.Folders, error)
- func (s *ProjectStore) LoadProjDbDriver(context.Context, string, ...datatug.StoreOption) (*datatug.ProjDbDriver, error)
- func (s *ProjectStore) LoadProjDbDrivers(context.Context, ...datatug.StoreOption) (datatug.ProjDbDrivers, error)
- func (s *ProjectStore) LoadProject(ctx context.Context, o ...datatug.StoreOption) (*datatug.Project, error)
- func (s *ProjectStore) LoadProjectFile(ctx context.Context) (datatug.ProjectFile, error)
- func (s *ProjectStore) LoadQueries(context.Context, string, ...datatug.StoreOption) (*datatug.QueriesFolder, error)
- func (s *ProjectStore) LoadQuery(context.Context, string, ...datatug.StoreOption) (*datatug.QueryDef, error)
- func (s *ProjectStore) LoadRecordsetData(context.Context, string) (datatug.Recordset, error)
- func (s *ProjectStore) LoadRecordsetDefinition(context.Context, string, ...datatug.StoreOption) (*datatug.RecordsetDefinition, error)
- func (s *ProjectStore) LoadRecordsetDefinitions(context.Context, ...datatug.StoreOption) ([]*datatug.RecordsetDefinition, error)
- func (s *ProjectStore) ProjectID() string
- func (s *ProjectStore) SaveBoard(context.Context, *datatug.Board) error
- func (s *ProjectStore) SaveEntity(context.Context, *datatug.Entity) error
- func (s *ProjectStore) SaveEnvDbCatalog(context.Context, string, string, string, *datatug.DbCatalog) error
- func (s *ProjectStore) SaveEnvDbCatalogs(context.Context, string, string, string, datatug.DbCatalogs) error
- func (s *ProjectStore) SaveEnvDbServer(context.Context, string, *datatug.EnvDbServer) error
- func (s *ProjectStore) SaveEnvServers(context.Context, string, datatug.EnvDbServers) error
- func (s *ProjectStore) SaveEnvironment(context.Context, *datatug.Environment) error
- func (s *ProjectStore) SaveEnvironments(context.Context, datatug.Environments) error
- func (s *ProjectStore) SaveFolder(context.Context, string, *datatug.Folder) error
- func (s *ProjectStore) SaveFolders(context.Context, string, datatug.Folders) error
- func (s *ProjectStore) SaveProjDbDriver(context.Context, *datatug.ProjDbDriver, ...datatug.StoreOption) error
- func (s *ProjectStore) SaveProject(ctx context.Context, p *datatug.Project) error
- func (s *ProjectStore) SaveQuery(context.Context, *datatug.QueryDefWithFolderPath) error
Constants ¶
This section is empty.
Variables ¶
var ErrNotImplemented = errors.New("dalgostore: not implemented")
ErrNotImplemented is returned by every ProjectStore member this package does not implement yet, and by SaveProject/LoadProject when the caller asks for more than the project record (see the package doc comment).
Functions ¶
This section is empty.
Types ¶
type ProjectStore ¶
type ProjectStore struct {
// contains filtered or unexported fields
}
ProjectStore is a datatug.ProjectStore backed by a dal.DB the caller constructs and hands in.
func NewProjectStore ¶
func NewProjectStore(db dal.DB, projectID string) *ProjectStore
NewProjectStore returns a ProjectStore for projectID backed by db. db is constructed by the caller — the edge (CLI or backend) — never by this package, so no driver is named here. Like filestore's own constructor (newFsProjectStore, pkg/storage/filestore/project_store.go:10-26), NewProjectStore assigns its arguments without validating them.
func (*ProjectStore) DbServersStore ¶
func (s *ProjectStore) DbServersStore(dbDriver string) datatug.ProjDbServersStore
DbServersStore returns a stub ProjDbServersStore for dbDriver; every member of it is not implemented (see the package doc comment).
func (*ProjectStore) DeleteBoard ¶
func (s *ProjectStore) DeleteBoard(context.Context, string) error
DeleteBoard is not implemented; see the package doc comment.
func (*ProjectStore) DeleteEntity ¶
func (s *ProjectStore) DeleteEntity(context.Context, string) error
DeleteEntity is not implemented; see the package doc comment.
func (*ProjectStore) DeleteEnvDbCatalog ¶
DeleteEnvDbCatalog is not implemented; see the package doc comment.
func (*ProjectStore) DeleteEnvDbServer ¶
DeleteEnvDbServer is not implemented; see the package doc comment.
func (*ProjectStore) DeleteEnvironment ¶
func (s *ProjectStore) DeleteEnvironment(context.Context, string) error
DeleteEnvironment is not implemented; see the package doc comment.
func (*ProjectStore) DeleteFolder ¶
func (s *ProjectStore) DeleteFolder(context.Context, string) error
DeleteFolder is not implemented; see the package doc comment.
func (*ProjectStore) DeleteProjDbDriver ¶
func (s *ProjectStore) DeleteProjDbDriver(context.Context, string) error
DeleteProjDbDriver is not implemented; see the package doc comment.
func (*ProjectStore) DeleteQuery ¶
func (s *ProjectStore) DeleteQuery(context.Context, string) error
DeleteQuery is not implemented; see the package doc comment.
func (*ProjectStore) LoadBoard ¶
func (s *ProjectStore) LoadBoard(context.Context, string, ...datatug.StoreOption) (*datatug.Board, error)
LoadBoard is not implemented; see the package doc comment.
func (*ProjectStore) LoadBoards ¶
func (s *ProjectStore) LoadBoards(context.Context, ...datatug.StoreOption) (datatug.Boards, error)
LoadBoards is not implemented; see the package doc comment.
func (*ProjectStore) LoadEntities ¶
func (s *ProjectStore) LoadEntities(context.Context, ...datatug.StoreOption) (datatug.Entities, error)
LoadEntities is not implemented; see the package doc comment.
func (*ProjectStore) LoadEntity ¶
func (s *ProjectStore) LoadEntity(context.Context, string, ...datatug.StoreOption) (*datatug.Entity, error)
LoadEntity is not implemented; see the package doc comment.
func (*ProjectStore) LoadEnvDbCatalog ¶
func (s *ProjectStore) LoadEnvDbCatalog(context.Context, string, string, string, ...datatug.StoreOption) (datatug.DbCatalog, error)
LoadEnvDbCatalog is not implemented; see the package doc comment.
func (*ProjectStore) LoadEnvDbCatalogs ¶
func (s *ProjectStore) LoadEnvDbCatalogs(context.Context, string, ...datatug.StoreOption) (datatug.DbCatalogs, error)
LoadEnvDbCatalogs is not implemented; see the package doc comment.
func (*ProjectStore) LoadEnvDbServer ¶
func (s *ProjectStore) LoadEnvDbServer(context.Context, string, string, ...datatug.StoreOption) (*datatug.EnvDbServer, error)
LoadEnvDbServer is not implemented; see the package doc comment.
func (*ProjectStore) LoadEnvDbServers ¶
func (s *ProjectStore) LoadEnvDbServers(context.Context, string, ...datatug.StoreOption) (datatug.EnvDbServers, error)
LoadEnvDbServers is not implemented; see the package doc comment.
func (*ProjectStore) LoadEnvironment ¶
func (s *ProjectStore) LoadEnvironment(context.Context, string, ...datatug.StoreOption) (*datatug.Environment, error)
LoadEnvironment is not implemented; see the package doc comment.
func (*ProjectStore) LoadEnvironmentSummary ¶
func (s *ProjectStore) LoadEnvironmentSummary(context.Context, string) (*datatug.EnvironmentSummary, error)
LoadEnvironmentSummary is not implemented; see the package doc comment.
func (*ProjectStore) LoadEnvironments ¶
func (s *ProjectStore) LoadEnvironments(context.Context, ...datatug.StoreOption) (datatug.Environments, error)
LoadEnvironments is not implemented; see the package doc comment.
func (*ProjectStore) LoadFolder ¶
func (s *ProjectStore) LoadFolder(context.Context, string, ...datatug.StoreOption) (*datatug.Folder, error)
LoadFolder is not implemented; see the package doc comment.
func (*ProjectStore) LoadFolders ¶
func (s *ProjectStore) LoadFolders(context.Context, ...datatug.StoreOption) (datatug.Folders, error)
LoadFolders is not implemented; see the package doc comment.
func (*ProjectStore) LoadProjDbDriver ¶
func (s *ProjectStore) LoadProjDbDriver(context.Context, string, ...datatug.StoreOption) (*datatug.ProjDbDriver, error)
LoadProjDbDriver is not implemented; see the package doc comment.
func (*ProjectStore) LoadProjDbDrivers ¶
func (s *ProjectStore) LoadProjDbDrivers(context.Context, ...datatug.StoreOption) (datatug.ProjDbDrivers, error)
LoadProjDbDrivers is not implemented; see the package doc comment.
func (*ProjectStore) LoadProject ¶
func (s *ProjectStore) LoadProject(ctx context.Context, o ...datatug.StoreOption) (*datatug.Project, error)
LoadProject reads the project record and returns a Project carrying it. Depth follows filestore's own convention (pkg/storage/filestore/store_loader.go:27): Depth()==0 — the default, when the caller passes no options — or a depth greater than 1 asks for the full project graph (sub-item collections included), which this package does not load yet. Rather than return a Project with those collections silently left empty, LoadProject returns ErrNotImplemented naming what it cannot load. Only an explicit datatug.Depth(1) — "just this record" — is served.
func (*ProjectStore) LoadProjectFile ¶
func (s *ProjectStore) LoadProjectFile(ctx context.Context) (datatug.ProjectFile, error)
LoadProjectFile reads the project record at ext/datatug/projects/<project-id>.
func (*ProjectStore) LoadQueries ¶
func (s *ProjectStore) LoadQueries(context.Context, string, ...datatug.StoreOption) (*datatug.QueriesFolder, error)
LoadQueries is not implemented; see the package doc comment.
func (*ProjectStore) LoadQuery ¶
func (s *ProjectStore) LoadQuery(context.Context, string, ...datatug.StoreOption) (*datatug.QueryDef, error)
LoadQuery is not implemented; see the package doc comment.
func (*ProjectStore) LoadRecordsetData ¶
LoadRecordsetData is not implemented; see the package doc comment.
func (*ProjectStore) LoadRecordsetDefinition ¶
func (s *ProjectStore) LoadRecordsetDefinition(context.Context, string, ...datatug.StoreOption) (*datatug.RecordsetDefinition, error)
LoadRecordsetDefinition is not implemented; see the package doc comment.
func (*ProjectStore) LoadRecordsetDefinitions ¶
func (s *ProjectStore) LoadRecordsetDefinitions(context.Context, ...datatug.StoreOption) ([]*datatug.RecordsetDefinition, error)
LoadRecordsetDefinitions is not implemented; see the package doc comment.
func (*ProjectStore) ProjectID ¶
func (s *ProjectStore) ProjectID() string
ProjectID returns the id of the project this store addresses.
func (*ProjectStore) SaveEntity ¶
SaveEntity is not implemented; see the package doc comment.
func (*ProjectStore) SaveEnvDbCatalog ¶
func (s *ProjectStore) SaveEnvDbCatalog(context.Context, string, string, string, *datatug.DbCatalog) error
SaveEnvDbCatalog is not implemented; see the package doc comment.
func (*ProjectStore) SaveEnvDbCatalogs ¶
func (s *ProjectStore) SaveEnvDbCatalogs(context.Context, string, string, string, datatug.DbCatalogs) error
SaveEnvDbCatalogs is not implemented; see the package doc comment.
func (*ProjectStore) SaveEnvDbServer ¶
func (s *ProjectStore) SaveEnvDbServer(context.Context, string, *datatug.EnvDbServer) error
SaveEnvDbServer is not implemented; see the package doc comment.
func (*ProjectStore) SaveEnvServers ¶
func (s *ProjectStore) SaveEnvServers(context.Context, string, datatug.EnvDbServers) error
SaveEnvServers is not implemented; see the package doc comment.
func (*ProjectStore) SaveEnvironment ¶
func (s *ProjectStore) SaveEnvironment(context.Context, *datatug.Environment) error
SaveEnvironment is not implemented; see the package doc comment.
func (*ProjectStore) SaveEnvironments ¶
func (s *ProjectStore) SaveEnvironments(context.Context, datatug.Environments) error
SaveEnvironments is not implemented; see the package doc comment.
func (*ProjectStore) SaveFolder ¶
SaveFolder is not implemented; see the package doc comment.
func (*ProjectStore) SaveFolders ¶
SaveFolders is not implemented; see the package doc comment.
func (*ProjectStore) SaveProjDbDriver ¶
func (s *ProjectStore) SaveProjDbDriver(context.Context, *datatug.ProjDbDriver, ...datatug.StoreOption) error
SaveProjDbDriver is not implemented; see the package doc comment.
func (*ProjectStore) SaveProject ¶
SaveProject writes the project record at ext/datatug/projects/<project-id>, matching filestore's own SaveProject semantics for the part this package implements:
- the whole project is validated first, exactly as filestore does (pkg/storage/filestore/store_project_saver.go:23, project.Validate());
- the fields persisted are exactly the ones filestore's saveProjectFile builds — ID, Access, Repository and Created, no more (pkg/storage/filestore/store_project_saver.go:133-143); Title, Folder, tags and UserIDs are not carried into the project record there either, so this store does not carry them either;
- the assembled ProjectFile is validated again before being written, exactly as filestore's putProjectFile does (pkg/storage/filestore/store_project_saver.go:113-115).
Before any of that, SaveProject refuses a project whose ID does not match this store's own project ID with a typed validation.ErrBadFieldValue, and a project carrying data in a collection this package does not persist yet (queries, boards, entities, environments, db models or db drivers) with a wrapped ErrNotImplemented naming the collection — so nothing is silently dropped and nothing is written. Sub-item persistence is later work (see the package doc comment).
func (*ProjectStore) SaveQuery ¶
func (s *ProjectStore) SaveQuery(context.Context, *datatug.QueryDefWithFolderPath) error
SaveQuery is not implemented; see the package doc comment.