dalgostore

package
v0.37.0 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2026 License: MIT Imports: 7 Imported by: 0

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

Constants

This section is empty.

Variables

View Source
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

func (s *ProjectStore) DeleteEnvDbCatalog(context.Context, string, string, string) error

DeleteEnvDbCatalog is not implemented; see the package doc comment.

func (*ProjectStore) DeleteEnvDbServer

func (s *ProjectStore) DeleteEnvDbServer(context.Context, string, string) error

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

LoadBoard is not implemented; see the package doc comment.

func (*ProjectStore) LoadBoards

LoadBoards is not implemented; see the package doc comment.

func (*ProjectStore) LoadEntities

LoadEntities is not implemented; see the package doc comment.

func (*ProjectStore) LoadEntity

LoadEntity is not implemented; see the package doc comment.

func (*ProjectStore) LoadEnvDbCatalog

LoadEnvDbCatalog is not implemented; see the package doc comment.

func (*ProjectStore) LoadEnvDbCatalogs

LoadEnvDbCatalogs is not implemented; see the package doc comment.

func (*ProjectStore) LoadEnvDbServer

LoadEnvDbServer is not implemented; see the package doc comment.

func (*ProjectStore) LoadEnvDbServers

LoadEnvDbServers is not implemented; see the package doc comment.

func (*ProjectStore) LoadEnvironment

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

LoadEnvironments is not implemented; see the package doc comment.

func (*ProjectStore) LoadFolder

LoadFolder is not implemented; see the package doc comment.

func (*ProjectStore) LoadFolders

LoadFolders is not implemented; see the package doc comment.

func (*ProjectStore) LoadProjDbDriver

LoadProjDbDriver is not implemented; see the package doc comment.

func (*ProjectStore) LoadProjDbDrivers

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

LoadQueries is not implemented; see the package doc comment.

func (*ProjectStore) LoadQuery

LoadQuery is not implemented; see the package doc comment.

func (*ProjectStore) LoadRecordsetData

func (s *ProjectStore) LoadRecordsetData(context.Context, string) (datatug.Recordset, error)

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) SaveBoard

func (s *ProjectStore) SaveBoard(context.Context, *datatug.Board) error

SaveBoard is not implemented; see the package doc comment.

func (*ProjectStore) SaveEntity

func (s *ProjectStore) SaveEntity(context.Context, *datatug.Entity) error

SaveEntity is not implemented; see the package doc comment.

func (*ProjectStore) SaveEnvDbCatalog

SaveEnvDbCatalog is not implemented; see the package doc comment.

func (*ProjectStore) SaveEnvDbCatalogs

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

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

SaveProjDbDriver is not implemented; see the package doc comment.

func (*ProjectStore) SaveProject

func (s *ProjectStore) SaveProject(ctx context.Context, p *datatug.Project) error

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

SaveQuery is not implemented; see the package doc comment.

Jump to

Keyboard shortcuts

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