Documentation
¶
Overview ¶
Package datatug holds the DataTug project model: entities, queries, environments, boards and their validation rules. It is a pure model+engine library with no HTTP surface and no concrete DB drivers.
Query text sidecar file naming ¶
A QueryDef with non-empty Text is persisted as two files under the queries folder, both derived from QueryDef.ID and storage.QueryFileSuffix ("query"):
- "<id>.query.json" - the QueryDef itself (Text stripped), always written.
- "<id>.query.<ext>" - the query body, written only when Text is non-empty, where <ext> is strings.ToLower(string(QueryDef.Type)).
A TugQL query has one persisted type, "TugQL", and two body representations told apart by the body file's name alone (never by sniffing the content): TugQL text in "<id>.query.tugql", or - when QueryDef.StructuredBody is set - the structured YAML document produced by DALgo's tugql package in "<id>.query.tugql.yaml". Having both files for one query is an error. Projects written before the TugQL cutover are still read by the file store's legacy block (removed in TugQL cutover step 9); a save always writes the new forms.
Index ¶
- Constants
- Variables
- func ApplyProjectMeaningChange(d ProjectMeaningsDocument, c ProjectMeaningsCatalog, w ProjectMeaningWrite) (ProjectMeaningsDocument, ProjectMeaningAck, error)
- func CompareEnvironmentIDs(a, b string) (int, error)
- func EmbeddedCredentialReason(value string) (reason string, found bool)
- func GeProjectItemByID[T IProjectItem](items ProjectItems[T], id string) (t T)
- func HTTPMethodAllowsBody(method string) bool
- func HTTPTemplateHasPlaceholders(t HTTPRequestTemplate) bool
- func IsContextVariableName(name string) bool
- func IsCredentialHTTPHeader(name string) bool
- func IsHTTPToken(s string) bool
- func IsIncompleteQueryRecord(err error) bool
- func IsInvalidQueryLocation(err error) bool
- func IsKnownCollectionType(v CollectionType) bool
- func IsKnownQueryType(queryType QueryType) bool
- func IsQueryRevisionConflict(err error) bool
- func IsValidateStoreType(v string) bool
- func NewCreatedAt(at time.Time) string
- func ProjectDoesNotExist(err error) bool
- func ProjectUsageRevision(objects []ProjectObjectUsage) (string, error)
- func QueryCreationTime(ctx context.Context) time.Time
- func QueryMeaningDocumentID(queryID, documentID string) string
- func RenderHTTPParameterValue(paramType string, v any) (string, bool)
- func ResolveEnvironmentOrder(ids, saved []string) (order []string, needsRepair bool, err error)
- func StampCardCreatedAt(card, existing *Card, now time.Time)
- func ValidConnectionID(id string) bool
- func ValidateEnvironmentPermutation(ids, order []string) error
- func ValidateFolderPath(folderPath string) error
- func ValidateHTTPParameterDefs(params Parameters) error
- func ValidateName(name string) error
- func ValidateOptionalCreatedAt(createdAt string) error
- func ValidateProjectMeaningReferences(model *QuerySemanticModel, d ProjectMeaningsDocument, scope MeaningScope) error
- func ValidateTitle(title string) error
- func WithQueryCreationTime(ctx context.Context, at time.Time) context.Context
- type Action
- type Actions
- type ApiEndpoint
- type ApiService
- type Board
- type BoardCard
- type BoardCardRef
- type BoardCards
- type BoardRow
- type BoardRows
- type BoardWidget
- type Boards
- type BoardsStore
- type Card
- type CardBrief
- type CardBriefParameter
- type CardMatchRule
- type CardParameterDef
- type Cards
- type CardsStore
- type CatalogObject
- type CatalogObjectWithRefs
- type CatalogObjects
- type CatalogObjectsWithRefs
- type ChangeType
- type Changeset
- type ChangesetDef
- type ChangesetRefToDataset
- type CharacterSet
- type ChartSeries
- type ChartSourceBinding
- type ChartSourceTransform
- type ChartSpec
- type ChartWidgetDef
- type Check
- type Checks
- type Collation
- type CollectionInfo
- type CollectionType
- type ColumnDiff
- type ColumnInfo
- type ColumnModel
- type ColumnModels
- type ColumnsDiff
- type ConnectionPlan
- type ConnectionResolutionError
- type Constraint
- type ContextVariableNotBoundError
- type Credentials
- type DBCollectionKey
- type DataModelCatalogBinding
- type DataModelReference
- type DatabaseDifferences
- type DatasetDef
- type DatasetRefToRecordset
- type DbCatalog
- type DbCatalogBase
- type DbCatalogCounts
- type DbCatalogSummary
- type DbCatalogs
- type DbCatalogsStore
- type DbColumnProps
- type DbModel
- type DbModelDbCatalog
- type DbModelDbCatalogs
- type DbModelEnv
- type DbModelEnvironments
- type DbModels
- type DbModelsStore
- type DbSchema
- type DbSchemas
- type DbSchemasStore
- type DiffDbRef
- type EditionConnection
- type Entities
- type EntitiesStore
- type Entity
- type EntityField
- type EntityFieldRef
- type EntityFields
- type EnvDb
- type EnvDbCatalogStore
- type EnvDbDifference
- type EnvDbServer
- type EnvDbServers
- type EnvDbServersStore
- type EnvState
- type Environment
- type EnvironmentConnectionResolver
- type EnvironmentFile
- type EnvironmentSummary
- type Environments
- type EnvironmentsStore
- type FieldsWidgetDef
- type FieldsWidgetField
- type FieldsWidgetSource
- type Folder
- type FolderBrief
- type FolderItem
- type Folders
- type FoldersStore
- type ForeignKey
- type ForeignKeys
- type GuardedBoardCreator
- type GuardedQueryFolderDirectories
- type HTTPHeaderItem
- type HTTPHeaders
- type HTTPPlaceholder
- type HTTPPosition
- type HTTPRequest
- type HTTPRequestTemplate
- type HTTPTemplateError
- type HTTPTemplateErrorCode
- type HTTPWidgetDef
- type HeatmapChartSpec
- type HideRecordsetColIf
- type HitAndMiss
- type IProjectItem
- type IProjectItems
- type IncompleteQueryRecordError
- type Index
- type IndexColumn
- type Indexes
- type InvalidQueryLocationError
- type Issues
- type ListOfTags
- type MeaningBoardSource
- type MeaningEntity
- type MeaningField
- type MeaningIdentity
- type MeaningOperationReceipt
- type MeaningQuerySource
- type MeaningReference
- type MeaningResource
- type MeaningScope
- type OptionsValueCheck
- type Parameter
- type ParameterDef
- type ParameterLookup
- type ParameterRowsSource
- type Parameters
- type PhysicalRef
- type PhysicalRefs
- type PresentationFilter
- type ProjBoardBrief
- type ProjDbDriver
- type ProjDbDrivers
- type ProjDbDriversStore
- type ProjDbModelBrief
- type ProjDbModelNumbers
- type ProjDbServer
- type ProjDbServerFile
- type ProjDbServerSummary
- type ProjDbServers
- type ProjDbServersStore
- type ProjEntityBrief
- type ProjEnvBrief
- type ProjEnvNumbers
- type ProjItemBrief
- type Project
- func (p *Project) AddProjDbServer(ctx context.Context, dbServer *ProjDbServer) (err error)
- func (p *Project) GetDBs(ctx context.Context, o ...StoreOption) (dbs ProjDbDrivers, err error)
- func (p *Project) GetEnvironments(ctx context.Context) (environments Environments, err error)
- func (p *Project) GetProjDbServer(ctx context.Context, serverRef ServerRef) (server *ProjDbServer, err error)
- func (p *Project) UnmarshalJSON(body []byte) error
- func (p *Project) Validate() error
- type ProjectBrief
- type ProjectCardBrief
- type ProjectConnections
- func ParseProjectConnectionDirectoryJSON(name string, body []byte) (ProjectConnections, bool, error)
- func ParseProjectConnectionsJSON(body []byte) (ProjectConnections, error)
- func ParsePublicProjectConnectionDirectoryJSON(name string, body []byte) (ProjectConnections, bool, error)
- func ParsePublicProjectConnectionsJSON(body []byte) (ProjectConnections, error)
- type ProjectConnectionsReader
- type ProjectCreated
- type ProjectDataModelReference
- type ProjectDataModels
- func (d ProjectDataModels) MarshalJSON() ([]byte, error)
- func (d *ProjectDataModels) ReferenceByID(id string) (DataModelReference, error)
- func (d *ProjectDataModels) ReferenceForCatalog(environment, catalog string) (DataModelReference, error)
- func (d *ProjectDataModels) UnmarshalJSON(body []byte) error
- func (d *ProjectDataModels) Validate() error
- type ProjectDatabase
- type ProjectDatabases
- type ProjectDefinitionDependency
- func ProjectBoardDependencies(board Board) ([]ProjectDefinitionDependency, error)
- func ProjectCardDependencies(card Card) ([]ProjectDefinitionDependency, error)
- func ProjectEntityDependencies(entity Entity) ([]ProjectDefinitionDependency, error)
- func ProjectQueryDependencies(query QueryDefWithFolderPath) ([]ProjectDefinitionDependency, error)
- type ProjectFile
- type ProjectItem
- type ProjectItems
- type ProjectLifecycleAck
- type ProjectLifecycleBlocker
- type ProjectLifecycleCatalog
- type ProjectLifecycleChange
- type ProjectLifecyclePlan
- type ProjectLifecycleReview
- type ProjectLifecycleScope
- type ProjectLifecycleStore
- type ProjectLifecycleWrite
- type ProjectLoader
- type ProjectLogCollection
- type ProjectLogIdentifier
- type ProjectLogRecord
- type ProjectLogSource
- type ProjectLogSources
- type ProjectLogWindow
- type ProjectMeaningAck
- type ProjectMeaningAction
- type ProjectMeaningWrite
- type ProjectMeaningsCatalog
- type ProjectMeaningsDocument
- type ProjectObjectRef
- type ProjectObjectUsage
- type ProjectRepository
- type ProjectStore
- type ProjectSummary
- type ProjectUsageItem
- type ProjectUsageSnapshot
- type ProjectVisibility
- type ProjectsStore
- type PropertyDiff
- type PublicOVDBDatabase
- type QueriesFolder
- type QueriesStore
- type QueryCapture
- type QueryCaptureBinding
- type QueryComparison
- type QueryComparisonProjection
- type QueryDef
- func (v QueryDef) ContextVariablesUsed() []string
- func (v QueryDef) HTTPTemplate() HTTPRequestTemplate
- func (v QueryDef) RefuseContextVariables() error
- func (v *QueryDef) UnmarshalJSON(data []byte) error
- func (v *QueryDef) UnmarshalYAML(node *yaml.Node) error
- func (v QueryDef) Validate() error
- func (v QueryDef) ValidateCreationMetadata() error
- type QueryDefBrief
- type QueryDefTarget
- type QueryDefWithFolderPath
- type QueryDefs
- type QueryExpectedServerIdentity
- type QueryFederation
- type QueryFederationTable
- type QueryFolderBrief
- type QueryFolderDirectories
- type QueryFolders
- type QueryHTTPLookup
- type QueryHTTPRequest
- type QueryIngitdbSource
- type QueryLookupField
- type QueryMeaning
- type QueryMeaningBinding
- type QueryMeaningConcept
- type QueryMeaningLabels
- type QueryMeaningModels
- type QueryModelField
- type QueryModelModule
- type QueryModelRecord
- type QueryModelRecords
- type QueryModelSpec
- type QueryRelationshipBinding
- type QueryRelationshipBindings
- type QueryRelationshipEndpoint
- type QueryRelationshipFieldPair
- type QueryResult
- type QueryRevision
- type QueryRevisionConflictError
- type QuerySemanticBasis
- type QuerySemanticBinding
- type QuerySemanticColumn
- type QuerySemanticModel
- type QueryType
- type QueryWriteCondition
- type ReadmeEncoder
- type Recordset
- type RecordsetBaseDef
- type RecordsetColumn
- type RecordsetColumnDef
- type RecordsetColumnDefs
- type RecordsetDefinition
- type RecordsetDefinitions
- type RecordsetDefinitionsStore
- type RefByForeignKey
- type ReferencedBy
- type ReferencedBys
- type RegexpValueCheck
- type RepoRootFile
- type RevisionedQueriesStore
- type SQLCheck
- type SQLRowLink
- type SQLRowLinkParameter
- type SQLWidgetDef
- type SQLWidgetSettings
- type Schema
- type SchemaDiff
- type SchemaModels
- type SchemasDiff
- type ServerRef
- type ServerReferences
- type StateByEnv
- type StatusReporter
- type Step
- type StoreBrief
- type StoreOption
- type StoreOptions
- type StoredQuery
- type StringPattern
- type StringPatterns
- type TabWidget
- type TableColumns
- type TableDiff
- type TableForeignKeys
- type TableIndexes
- type TableKeys
- type TableModel
- type TableModels
- type TableProps
- type Tables
- type TablesDiff
- type TabsWidgetDef
- type TextWidgetDef
- type TimelineChartSpec
- type TimingChartSpec
- type UniqueKey
- type UniqueKeys
- type User
- type UserDatatugInfo
- type ValueRegexCheck
- type VarInfo
- type VarSetting
- type Variables
- type VarsByID
- type WatchCoordination
- type WidgetBase
- type WidgetParameterBinding
- type WidgetParameterBindings
Constants ¶
const ( // CardDisplayPanel shows a matched card in the side panel (the default). CardDisplayPanel = "panel" // CardDisplayTooltip shows a matched card as a compact popover. CardDisplayTooltip = "tooltip" )
Card display modes.
const ( QueryCaptureOriginSelection = "selection" QueryCaptureOriginContext = "context" QueryCaptureOriginManual = "manual" )
Origins a captured parameter binding may record. A captured query stores how each parameter was bound while the user explored, not the bound value: default values are never captured (a captured value would put a possibly protected record identifier into git-tracked project files), so there is no "default" origin here. Every origin is client-reported; the server never attests it.
const ( // ContextVariableSneatUserID is the Firebase Auth uid of the signed-in user. ContextVariableSneatUserID = "SneatUserID" // ContextVariableSneatUserPersonalSpaceID is the key of the signed-in // user's personal Sneat space. ContextVariableSneatUserPersonalSpaceID = "SneatUserPersonalSpaceID" )
Context variables are values DataTug supplies from the signed-in user's session, never typed by the user (backstage spec/features/my-data-project, REQ context-variables). A query uses one as "{name}" in a FROM/JOIN path or as "@name" in a value position without declaring it.
const ( // MaxQueryHTTPBodyBytes bounds a saved HTTP query body. MaxQueryHTTPBodyBytes = 256 * 1024 // MaxQueryHTTPHeaders bounds the saved headers of an HTTP query. MaxQueryHTTPHeaders = 50 )
const ( MaxHTTPTemplateURLBytes = 64 * 1024 MaxHTTPTemplateHeaderBytes = 64 * 1024 )
Size caps of a substituted request: the body shares the saved-body limit, and the URL and each header value are capped so a large value repeated by many placeholders cannot exhaust memory.
const ( // TypeString = "string" TypeString = "string" // TypeText = "text" TypeText = "text" // TypeJSON = "JSON" TypeJSON = "JSON" // TypeBit = "bit" TypeBit = "bit" // TypeBoolean = "boolean" TypeBoolean = "boolean" // TypeNumber = "number" TypeNumber = "number" // TypeInteger = "integer" TypeInteger = "integer" // TypeDecimal = "decimal" TypeDecimal = "decimal" // TypeFloat = "float" TypeFloat = "float" // TypeMoney = "money" TypeMoney = "money" // TypeDate = "date" TypeDate = "date" // TypeDateTime = "datetime" TypeDateTime = "datetime" // TypeTime = "time" TypeTime = "time" // TypeGUID = "GUID" TypeGUID = "GUID" // TypeUUID = "UUID" TypeUUID = "UUID" // TypeBinary = "binary" TypeBinary = "binary" // TypeImage = "image" TypeImage = "image" )
const ConnectionCatalogFormat = "datatug-demo-connections/v1"
ConnectionCatalogFormat is the supported project connection manifest format. A project may keep several such manifests under connections/*.json.
const FoldersPathSeparator = `/`
FoldersPathSeparator defines a character to be used in folders path
const MaxCardDescriptionLength = 1000
MaxCardDescriptionLength bounds Card.Description.
const MaxCardMatchRules = 64
MaxCardMatchRules bounds the match rules of one card parameter, as the TypeScript validator does.
const MaxPublicConnectionCatalogBytes = 256 << 10
MaxPublicConnectionCatalogBytes bounds the native public metadata wire reader and every catalog authored for that reader. General private provider inventories may accept larger existing files; public authoring must not.
const MaxTagLength = 50
MaxTagLength defines maximum length of a tag = 100
const MaxTitleLength = 100
MaxTitleLength defines maximum length of a title = 100
const ProjectLogSourcesFile = "log-sources.json"
Log sources own a separate namespace in connections/log-sources.json. The contract is project-log-sources.md and Apps' parseLogSources; these descriptors name OVDB records and presentation roles, never EditionConnection IDs.
const ProjectLogSourcesFormat = "datatug-log-sources/v1"
RootSharedFolderName defines name for a root shared folder
const RootUserFolderPrefix = "user:"
Variables ¶
var ( ErrConnectionNotFound = errors.New("connection not found") ErrConnectionNotInEnvironment = errors.New("connection is not in environment") ErrConnectionNotReady = errors.New("connection is not ready") ErrAmbiguousConnection = errors.New("ambiguous connection catalog") ErrUnsupportedConnectionFile = errors.New("unsupported connection catalog") )
var CardIDPattern = regexp.MustCompile(`^[A-Za-z0-9_-]{1,128}$`)
CardIDPattern is the shape of a project card id. The id is also the name of the card's `cards/<id>/` folder, so it never contains a path separator.
var ErrContextVariableNotBound = errors.New("context variable is not bound")
ErrContextVariableNotBound is matched by the error QueryDef.RefuseContextVariables returns: only the DataTug web app binds context variables; DataTug Core and the CLI refuse to run a query that uses one.
var ErrIncompleteQueryRecord = errors.New("incomplete query record")
ErrIncompleteQueryRecord is the sentinel every IncompleteQueryRecordError wraps. A later HTTP adapter maps it to 400 (a malformed/incomplete resource state) rather than treating it as "not found."
var ErrInvalidQueryLocation = errors.New("invalid query location")
ErrInvalidQueryLocation is the sentinel every InvalidQueryLocationError wraps. A later HTTP adapter maps it to 400.
var ErrMeaningConflict = errors.New("meaning catalog revision conflict")
var ErrMeaningIncomplete = errors.New("meaning references are incomplete")
var ErrMeaningOperationConflict = errors.New("meaning operation ID conflict")
var ErrMeaningReadOnly = errors.New("meaning catalog is read-only")
var ErrMeaningReferenced = errors.New("meaning has inbound references")
var ErrProjectDoesNotExist = errors.New("project does not exist")
ErrProjectDoesNotExist is an error that indicates a project does not exist
var ErrProjectLifecycleConflict = errors.New("project definitions or references changed")
var ErrProjectLifecycleInvalid = errors.New("invalid project lifecycle operation")
var ErrProjectObjectReferenced = errors.New("project object has blocking references")
var ErrProjectUsageIncomplete = errors.New("project references could not be completely verified")
var ErrQueryRevisionConflict = errors.New("query revision conflict")
ErrQueryRevisionConflict is the sentinel every QueryRevisionConflictError wraps. A later HTTP adapter maps it to 409.
var ErrUnsupportedDataModels = errors.New("unsupported project dataModels metadata")
var HTTPParameterTypes = []string{"string", "integer", "number", "boolean", "bit", "date", "datetime"}
HTTPParameterTypes are the parameter types an HTTP query may declare.
var KnownTypes = []string{ TypeString, TypeText, TypeJSON, TypeBit, TypeBoolean, TypeNumber, TypeInteger, TypeDecimal, TypeFloat, TypeMoney, TypeDate, TypeDateTime, TypeTime, TypeGUID, TypeUUID, TypeBinary, TypeImage, }
KnownTypes enumerates list of known types
Functions ¶
func ApplyProjectMeaningChange ¶ added in v0.66.0
func ApplyProjectMeaningChange(d ProjectMeaningsDocument, c ProjectMeaningsCatalog, w ProjectMeaningWrite) (ProjectMeaningsDocument, ProjectMeaningAck, error)
Apply requires a freshly built catalog from the same locked snapshot as d. Provider persists next atomically, then rebuilds the returned catalog.
func CompareEnvironmentIDs ¶ added in v0.67.0
CompareEnvironmentIDs uses ASCII classification and Unicode scalar ordering.
func EmbeddedCredentialReason ¶ added in v0.28.0
EmbeddedCredentialReason reports why value appears to embed a secret - a password, token or key - in one of the syntaxes the package's credential-screening notes list (a URL or DSN userinfo, a secret key/value pair or JSON member, an HTTP credential header), or ("", false) when it does not. A username alone is never refused. It is the one screening function for anything that is persisted to git-tracked project files; QueryDefTarget.Validate and QueryDef.Validate use it, and so can any other caller that must keep secrets out of a project.
func GeProjectItemByID ¶ added in v0.16.0
func GeProjectItemByID[T IProjectItem](items ProjectItems[T], id string) (t T)
func HTTPMethodAllowsBody ¶ added in v0.73.0
HTTPMethodAllowsBody reports whether the method (empty = GET) may carry a body.
func HTTPTemplateHasPlaceholders ¶ added in v0.74.0
func HTTPTemplateHasPlaceholders(t HTTPRequestTemplate) bool
HTTPTemplateHasPlaceholders reports whether the template holds any {name} placeholder.
func IsContextVariableName ¶ added in v0.127.0
IsContextVariableName reports whether name is a reserved context variable name, which no query may declare as a parameter.
func IsCredentialHTTPHeader ¶ added in v0.73.0
IsCredentialHTTPHeader reports whether a header name carries credentials and so must never be saved with a query. Matching is case-insensitive.
func IsHTTPToken ¶ added in v0.73.0
IsHTTPToken reports whether s is a non-empty RFC 7230 token.
func IsIncompleteQueryRecord ¶ added in v0.28.0
IsIncompleteQueryRecord reports whether err is (or wraps) an IncompleteQueryRecordError.
func IsInvalidQueryLocation ¶ added in v0.28.0
IsInvalidQueryLocation reports whether err is (or wraps) an InvalidQueryLocationError.
func IsKnownCollectionType ¶ added in v0.14.0
func IsKnownCollectionType(v CollectionType) bool
func IsKnownQueryType ¶ added in v0.15.10
func IsQueryRevisionConflict ¶ added in v0.28.0
IsQueryRevisionConflict reports whether err is (or wraps) a QueryRevisionConflictError.
func IsValidateStoreType ¶
IsValidateStoreType checks if storage type has valid value
func NewCreatedAt ¶ added in v0.80.0
NewCreatedAt formats a creation date the way queries persist it: RFC3339 UTC with nanoseconds.
func ProjectDoesNotExist ¶
ProjectDoesNotExist reports if an error is a wrapper around ErrProjectDoesNotExist
func ProjectUsageRevision ¶ added in v0.125.0
func ProjectUsageRevision(objects []ProjectObjectUsage) (string, error)
ProjectUsageRevision binds content revisions, explicit references and archive state in stable order. It excludes actor identity: access is rechecked by the provider at both review and commit, independently of this content hash.
func QueryMeaningDocumentID ¶ added in v0.66.0
func RenderHTTPParameterValue ¶ added in v0.74.0
RenderHTTPParameterValue coerces a bound value to the parameter type and renders it as text (REQ:parameter-meta, REQ:type-coercion): string as is, integer in decimal, number in shortest decimal form without an exponent, boolean as true/false, bit as 0/1, date as YYYY-MM-DD and datetime as RFC 3339 UTC. ok is false when the value cannot be coerced.
func ResolveEnvironmentOrder ¶ added in v0.67.0
ResolveEnvironmentOrder retains each live ID once, appending defaults for missing IDs.
func StampCardCreatedAt ¶ added in v0.80.0
StampCardCreatedAt makes a card's creation date immutable across saves. A stored card's date always wins, so an overwrite or a backdated save cannot change it. Only when the stored card has no date (or there is none) does the caller's date apply, and when that is empty too the card is stamped with now. It mutates card.
func ValidConnectionID ¶ added in v0.45.0
func ValidateEnvironmentPermutation ¶ added in v0.67.0
ValidateEnvironmentPermutation rejects partial, duplicate, and unknown IDs.
func ValidateFolderPath ¶
ValidateFolderPath validates folder path
func ValidateHTTPParameterDefs ¶ added in v0.74.0
func ValidateHTTPParameterDefs(params Parameters) error
ValidateHTTPParameterDefs checks the declarations of an HTTP query's parameters on their own (REQ:declare-parameters, REQ:credentials-run-time-only).
func ValidateOptionalCreatedAt ¶ added in v0.80.0
ValidateOptionalCreatedAt validates the optional `createdAt` creation date of a project definition (card, check, scenario). Absent is valid; a present value must be an RFC3339 timestamp, the format queries persist.
func ValidateProjectMeaningReferences ¶ added in v0.66.0
func ValidateProjectMeaningReferences(model *QuerySemanticModel, d ProjectMeaningsDocument, scope MeaningScope) error
ValidateProjectMeaningReferences validates canonical targets before a query save. Call under the same transaction/lock used to change definitions.
Types ¶
type Action ¶
type Action struct {
ProjectItem
Type string `json:"type"`
Data interface{} `json:"data"`
Next Actions `json:"next"`
}
Action does something that affects context
type ApiEndpoint ¶
type ApiEndpoint struct {
ProjectItem
QueryType string `json:"queryType" firestore:"queryType"` // REST, RPC, GraphQL
Method string `json:"method" firestore:"method"`
UrlSchema string `json:"urlSchema" firestore:"urlSchema"`
UrlHost string `json:"urlHost" firestore:"urlHost"`
UrlPath string `json:"urlPath" firestore:"urlPath"`
FavoritesCount int `json:"favoritesCount" firestore:"favoritesCount"`
VotesScore int `json:"votesScore" firestore:"votesScore"`
VotesUp int `json:"votesUp" firestore:"votesUp"`
VotesDown int `json:"votesDown" firestore:"votesDown"`
}
func (ApiEndpoint) Validate ¶
func (v ApiEndpoint) Validate() error
type ApiService ¶
type ApiService struct {
ProjectItem
}
func (ApiService) Validate ¶
func (v ApiService) Validate() error
type Board ¶
type Board struct {
ProjectItem
// UpdatedAt is server storage metadata, excluded from canonical board content.
UpdatedAt *time.Time `json:"-" firestore:"-"`
// Parameters mirrors ProjBoardBrief.Parameters so the brief and the full board stay in step.
Parameters Parameters `json:"parameters,omitempty" firestore:"parameters,omitempty"`
// RequiredParams mirrors ProjBoardBrief.RequiredParams so the brief and the full board stay in step.
RequiredParams [][]string `json:"requiredParams,omitempty" firestore:"requiredParams,omitempty"`
Rows BoardRows `json:"rows,omitempty" firestore:"rows,omitempty"`
}
Board is holding all details about board
type BoardCard ¶
type BoardCard struct {
ID string `json:"id"`
Title string `json:"title"`
Cols int `json:"cols,omitempty"`
Widget *BoardWidget `json:"widget,omitempty"`
// Ref references a project card instead of holding an inline Widget.
// Exactly one of Widget or Ref is set.
Ref *BoardCardRef `json:"ref,omitempty"`
}
BoardCard describes board card
type BoardCardRef ¶ added in v0.72.0
type BoardCardRef struct {
CardID string `json:"cardId"`
Parameters WidgetParameterBindings `json:"parameters,omitempty"`
}
BoardCardRef is a dashboard cell's reference to a project card in place of an inline widget. It binds the card's parameters to board parameters or constants.
func (BoardCardRef) Validate ¶ added in v0.72.0
func (v BoardCardRef) Validate() error
Validate returns error if not valid.
type BoardCards ¶
type BoardCards []BoardCard
BoardCards is slice of BoardCard
func (BoardCards) Validate ¶
func (v BoardCards) Validate() error
Validate returns error if not valid
type BoardRow ¶
type BoardRow struct {
MinHeight string `json:"minHeight,omitempty"`
MaxHeight string `json:"maxHeight,omitempty"`
Cards BoardCards `json:"cards,omitempty"`
}
BoardRow holds all details about a row in a board
type BoardWidget ¶
type BoardWidget struct {
Name string `json:"name"`
Data interface{} `json:"data,omitempty"`
}
BoardWidget specifies widget. Some widgets can contain otter widgets.
func (BoardWidget) Validate ¶
func (v BoardWidget) Validate() (err error)
Validate returns error if failed
type BoardsStore ¶ added in v0.15.0
type Card ¶ added in v0.72.0
type Card struct {
ID string `json:"id"`
Title string `json:"title"`
Description string `json:"description,omitempty"`
Parameters []CardParameterDef `json:"parameters,omitempty"`
Widget *BoardWidget `json:"widget,omitempty"`
Display string `json:"display,omitempty"`
// CreatedAt is the optional RFC3339 creation date, kept across saves.
CreatedAt string `json:"createdAt,omitempty"`
}
Card is a standalone project card stored at `cards/<id>/card.json`: the shape of a dashboard BoardCard plus its own parameters and default display. A card never holds a ref, so cards cannot cycle.
func (*Card) UnmarshalJSON ¶ added in v0.72.0
UnmarshalJSON rejects unknown keys, so a card cannot carry a ref or any other field outside the contract. Numbers keep their exact text (json.Number), so a saved constant or default is never rounded.
type CardBrief ¶ added in v0.72.0
type CardBrief struct {
ID string `json:"id"`
Title string `json:"title"`
Description string `json:"description,omitempty"`
Parameters []CardBriefParameter `json:"parameters,omitempty"`
Display string `json:"display,omitempty"`
}
CardBrief is a row of `all_cards`, enough to match cells without loading every card.
type CardBriefParameter ¶ added in v0.72.0
type CardBriefParameter struct {
ID string `json:"id"`
Type string `json:"type"`
IsRequired bool `json:"isRequired,omitempty"`
Match []CardMatchRule `json:"match,omitempty"`
}
CardBriefParameter is the part of a card parameter that cell matching needs.
type CardMatchRule ¶ added in v0.72.0
type CardMatchRule struct {
Entity string `json:"entity,omitempty"`
Field string `json:"field,omitempty"`
Table string `json:"table,omitempty"`
Column string `json:"column,omitempty"`
}
CardMatchRule tells which grid cells feed a card parameter. Exactly one shape is valid: meaning-graph {entity, field}; {table, column}; or {column}.
type CardParameterDef ¶ added in v0.72.0
type CardParameterDef struct {
ParameterDef
Match []CardMatchRule `json:"match,omitempty"`
}
CardParameterDef is a card parameter: the existing parameter definition plus optional match rules.
func (CardParameterDef) Validate ¶ added in v0.72.0
func (v CardParameterDef) Validate() error
Validate returns error if not valid.
type Cards ¶ added in v0.72.0
type Cards []*Card
Cards is a list of project cards.
type CardsStore ¶ added in v0.72.0
type CardsStore interface {
LoadCards(ctx context.Context, o ...StoreOption) (Cards, error)
LoadCard(ctx context.Context, id string, o ...StoreOption) (*Card, error)
SaveCard(ctx context.Context, card *Card) error
DeleteCard(ctx context.Context, id string) error
}
CardsStore reads and writes standalone project cards (`cards/<id>/card.json`).
type CatalogObject ¶
type CatalogObject struct {
Type string `json:"type"`
Schema string `json:"schema"`
Name string `json:"name"`
DefaultAlias string `json:"defaultAlias,omitempty"`
}
CatalogObject used in list of objects
func (CatalogObject) Validate ¶
func (v CatalogObject) Validate() error
Validate returns error if not valid
type CatalogObjectWithRefs ¶
type CatalogObjectWithRefs struct {
CatalogObject
PrimaryKey *UniqueKey `json:"primaryKey,omitempty"`
ForeignKeys ForeignKeys `json:"foreignKeys,omitempty"`
ReferencedBy ReferencedBys `json:"referencedBy,omitempty"`
}
CatalogObjectWithRefs defines ref to catalog object
func (CatalogObjectWithRefs) Validate ¶
func (v CatalogObjectWithRefs) Validate() error
Validate returns error if not valid
type CatalogObjects ¶
type CatalogObjects []CatalogObject
CatalogObjects defines list of catalog objects
func (CatalogObjects) Validate ¶
func (v CatalogObjects) Validate() error
Validate returns error if not valid
type CatalogObjectsWithRefs ¶
type CatalogObjectsWithRefs []CatalogObjectWithRefs
CatalogObjectsWithRefs defines slice
func (CatalogObjectsWithRefs) Validate ¶
func (v CatalogObjectsWithRefs) Validate() error
Validate returns error if not valid
type ChangeType ¶
type ChangeType int
ChangeType defines what kind of change performed or to be performed
const ( ChangeTypeUnchanged ChangeType = iota ChangeTypeAdded ChangeTypeAltered ChangeTypeDeleted )
type Changeset ¶
type Changeset struct {
Status string `json:"status"`
Datasets []DatasetDef `json:"datasets"`
}
Changeset holds a set of data changes to be applied
type ChangesetDef ¶
type ChangesetDef struct {
ProjectItem
Datasets []ChangesetRefToDataset `json:"datasets"`
}
ChangesetDef defines a set of changes to be applied
type ChangesetRefToDataset ¶
ChangesetRefToDataset defines a reference to a dataset
type CharacterSet ¶
type CharacterSet struct {
Catalog string `json:"Catalog,omitempty"`
Schema string `json:"Schema,omitempty"`
Name string `json:"GetID"`
}
CharacterSet holds info about character set
func (CharacterSet) Validate ¶
func (v CharacterSet) Validate() error
Validate returns error if not valid
type ChartSeries ¶ added in v0.60.0
type ChartSeries struct {
ID string `json:"id"`
Title string `json:"title"`
ValueColumn string `json:"valueColumn"`
}
ChartSeries maps one numeric column of a single admitted query result.
func (ChartSeries) Validate ¶ added in v0.60.0
func (v ChartSeries) Validate() error
type ChartSourceBinding ¶ added in v0.58.0
type ChartSourceBinding struct {
ID string `json:"id"`
QueryID string `json:"queryId"`
Parameters WidgetParameterBindings `json:"parameters,omitempty"`
Transform *ChartSourceTransform `json:"transform,omitempty"`
}
ChartSourceBinding identifies an independently executed saved query. It never embeds a connection, query text, or a cached result.
func (ChartSourceBinding) Validate ¶ added in v0.58.0
func (v ChartSourceBinding) Validate() error
type ChartSourceTransform ¶ added in v0.58.0
type ChartSourceTransform struct {
Name string `json:"name"`
OrderIDColumn string `json:"orderIdColumn"`
DateColumn string `json:"dateColumn"`
CountryColumn string `json:"countryColumn"`
}
ChartSourceTransform names a reusable runtime operation on an admitted result. Its input column names are explicit so execution never depends on a query ID.
func (ChartSourceTransform) Validate ¶ added in v0.58.0
func (v ChartSourceTransform) Validate() error
type ChartSpec ¶ added in v0.58.0
type ChartSpec struct {
Timing *TimingChartSpec `json:"timing,omitempty"`
Timeline *TimelineChartSpec `json:"timeline,omitempty"`
Heatmap *HeatmapChartSpec `json:"heatmap,omitempty"`
Type string `json:"type"`
CategoryColumn string `json:"categoryColumn,omitempty"`
ValueColumn string `json:"valueColumn,omitempty"`
Series []ChartSeries `json:"series,omitempty"`
SelectionID string `json:"selectionId,omitempty"`
PeriodColumn string `json:"periodColumn,omitempty"`
Unit string `json:"unit,omitempty"`
Grain string `json:"grain,omitempty"`
OnDuplicate string `json:"onDuplicate,omitempty"`
Mode string `json:"mode,omitempty"`
TopN int `json:"topN,omitempty"`
}
ChartSpec maps columns in the admitted or transformed result to a chart. The monthly orders transform emits period/category/value rows.
func (*ChartSpec) UnmarshalJSON ¶ added in v0.60.0
The new branch needs to distinguish an absent legacy valueColumn from an explicit empty/null field; both otherwise decode to Go's zero string.
type ChartWidgetDef ¶ added in v0.58.0
type ChartWidgetDef struct {
WidgetBase
Sources []ChartSourceBinding `json:"sources"`
Chart ChartSpec `json:"chart"`
DefaultView string `json:"defaultView,omitempty"`
}
ChartWidgetDef stores presentation choices and saved-query references only. Results, execution receipts and access rights are resolved at view time.
func (ChartWidgetDef) Validate ¶ added in v0.58.0
func (v ChartWidgetDef) Validate() error
type Check ¶
type Check struct {
ID string `json:"id"` // This a random ID uniquely identifying a specific check instance
Title string `json:"title,omitempty"`
Type string `json:"type"`
Data json.RawMessage `json:"data,omitempty"`
// CreatedAt is the optional RFC3339 creation date. Core has no save path for
// checks: the writer (the CLI detective store) stamps it on create. Existing
// undated files stay undated on purpose.
CreatedAt string `json:"createdAt,omitempty"`
}
Check defines a check
type Collation ¶
type Collation struct {
Catalog string `json:"catalog,omitempty"`
Schema string `json:"schema,omitempty"`
Name string `json:"name"`
}
Collation holds info about collation
type CollectionInfo ¶
type CollectionInfo struct {
DBCollectionKey
RecordsetBaseDef
TableProps
DDL string `json:"ddl,omitempty"` // Data Definition Language
Columns TableColumns `json:"columns,omitempty"`
Indexes []*Index `json:"indexes,omitempty"`
ReferencedBy ReferencedBys `json:"referencedBy,omitempty"`
RecordsCount *int `json:"recordsCount,omitempty"`
}
CollectionInfo holds metadata about a collection or a table or a view
func (CollectionInfo) Validate ¶
func (v CollectionInfo) Validate() error
Validate returns error if not valid
type CollectionType ¶ added in v0.14.0
type CollectionType string
const ( CollectionTypeAny = "*" CollectionTypeUnknown CollectionType = "" CollectionTypeTable CollectionType = "table" CollectionTypeView CollectionType = "view" )
type ColumnInfo ¶
type ColumnInfo struct {
DbColumnProps
//ChangeType ChangeType `json:"-"` // Document what it is and why needed
//ByEnv map[string]ColumnInfo `json:"byEnv,omitempty"`
Constraints []string `json:"constraints,omitempty"`
}
ColumnInfo holds column metadata
func (ColumnInfo) Validate ¶
func (v ColumnInfo) Validate() error
Validate returns error if not valid
type ColumnModel ¶
type ColumnModel struct {
ColumnInfo
ByEnv StateByEnv `json:"byEnv,omitempty"`
Checks Checks `json:"checks,omitempty"`
}
ColumnModel defines a column as we expect it to be
func (*ColumnModel) Validate ¶
func (v *ColumnModel) Validate() error
Validate returns error if not valid
type ColumnModels ¶
type ColumnModels []*ColumnModel
ColumnModels is a slice of *ColumnModel
func (ColumnModels) Validate ¶
func (v ColumnModels) Validate() error
Validate returns error if not valid
type ConnectionPlan ¶ added in v0.45.0
ConnectionPlan reserves an ID for a proposed connection but cannot resolve to a usable source even if an environment mistakenly references it.
type ConnectionResolutionError ¶ added in v0.45.0
type ConnectionResolutionError struct {
Kind error
EnvironmentID string
ConnectionID string
Readiness string
}
ConnectionResolutionError carries only safe IDs and readiness metadata. Informational source URLs and any credentials are never included in errors.
func (*ConnectionResolutionError) Error ¶ added in v0.45.0
func (e *ConnectionResolutionError) Error() string
func (*ConnectionResolutionError) Unwrap ¶ added in v0.45.0
func (e *ConnectionResolutionError) Unwrap() error
type Constraint ¶
Constraint defines constraint
func (Constraint) Validate ¶
func (v Constraint) Validate() error
Validate returns error if not valid
type ContextVariableNotBoundError ¶ added in v0.127.0
type ContextVariableNotBoundError struct {
Names []string
}
ContextVariableNotBoundError names the context variables a query uses. It matches ErrContextVariableNotBound with errors.Is.
func (ContextVariableNotBoundError) Error ¶ added in v0.127.0
func (e ContextVariableNotBoundError) Error() string
func (ContextVariableNotBoundError) Is ¶ added in v0.127.0
func (e ContextVariableNotBoundError) Is(target error) bool
Is makes errors.Is(err, ErrContextVariableNotBound) hold.
type Credentials ¶
type Credentials struct {
Username string `json:"username,omitempty" yaml:"username,omitempty"`
Password string `json:"password,omitempty" yaml:"password,omitempty"`
}
Credentials holds username & password
func (Credentials) Validate ¶
func (v Credentials) Validate() error
Validate returns error if failed
type DBCollectionKey ¶ added in v0.14.2
type DBCollectionKey struct {
Ref dal.CollectionRef
// contains filtered or unexported fields
}
DBCollectionKey defines a key that identifies a table or a view
func NewCollectionKey ¶ added in v0.14.0
func NewCollectionKey(t CollectionType, name, schema, catalog string, parent *record.Key) DBCollectionKey
func NewTableKey ¶ added in v0.14.0
func NewTableKey(name, schema, catalog string, parent *record.Key) DBCollectionKey
func NewViewKey ¶ added in v0.14.0
func NewViewKey(name, schema, catalog string, parent *record.Key) DBCollectionKey
func (DBCollectionKey) Catalog ¶ added in v0.14.2
func (v DBCollectionKey) Catalog() string
func (DBCollectionKey) Name ¶ added in v0.14.2
func (v DBCollectionKey) Name() string
func (DBCollectionKey) Schema ¶ added in v0.14.2
func (v DBCollectionKey) Schema() string
func (DBCollectionKey) String ¶ added in v0.14.2
func (v DBCollectionKey) String() string
func (DBCollectionKey) Type ¶ added in v0.14.2
func (v DBCollectionKey) Type() CollectionType
func (DBCollectionKey) Validate ¶ added in v0.14.2
func (v DBCollectionKey) Validate() error
Validate returns error if not valid
type DataModelCatalogBinding ¶ added in v0.76.0
type DataModelReference ¶ added in v0.76.0
type DataModelReference struct {
Address string `json:"address" firestore:"address"`
Commit string `json:"commit" firestore:"commit"`
}
DataModelReference identifies one exact source revision. It performs no I/O.
func (DataModelReference) NormalizedAddress ¶ added in v0.76.0
func (r DataModelReference) NormalizedAddress() string
NormalizedAddress preserves the module spelling and normalizes GitHub owner/repository only.
func (DataModelReference) Validate ¶ added in v0.76.0
func (r DataModelReference) Validate() error
type DatabaseDifferences ¶
type DatabaseDifferences struct {
ID string `json:"id"`
SchemasDiff SchemasDiff `json:"schemasDiff"`
}
DatabaseDifferences holds DB diffs
type DatasetDef ¶
type DatasetDef struct {
Recordsets []RecordsetDefinition `json:"recordsets"`
}
DatasetDef is a set of recordsets
type DatasetRefToRecordset ¶
type DatasetRefToRecordset struct {
MinRecordsCount int `json:"minRecordsCount:omitempty"`
MaxRecordsCount int `json:"maxRecordsCount:omitempty"`
}
DatasetRefToRecordset is a reference from dataset to recordset definition and settings specific for the dataset
type DbCatalog ¶
type DbCatalog struct {
DbCatalogBase
Schemas DbSchemas `json:"schemas"`
}
DbCatalog hold info about DB database
type DbCatalogBase ¶
type DbCatalogBase struct {
ProjectItem
Driver string `json:"driver"`
Path string `json:"path,omitempty"` // for SQLite
DbModel string `json:"dbModel"`
}
DbCatalogBase defines base data for DB catalog
func (DbCatalogBase) Validate ¶
func (v DbCatalogBase) Validate() error
Validate returns error if not valid
type DbCatalogCounts ¶
type DbCatalogCounts struct {
Schemas int `json:"schemas"`
Tables int `json:"tables"`
Views int `json:"views"`
}
DbCatalogCounts hold numbers about DB
type DbCatalogSummary ¶
type DbCatalogSummary struct {
DbCatalogBase
Environments []string `json:"environments"`
NumberOf *DbCatalogCounts `json:"numberOf"`
}
DbCatalogSummary holds database summary
type DbCatalogs ¶
type DbCatalogs ProjectItems[*DbCatalog]
func (DbCatalogs) GetByID ¶ added in v0.16.0
func (v DbCatalogs) GetByID(id string) (t *DbCatalog)
func (DbCatalogs) GetTable ¶
func (v DbCatalogs) GetTable(catalog, schema, name string) *CollectionInfo
GetTable returns table
func (DbCatalogs) IDs ¶ added in v0.16.0
func (v DbCatalogs) IDs() []string
func (DbCatalogs) Validate ¶
func (v DbCatalogs) Validate() error
type DbCatalogsStore ¶ added in v0.16.0
type DbColumnProps ¶
type DbColumnProps struct {
Name string `json:"name"`
OrdinalPosition int `json:"ordinalPosition"`
PrimaryKeyPosition int `json:"pkPosition,omitempty"`
IsNullable bool `json:"isNullable"`
DbType string `json:"dbType"`
Default *string `json:"default,omitempty"`
CharMaxLength *int `json:"charMaxLength,omitempty"`
CharOctetLength *int `json:"charOctetLength,omitempty"`
DateTimePrecision *int `json:"dateTimePrecision,omitempty"`
CharacterSet *CharacterSet `json:"characterSet,omitempty"`
Collation *Collation `json:"collation,omitempty"`
}
DbColumnProps holds column metadata
func (DbColumnProps) Validate ¶
func (v DbColumnProps) Validate() error
Validate returns error if not valid
type DbModel ¶
type DbModel struct {
ProjectItem
Schemas SchemaModels `json:"schemas,omitempty"`
Environments DbModelEnvironments `json:"environments,omitempty"`
}
DbModel holds a model of a database
type DbModelDbCatalog ¶
type DbModelDbCatalog struct {
ID string `json:"id"`
}
DbModelDbCatalog holds DB model
func (DbModelDbCatalog) Validate ¶
func (v DbModelDbCatalog) Validate() error
Validate returns error if not valid
type DbModelDbCatalogs ¶
type DbModelDbCatalogs []*DbModelDbCatalog
DbModelDbCatalogs slice of *DbModelDbCatalog
func (DbModelDbCatalogs) GetByID ¶
func (v DbModelDbCatalogs) GetByID(id string) (dbModelDb *DbModelDbCatalog)
GetByID returns DbModelDbCatalog by GetID
func (DbModelDbCatalogs) Validate ¶
func (v DbModelDbCatalogs) Validate() error
Validate returns error if not valid
type DbModelEnv ¶
type DbModelEnv struct {
ID string `json:"id"` // environment ID
DbCatalogs DbModelDbCatalogs
}
DbModelEnv holds links from db model to environments
func (DbModelEnv) Validate ¶
func (v DbModelEnv) Validate() error
Validate returns error if not valid
type DbModelEnvironments ¶
type DbModelEnvironments []*DbModelEnv
DbModelEnvironments slice of *DbModelEnv
func (DbModelEnvironments) GetByID ¶
func (v DbModelEnvironments) GetByID(id string) *DbModelEnv
GetByID return *DbModelEnv by GetID
func (DbModelEnvironments) Validate ¶
func (v DbModelEnvironments) Validate() error
Validate returns error if not valid
type DbModelsStore ¶ added in v0.16.0
type DbModelsStore interface {
LoadDbModels(ctx context.Context, o ...StoreOption) (DbModels, error)
LoadDbModel(ctx context.Context, id string, o ...StoreOption) (*DbModel, error)
SaveDbModel(ctx context.Context, dbModel *DbModel) error
SaveDbModels(ctx context.Context, dbModels DbModels) error
DeleteDbModel(ctx context.Context, id string) error
}
type DbSchema ¶
type DbSchema struct {
ProjectItem
Tables []*CollectionInfo `json:"tables"`
Views []*CollectionInfo `json:"views"`
}
DbSchema represents a schema in a database
type DbSchemas ¶
type DbSchemas ProjectItems[*DbSchema]
DbSchemas is a slice of *DbSchema
type DbSchemasStore ¶ added in v0.16.0
type DiffDbRef ¶
type DiffDbRef struct {
Environment string `json:"env"`
Host string `json:"host"`
Port int `json:"port,omitempty"`
Catalog string `json:"catalog,omitempty"`
}
DiffDbRef is a link to DB
type EditionConnection ¶ added in v0.45.0
type EditionConnection struct {
ID string `json:"id"`
Dataset string `json:"dataset"`
Storage string `json:"storage"`
Tags []string `json:"tags,omitempty"`
Environments []string `json:"environments,omitempty"`
Readiness string `json:"readiness"`
Query string `json:"query,omitempty"`
SourceProjectID string `json:"sourceProjectId,omitempty"`
DatasetID string `json:"datasetId,omitempty"`
Location string `json:"location,omitempty"`
}
EditionConnection is a project-owned declaration, not a live DALgo source. Remote source/descriptor/manifest URLs in the on-disk v1 format are omitted intentionally: callers must supply an independently configured source binding.
func (EditionConnection) ReadyForBinding ¶ added in v0.45.0
func (c EditionConnection) ReadyForBinding() bool
ReadyForBinding says only whether the declaration is in a known actionable state. It does not say a local driver, credentials, or an execution project is configured; callers must establish those separately.
func (EditionConnection) Validate ¶ added in v0.45.0
func (c EditionConnection) Validate() error
type EntitiesStore ¶ added in v0.15.7
type Entity ¶
type Entity struct {
ProjectItem
//ProjEntityBrief
ListOfTags
Fields EntityFields `json:"fields,omitempty" firestore:"fields,omitempty"`
Tables TableKeys `json:"tables,omitempty" firestore:"tables,omitempty"`
// Display lists, in order, the IDs of this entity's own fields that let a
// person recognise a record - the columns a parameter lookup picker shows
// beside the key (backstage parameter-lookup REQ:display-columns).
Display []string `json:"display,omitempty" firestore:"display,omitempty"`
}
Entity hold full info about entity
type EntityField ¶
type EntityField struct {
ID string `json:"id" firestore:"id"`
Type string `json:"type" firestore:"type"`
Title string `json:"title,omitempty" firestore:"title,omitempty"`
IsKeyField bool `json:"isKeyField,omitempty" firestore:"isKeyField,omitempty"`
NamePatterns StringPatterns `json:"namePatterns" firestore:"namePattern"`
// Mappings holds declared physical columns this field maps to. Declared
// mappings are authoritative; when empty, a resolver may derive one from
// NamePatterns and must label it "inferred".
Mappings PhysicalRefs `json:"mappings,omitempty" firestore:"mappings,omitempty"`
}
EntityField hold info about entity field
func (EntityField) Validate ¶
func (v EntityField) Validate() error
Validate returns error if not valid
type EntityFieldRef ¶
EntityFieldRef holds reference to entity field
func (EntityFieldRef) Validate ¶
func (v EntityFieldRef) Validate() error
Validate returns error if not valid
type EntityFields ¶
type EntityFields []*EntityField
EntityFields is a slice of EntityField
func (EntityFields) Validate ¶
func (v EntityFields) Validate() error
Validate returns error if not valid
type EnvDb ¶
type EnvDb struct {
ProjectItem
DbModel string `json:"dbModel"`
Server ServerRef `json:"server"`
}
EnvDb hold info about DB in specific environment
type EnvDbCatalogStore ¶ added in v0.15.7
type EnvDbCatalogStore interface {
LoadEnvDbCatalogs(ctx context.Context, envID string, o ...StoreOption) (DbCatalogs, error)
LoadEnvDbCatalog(ctx context.Context, envID, serverID, catalogID string, o ...StoreOption) (DbCatalog, error)
SaveEnvDbCatalog(ctx context.Context, envID, serverID, catalogID string, catalogs *DbCatalog) error
SaveEnvDbCatalogs(ctx context.Context, envID, serverID, catalogID string, catalogs DbCatalogs) error
DeleteEnvDbCatalog(ctx context.Context, envID, serverID, catalogID string) error
}
type EnvDbDifference ¶
EnvDbDifference hold diffs for a DB in specific environment
type EnvDbServer ¶
EnvDbServer holds information about DB server in an environment
func (*EnvDbServer) GetID ¶ added in v0.15.7
func (v *EnvDbServer) GetID() string
GetID is "host:port" for a server recorded by its host, and the driver for one recorded without a host (a server whose connection URL stays in an environment variable), so that two such servers of different drivers in one environment have different IDs.
func (*EnvDbServer) SetID ¶ added in v0.15.7
func (v *EnvDbServer) SetID(id string)
SetID is the reverse of GetID: an ID without a colon is a driver, any other is "host:port" (a port that is not a number is 0).
func (*EnvDbServer) Validate ¶
func (v *EnvDbServer) Validate() error
Validate returns error if no valid
type EnvDbServers ¶
type EnvDbServers []*EnvDbServer
EnvDbServers is a slice of *EnvDbServer
func (EnvDbServers) GetByServerRef ¶
func (v EnvDbServers) GetByServerRef(serverRef ServerRef) *EnvDbServer
GetByServerRef returns *EnvDbServer by GetID
func (EnvDbServers) Validate ¶
func (v EnvDbServers) Validate() error
Validate returns error of failed
type EnvDbServersStore ¶ added in v0.15.7
type EnvDbServersStore interface {
LoadEnvDbServers(ctx context.Context, envID string, o ...StoreOption) (EnvDbServers, error)
LoadEnvDbServer(ctx context.Context, envID, serverID string, o ...StoreOption) (*EnvDbServer, error)
SaveEnvDbServer(ctx context.Context, envID string, server *EnvDbServer) error
SaveEnvServers(ctx context.Context, envID string, servers EnvDbServers) error
DeleteEnvDbServer(ctx context.Context, envID, serverID string) error
}
type EnvState ¶
type EnvState struct {
Status string `json:"status"` // Possible values: exists, missing
Differences []EnvDbDifference `json:"differences,omitempty"`
}
EnvState hold state of env
type Environment ¶
type Environment struct {
ProjectItem
DbServers EnvDbServers `json:"dbServers"`
EditionConnections []string `json:"editionConnections,omitempty"`
// contains filtered or unexported fields
}
Environment holds information about environment
func (Environment) MarshalJSON ¶ added in v0.60.2
func (v Environment) MarshalJSON() ([]byte, error)
MarshalJSON merges opaque metadata with the current typed JSON. Known fields were excluded from metadata at decode time, so clearing an omitempty field cannot resurrect its old value or an alternative spelling.
func (Environment) Summary ¶ added in v0.125.0
func (v Environment) Summary() (EnvironmentSummary, error)
Summary copies only the safe connection identifiers, never opaque environment JSON or connection credentials. The copy cannot mutate the loaded environment.
func (*Environment) UnmarshalJSON ¶ added in v0.60.2
func (v *Environment) UnmarshalJSON(data []byte) error
UnmarshalJSON retains unknown JSON metadata without assigning it meaning. Number tokens remain json.Number, so opaque integers never pass through float64. Distinct aliases of known fields are refused; opaque keys retain exact casing. Identical duplicate keys keep encoding/json's last-value rule.
func (Environment) Validate ¶
func (v Environment) Validate() error
Validate returns error if failed
type EnvironmentConnectionResolver ¶ added in v0.45.0
type EnvironmentConnectionResolver interface {
ResolveEnvironmentConnection(ctx context.Context, environmentID, connectionID string) (EditionConnection, error)
}
EnvironmentConnectionResolver is an optional ProjectStore capability. The resolver checks both the environment's editionConnections list and the declaration's environments list when one is present. Pending declarations return safe identity metadata with ErrConnectionNotReady; callers may use an independently validated explicit source binding. It never opens a DB.
type EnvironmentFile ¶
type EnvironmentFile struct {
ID string `json:"id"`
}
EnvironmentFile some file to be documented
func (EnvironmentFile) Validate ¶
func (v EnvironmentFile) Validate() error
Validate returns error if not valid
type EnvironmentSummary ¶
type EnvironmentSummary struct {
ProjectItem
Servers EnvDbServers `json:"dbServers,omitempty"`
EditionConnections []string `json:"editionConnections,omitempty"`
}
EnvironmentSummary holds environment summary
func (EnvironmentSummary) Validate ¶
func (v EnvironmentSummary) Validate() error
Validate returns error if not valid
type Environments ¶
type Environments ProjectItems[*Environment]
Environments is a slice of pointers to Environment
func (Environments) GetByID ¶ added in v0.16.0
func (v Environments) GetByID(id string) *Environment
func (Environments) IDs ¶ added in v0.16.0
func (v Environments) IDs() []string
func (Environments) Validate ¶
func (v Environments) Validate() error
Validate returns error if failed
type EnvironmentsStore ¶ added in v0.15.7
type EnvironmentsStore interface {
LoadEnvironments(ctx context.Context, o ...StoreOption) (Environments, error)
LoadEnvironment(ctx context.Context, id string, o ...StoreOption) (*Environment, error)
LoadEnvironmentSummary(ctx context.Context, id string) (*EnvironmentSummary, error)
SaveEnvironment(ctx context.Context, env *Environment) error
SaveEnvironments(ctx context.Context, envs Environments) error
DeleteEnvironment(ctx context.Context, id string) error
}
type FieldsWidgetDef ¶ added in v0.72.0
type FieldsWidgetDef struct {
WidgetBase
Source FieldsWidgetSource `json:"source"`
Fields []FieldsWidgetField `json:"fields,omitempty"`
}
FieldsWidgetDef is the `fields` widget: one record as label/value pairs.
func (*FieldsWidgetDef) Validate ¶ added in v0.72.0
func (v *FieldsWidgetDef) Validate() error
Validate returns error if not valid.
type FieldsWidgetField ¶ added in v0.72.0
type FieldsWidgetField struct {
Column string `json:"column"`
Label string `json:"label,omitempty"`
}
FieldsWidgetField selects one column to show, with an optional label.
type FieldsWidgetSource ¶ added in v0.72.0
type FieldsWidgetSource struct {
QueryID string `json:"queryId,omitempty"`
Parameters WidgetParameterBindings `json:"parameters,omitempty"`
Parameter string `json:"parameter,omitempty"`
}
FieldsWidgetSource tells where a fields widget takes its record from: exactly one of a saved query (first row) or a record parameter.
func (FieldsWidgetSource) Validate ¶ added in v0.72.0
func (v FieldsWidgetSource) Validate() error
Validate returns error if not valid.
type Folder ¶
type Folder struct {
Name string `json:"name,omitempty" firestore:"name,omitempty"` // empty for root folders
Note string `json:"note,omitempty" firestore:"note,omitempty"`
// NumberOf keeps count of all successor objects in all sub-folders
NumberOf map[string]int `json:"numberOf,omitempty" firestore:"numberOf,omitempty"`
}
Folder keeps info about folder
type FolderBrief ¶
type FolderBrief struct {
Title string `json:"title" firestore:"title"`
}
FolderBrief holds brief about a folder item
func (FolderBrief) Validate ¶
func (v FolderBrief) Validate() error
Validate returns error if not valid
type FolderItem ¶
type FolderItem struct {
ID string `json:"id" firestore:"id"`
Title string `json:"title" firestore:"title"`
}
FolderItem holds info about a folder item
func (FolderItem) Validate ¶
func (v FolderItem) Validate() error
Validate returns error if not valid
type FoldersStore ¶ added in v0.15.7
type FoldersStore interface {
LoadFolders(ctx context.Context, o ...StoreOption) (Folders, error)
LoadFolder(ctx context.Context, id string, o ...StoreOption) (*Folder, error)
SaveFolder(ctx context.Context, path string, folder *Folder) error
SaveFolders(ctx context.Context, path string, folders Folders) error
DeleteFolder(ctx context.Context, id string) error
}
type ForeignKey ¶
type ForeignKey struct {
Name string `json:"name"`
Columns []string `json:"columns"`
RefTable DBCollectionKey `json:"refTable"`
// RefColumns are the columns of RefTable the key points to, in the order
// of Columns and of the same count. A key read from a source that does
// not report them has none.
RefColumns []string `json:"refColumns,omitempty"`
MatchOption string `json:"matchOption,omitempty"` // Document what this?
UpdateRule string `json:"updateRule,omitempty"` // Document what this?
DeleteRule string `json:"deleteRule,omitempty"` // Document what this?
}
ForeignKey holds metadata about foreign key
func (ForeignKey) Validate ¶
func (v ForeignKey) Validate() error
Validate returns error if not valid
type ForeignKeys ¶
type ForeignKeys []*ForeignKey
ForeignKeys define list of foreighn keys
func (ForeignKeys) Validate ¶
func (v ForeignKeys) Validate() error
Validate returns error if not valid
type GuardedBoardCreator ¶ added in v0.126.0
type GuardedBoardCreator interface {
CreateBoardGuarded(ctx context.Context, board *Board, authorize func() error) error
}
GuardedBoardCreator is the optional owning create-only Board capability. Implementations validate the complete definition and refuse any existing target, including a target won by another process after an earlier read. authorize is called after provider preparation, immediately before atomic no-replace publication; serving callers must supply their current authority check. A nil callback is reserved for trusted in-process callers. An error after publication may leave the definition committed: this is not an idempotent operation or evidence that cancellation undid a durable write.
type GuardedQueryFolderDirectories ¶ added in v0.125.1
type GuardedQueryFolderDirectories interface {
QueryFolderDirectories
CreateQueryFolderGuarded(context.Context, string, string, func() error) error
}
GuardedQueryFolderDirectories lets request-serving callers recheck authority after the provider's locks, recovery and admission reads. authorize must run before acknowledging an existing declaration or writing the target directory, README or marker. A refusal leaves that target unchanged; prior transaction recovery remains the provider's responsibility.
type HTTPHeaderItem ¶
HTTPHeaderItem describes an HTTP header item
func (HTTPHeaderItem) Validate ¶
func (v HTTPHeaderItem) Validate() error
Validate returns error if not valid
type HTTPHeaders ¶
type HTTPHeaders []HTTPHeaderItem
HTTPHeaders is a []HTTPHeaderItem
func (HTTPHeaders) Validate ¶
func (v HTTPHeaders) Validate() error
Validate returns error if not valid
type HTTPPlaceholder ¶ added in v0.74.0
type HTTPPlaceholder struct {
Name string `json:"name"`
Position HTTPPosition `json:"position"`
// Header is the header name for a header-value placeholder.
Header string `json:"header,omitempty"`
// Credential is true for a placeholder in a credential header value
// (IsCredentialHTTPHeader).
Credential bool `json:"credential,omitempty"`
}
HTTPPlaceholder is one placeholder occurrence in a template.
type HTTPPosition ¶ added in v0.74.0
type HTTPPosition string
HTTPPosition names where a placeholder sits in an HTTP request template.
const ( HTTPPositionMethod HTTPPosition = "method" HTTPPositionScheme HTTPPosition = "scheme" HTTPPositionUserinfo HTTPPosition = "userinfo" HTTPPositionHost HTTPPosition = "host" HTTPPositionPath HTTPPosition = "path" HTTPPositionQueryName HTTPPosition = "query-name" HTTPPositionQuery HTTPPosition = "query" HTTPPositionFragment HTTPPosition = "fragment" HTTPPositionHeaderName HTTPPosition = "header-name" HTTPPositionHeader HTTPPosition = "header" HTTPPositionContentType HTTPPosition = "content-type" // HTTPPositionReservedHeader is the value of a header the transport owns // or that routes the request (Host, Content-Length, Forwarded, ...). HTTPPositionReservedHeader HTTPPosition = "reserved-header" HTTPPositionBody HTTPPosition = "body" HTTPPositionJSONString HTTPPosition = "json-string" HTTPPositionJSONValue HTTPPosition = "json-value" HTTPPositionJSONKey HTTPPosition = "json-key" HTTPPositionJSONOther HTTPPosition = "json-other" )
Positions of a placeholder. Only path, query, header, body, json-string and json-value are allowed; the others are reported by forbidden-position errors.
type HTTPRequest ¶
type HTTPRequest struct {
Method string `json:"method"`
URL string `json:"url"`
Protocol string `json:"protocol,omitempty"`
Headers HTTPHeaders `json:"headers,omitempty"`
TimeoutThresholdMs int `json:"timeoutThresholdMs,omitempty"` // in milliseconds
Parameters Parameters `json:"parameters,omitempty"`
Content string `json:"content,omitempty"`
}
HTTPRequest describes an HTTP request
func (HTTPRequest) Validate ¶
func (v HTTPRequest) Validate() error
Validate returns error if not valid
type HTTPRequestTemplate ¶ added in v0.74.0
type HTTPRequestTemplate struct {
Method string `json:"method,omitempty"`
URL string `json:"url"`
Headers []HTTPHeaderItem `json:"headers,omitempty"`
Body string `json:"body,omitempty"`
}
HTTPRequestTemplate is an HTTP request whose URL, header values and body may hold {name} placeholders.
func SubstituteHTTPRunParameters ¶ added in v0.74.0
func SubstituteHTTPRunParameters(t HTTPRequestTemplate, params []Parameter) (HTTPRequestTemplate, error)
SubstituteHTTPRunParameters is the server's template mode (REQ:server-template-endpoint): the run carries only {id, type, value} for each parameter, so every supplied parameter is required, a parameter used in a credential header is a credential, and the full template rules apply.
func (HTTPRequestTemplate) Placeholders ¶ added in v0.74.0
func (t HTTPRequestTemplate) Placeholders() ([]HTTPPlaceholder, error)
Placeholders lists every placeholder of the template in order: URL, headers, body. It fails on a placeholder in a forbidden position, on a body placeholder for a method without a body and on invalid JSON around placeholders in a JSON body.
func (HTTPRequestTemplate) Substitute ¶ added in v0.74.0
func (t HTTPRequestTemplate) Substitute(params Parameters, values map[string]any) (HTTPRequestTemplate, error)
Substitute validates the template like ValidateParameters and replaces each placeholder with its value, encoded for its position. values maps a parameter id to a string, number or boolean; a missing, nil or empty value takes the declared default, else fails with missing-value. Substituted text is never rescanned.
func (HTTPRequestTemplate) ValidateParameters ¶ added in v0.74.0
func (t HTTPRequestTemplate) ValidateParameters(params Parameters) error
ValidateParameters is the save-time check of a template with its declared parameters: declarations, positions, JSON structure and the rule that every placeholder is declared and every declaration is used.
type HTTPTemplateError ¶ added in v0.74.0
type HTTPTemplateError struct {
Code HTTPTemplateErrorCode `json:"code"`
Parameter string `json:"parameter,omitempty"`
Position HTTPPosition `json:"position,omitempty"`
Header string `json:"header,omitempty"`
Detail string `json:"detail"`
}
HTTPTemplateError is why a template cannot be saved or run. It never holds a parameter value.
func (*HTTPTemplateError) Error ¶ added in v0.74.0
func (e *HTTPTemplateError) Error() string
type HTTPTemplateErrorCode ¶ added in v0.74.0
type HTTPTemplateErrorCode string
HTTPTemplateErrorCode classifies an HTTPTemplateError; the codes are shared with the web app.
const ( HTTPErrInvalidURL HTTPTemplateErrorCode = "invalid-url" HTTPErrForbiddenPosition HTTPTemplateErrorCode = "forbidden-position" HTTPErrInvalidJSON HTTPTemplateErrorCode = "invalid-json" HTTPErrBodyNotAllowed HTTPTemplateErrorCode = "body-not-allowed" HTTPErrInvalidDeclaration HTTPTemplateErrorCode = "invalid-declaration" HTTPErrDuplicateParameter HTTPTemplateErrorCode = "duplicate-parameter" HTTPErrUndeclared HTTPTemplateErrorCode = "undeclared" HTTPErrUnused HTTPTemplateErrorCode = "unused" HTTPErrDefaultRequired HTTPTemplateErrorCode = "default-required" HTTPErrCredential HTTPTemplateErrorCode = "credential-parameter" HTTPErrJSONType HTTPTemplateErrorCode = "json-type" HTTPErrMissingValue HTTPTemplateErrorCode = "missing-value" HTTPErrInvalidValue HTTPTemplateErrorCode = "invalid-value" HTTPErrDotSegment HTTPTemplateErrorCode = "dot-segment" HTTPErrHeaderLineBreak HTTPTemplateErrorCode = "header-line-break" HTTPErrContentType HTTPTemplateErrorCode = "duplicate-content-type" HTTPErrTooLarge HTTPTemplateErrorCode = "too-large" )
Error codes of HTTPTemplateError.
type HTTPWidgetDef ¶
type HTTPWidgetDef struct {
WidgetBase
Request HTTPRequest `json:"request"`
}
HTTPWidgetDef holds info about a widget that makes HTTP requests
func (HTTPWidgetDef) Validate ¶
func (v HTTPWidgetDef) Validate() error
Validate returns error if not valid
type HeatmapChartSpec ¶ added in v0.61.0
type HeatmapChartSpec struct {
RowColumn string `json:"rowColumn"`
ColumnColumn string `json:"columnColumn"`
StatusColumn string `json:"statusColumn"`
EvidenceRefColumn string `json:"evidenceRefColumn"`
}
HeatmapChartSpec maps long-form rows to a categorical matrix. The held status values are exactly pass, fail or unknown; duplicate cells are rejected, never averaged or silently replaced. Null/unavailable is unknown, never pass/zero.
func (HeatmapChartSpec) Validate ¶ added in v0.61.0
func (s HeatmapChartSpec) Validate() error
type HideRecordsetColIf ¶
type HideRecordsetColIf struct {
Parameters []string `json:"parameters,omitempty"`
}
HideRecordsetColIf defines recordset col if
func (HideRecordsetColIf) Validate ¶
func (v HideRecordsetColIf) Validate() error
Validate returns error if not valid
type HitAndMiss ¶
type HitAndMiss struct {
IsInModel bool `json:"isInModel"`
ExistsIn []DiffDbRef `json:"existsIn"` // points to DatabaseDifferences.DatabaseDiffs[]DatabaseDiff.GetID
MissingIn []DiffDbRef `json:"missingIn"`
}
HitAndMiss stores where entity exists and where not
type IProjectItem ¶ added in v0.16.0
type IProjectItem interface {
GetID() string
GetProjectItem() ProjectItem
Validate() error
}
type IProjectItems ¶ added in v0.16.0
type IProjectItems[T IProjectItem] interface { IDs() []string GetByID(id string) (t T) Validate() error }
type IncompleteQueryRecordError ¶ added in v0.28.0
type IncompleteQueryRecordError struct {
FolderPath string
ID string
Reason string
Revision QueryRevision
Query QueryDefWithFolderPath
}
IncompleteQueryRecordError reports that RevisionedQueriesStore.LoadQueryRevision found only part of a query's committed pair - the JSON metadata file without its expected body sidecar, or a body sidecar without its JSON metadata file. It is returned only by the strict revisioned load; the tolerant QueriesStore.LoadQuery keeps treating a missing body sidecar as an empty body.
It carries what a caller needs to act on this location rather than being permanently locked out of it: Revision, computed over exactly what is currently persisted, is the exact value PutQuery's IfMatch or DeleteQueryRevision's expected revision must supply to replace (which completes it) or remove this record - a fabricated or stale value still conflicts, exactly as it would for a complete record. Query is the partial record as read from disk (Text always empty, since no body sidecar exists), so a caller can inspect or adopt what is already there instead of only learning that something incomplete exists.
func (*IncompleteQueryRecordError) Error ¶ added in v0.28.0
func (e *IncompleteQueryRecordError) Error() string
func (*IncompleteQueryRecordError) Unwrap ¶ added in v0.28.0
func (e *IncompleteQueryRecordError) Unwrap() error
Unwrap makes errors.Is(err, ErrIncompleteQueryRecord) true for every *IncompleteQueryRecordError.
type Index ¶
type Index struct {
Name string `json:"name"`
Type string `json:"type"`
Origin string `json:"origin,omitempty"` // Used by SQLite
Columns []*IndexColumn `json:"columns"`
IsClustered bool `json:"clustered,omitempty"`
IsXML bool `json:"xml,omitempty"`
IsColumnStore bool `json:"columnstore,omitempty"`
IsHash bool `json:"hash,omitempty"`
IsUnique bool `json:"unique,omitempty"`
IsUniqueConstraint bool `json:"uniqueConstraint,omitempty"`
IsPrimaryKey bool `json:"primaryKey,omitempty"`
IsPartial bool `json:"partial,omitempty"`
}
Index holds info about DB table index
type IndexColumn ¶
type IndexColumn struct {
Name string `json:"name"`
IsDescending bool `json:"descending,omitempty"`
IsIncludedColumn bool `json:"included,omitempty"`
}
IndexColumn holds info about a col in a DB table index
type InvalidQueryLocationError ¶ added in v0.28.0
InvalidQueryLocationError reports that a query's folder path or ID failed the safety checks a RevisionedQueriesStore write enforces before any I/O: an absolute path, a path-traversal or hidden ("."-prefixed) segment, a path separator or NUL byte inside a single ID/folder segment, an attempt to escape the project's queries root, or a symlink/non-directory found while resolving the location.
func (*InvalidQueryLocationError) Error ¶ added in v0.28.0
func (e *InvalidQueryLocationError) Error() string
func (*InvalidQueryLocationError) Unwrap ¶ added in v0.28.0
func (e *InvalidQueryLocationError) Unwrap() error
Unwrap makes errors.Is(err, ErrInvalidQueryLocation) true for every *InvalidQueryLocationError.
type Issues ¶
type Issues struct {
Schema []string `json:"schema,omitempty"`
}
Issues TODO: document what it is for
type ListOfTags ¶
type ListOfTags struct {
Tags []string `json:"tags,omitempty" firestore:"tags,omitempty"`
}
ListOfTags mixing
type MeaningBoardSource ¶ added in v0.66.0
func MeaningBoardSourceFromBoard ¶ added in v0.66.0
func MeaningBoardSourceFromBoard(b Board) (MeaningBoardSource, error)
MeaningBoardSourceFromBoard extracts only the supported saved-query widget contracts. A malformed or unsupported widget prevents a complete scan.
type MeaningEntity ¶ added in v0.66.0
type MeaningEntity struct {
MeaningIdentity
Name string `json:"name"`
Description string `json:"description"`
Origin string `json:"origin"`
Fields []MeaningField `json:"fields"`
Resources []MeaningResource `json:"resources"`
}
type MeaningField ¶ added in v0.66.0
type MeaningField struct {
MeaningIdentity
Name string `json:"name"`
Description string `json:"description"`
Resources []MeaningResource `json:"resources"`
}
type MeaningIdentity ¶ added in v0.66.0
type MeaningOperationReceipt ¶ added in v0.66.0
type MeaningQuerySource ¶ added in v0.66.0
type MeaningQuerySource struct {
ID string
Title string
SemanticModel *QuerySemanticModel
Databases []MeaningResource
Database *MeaningResource
}
Sources must be a complete authorized snapshot read in the provider transaction. Database must come from an exact resolved query connection, never SQL inference.
type MeaningReference ¶ added in v0.66.0
type MeaningReference struct {
MeaningIdentity
Scope MeaningScope `json:"scope"`
}
func (MeaningReference) Validate ¶ added in v0.66.0
func (r MeaningReference) Validate() error
type MeaningResource ¶ added in v0.66.0
type MeaningResource struct {
Kind string `json:"kind"`
ID string `json:"id"`
Title string `json:"title"`
Environment string `json:"environment,omitempty"`
}
func MeaningDatabasesForQueryTargets ¶ added in v0.66.0
func MeaningDatabasesForQueryTargets(q QueryDef, envs Environments) []MeaningResource
MeaningDatabasesForQueryTargets resolves exact declared server+catalog references. Connection labels, SQL text, and dataset names are not matches.
type MeaningScope ¶ added in v0.66.0
type OptionsValueCheck ¶
type OptionsValueCheck struct {
Type string `json:"type"`
Options []interface{} `json:"options"`
}
OptionsValueCheck test value is matching one of the available options
func (OptionsValueCheck) Validate ¶
func (v OptionsValueCheck) Validate() error
Validate returns error if not valid
type Parameter ¶
type Parameter struct {
ID string `json:"id"`
Type string `json:"type"`
Value interface{} `json:"value"`
}
Parameter defines parameter
type ParameterDef ¶
type ParameterDef struct {
ID string `json:"id"`
Type string `json:"type"`
Title string `json:"title,omitempty"`
DefaultValue interface{} `json:"defaultValue,omitempty"`
IsRequired bool `json:"isRequired,omitempty"`
// IsCredential marks an HTTP query parameter used only in credential
// headers (IsCredentialHTTPHeader): it is required, has no default, takes
// a value typed for each run and is never recorded in run history.
// Credential headers are never saved, so its placeholder lives only in the
// session copy of the request (see query_http_template.go).
IsCredential bool `json:"isCredential,omitempty"`
IsMultiValue bool `json:"isMultiValue,omitempty"`
MaxLength int `json:"maxLength,omitempty"`
MinLength int `json:"minLength,omitempty"`
Meta *EntityFieldRef `json:"meta,omitempty"`
Lookup *ParameterLookup `json:"lookup,omitempty"`
}
ParameterDef defines input parameter for a board, widget, etc.
func (ParameterDef) Validate ¶
func (v ParameterDef) Validate() error
Validate returns error if failed
type ParameterLookup ¶
type ParameterLookup struct {
DB string `json:"db" firestore:"db"`
SQL string `json:"sql" firestore:"sql"`
KeyFields []string `json:"keyFields" firestore:"keyFields"`
}
ParameterLookup holds definition for parameter lookup
type ParameterRowsSource ¶ added in v0.72.0
type ParameterRowsSource struct {
Parameter string `json:"parameter"`
}
ParameterRowsSource takes a widget's rows from a card parameter instead of a saved query: a record parameter yields one row, a recordset parameter rows.
func (ParameterRowsSource) Validate ¶ added in v0.72.0
func (v ParameterRowsSource) Validate() error
Validate returns error if not valid.
type PhysicalRef ¶ added in v0.17.0
type PhysicalRef struct {
Source string `json:"source" firestore:"source"`
Collection string `json:"collection" firestore:"collection"`
Column string `json:"column" firestore:"column"`
}
PhysicalRef references a physical column an entity field maps to.
func (PhysicalRef) Validate ¶ added in v0.17.0
func (v PhysicalRef) Validate() error
Validate returns error if not valid
type PhysicalRefs ¶ added in v0.17.0
type PhysicalRefs []PhysicalRef
PhysicalRefs is a slice of PhysicalRef
func (PhysicalRefs) Validate ¶ added in v0.17.0
func (v PhysicalRefs) Validate() error
Validate returns error if not valid: every ref must be valid and, since a field can only mean one thing per table, unique per source+collection.
type PresentationFilter ¶ added in v0.60.0
type PresentationFilter struct {
SelectionID string `json:"selectionId"`
Column string `json:"column"`
}
PresentationFilter is deliberately closed even though legacy SQL widget fields retain their permissive JSON decoder.
func (*PresentationFilter) UnmarshalJSON ¶ added in v0.60.0
func (v *PresentationFilter) UnmarshalJSON(data []byte) error
func (PresentationFilter) Validate ¶ added in v0.60.0
func (v PresentationFilter) Validate() error
type ProjBoardBrief ¶
type ProjBoardBrief struct {
ProjItemBrief
UpdatedAt *time.Time `json:"updatedAt,omitempty" firestore:"updatedAt,omitempty"`
Parameters Parameters `json:"parameters,omitempty" firestore:"parameters,omitempty"`
// TODO: Document why and how to use, add tests
RequiredParams [][]string `json:"requiredParams,omitempty" firestore:"requiredParams,omitempty"`
}
ProjBoardBrief defines brief information of Board
func (ProjBoardBrief) Validate ¶
func (v ProjBoardBrief) Validate() error
type ProjDbDriver ¶ added in v0.16.0
type ProjDbDriver struct {
ProjectItem
Servers ProjDbServers `json:"servers"`
}
func (ProjDbDriver) Validate ¶ added in v0.16.0
func (v ProjDbDriver) Validate() error
Validate returns error if not valid. It calls ValidateWithOptions directly rather than v.ProjItemBrief.Validate() — ProjItemBrief declares no Validate() of its own, so that call resolved to the promoted ListOfTags.Validate() (ProjItemBrief embeds ListOfTags), which checks only tags and silently skipped the id/title checks every other project-item type enforces. Both id and title are required (true) here.
type ProjDbDrivers ¶ added in v0.16.0
type ProjDbDrivers []*ProjDbDriver
func (ProjDbDrivers) GetByID ¶ added in v0.16.0
func (p ProjDbDrivers) GetByID(id string) *ProjDbDriver
func (ProjDbDrivers) IDs ¶ added in v0.16.0
func (p ProjDbDrivers) IDs() []string
func (ProjDbDrivers) Validate ¶ added in v0.16.0
func (p ProjDbDrivers) Validate() error
type ProjDbDriversStore ¶ added in v0.16.0
type ProjDbDriversStore interface {
LoadProjDbDrivers(ctx context.Context, o ...StoreOption) (ProjDbDrivers, error)
LoadProjDbDriver(ctx context.Context, id string, o ...StoreOption) (*ProjDbDriver, error)
SaveProjDbDriver(ctx context.Context, dbDriver *ProjDbDriver, o ...StoreOption) error
DeleteProjDbDriver(ctx context.Context, id string) error
DbServersStore(dbDriver string) ProjDbServersStore
}
type ProjDbModelBrief ¶
type ProjDbModelBrief struct {
ProjectItem
NumberOf ProjDbModelNumbers `json:"numberOf"`
}
ProjDbModelBrief hold env brief in project summary
type ProjDbModelNumbers ¶
type ProjDbModelNumbers struct {
Schemas int `json:"schemas"`
Tables int `json:"tables"`
Views int `json:"views"`
}
ProjDbModelNumbers holds numbers for a dbmodel
type ProjDbServer ¶
type ProjDbServer struct {
ProjectItem
Server ServerRef `json:"server"`
Catalogs DbCatalogs `json:"catalogs"`
}
ProjDbServer holds info about a project DB server - NOT sure if right way
func (ProjDbServer) Validate ¶
func (v ProjDbServer) Validate() error
Validate returns error if not valid
type ProjDbServerFile ¶
type ProjDbServerFile struct {
ServerRef
Catalogs []string `jsont:"catalogs,omitempty" firestore:"catalogs,omitempty"`
}
ProjDbServerFile stores summary info about ServerRef
func (ProjDbServerFile) Validate ¶
func (v ProjDbServerFile) Validate() error
Validate returns error if not valid
type ProjDbServerSummary ¶
type ProjDbServerSummary struct {
ProjectItem
DbServer ServerRef `json:"dbServer"`
Catalogs []*DbCatalogSummary `json:"databases,omitempty"`
}
ProjDbServerSummary holds summary info about DB server
type ProjDbServers ¶
type ProjDbServers ProjectItems[*ProjDbServer]
ProjDbServers slice of ProjDbServer which holds ServerRef and DbCatalogs
func (ProjDbServers) GetProjDbServer ¶
func (v ProjDbServers) GetProjDbServer(ref ServerRef) *ProjDbServer
GetProjDbServer returns db servers
func (ProjDbServers) Validate ¶
func (v ProjDbServers) Validate() error
Validate returns error if not valid
type ProjDbServersStore ¶ added in v0.15.7
type ProjDbServersStore interface {
DriverID() string
CatalogsStore(serverRef ServerRef) DbCatalogsStore
LoadProjDbServers(ctx context.Context, o ...StoreOption) (ProjDbServers, error)
LoadProjDbServer(ctx context.Context, serverID string, o ...StoreOption) (*ProjDbServer, error)
SaveProjDbServer(ctx context.Context, server *ProjDbServer, o ...StoreOption) error
DeleteProjDbServer(ctx context.Context, serverID string) error
}
type ProjEntityBrief ¶
type ProjEntityBrief struct {
ProjItemBrief
}
ProjEntityBrief hold brief info about entity in project file
type ProjEnvBrief ¶
type ProjEnvBrief struct {
ProjectItem
}
ProjEnvBrief hold env brief in project summary
type ProjEnvNumbers ¶
ProjEnvNumbers hold some numbers for environment
type ProjItemBrief ¶
type ProjItemBrief struct {
ID string `json:"id,omitempty" firestore:"id,omitempty" yaml:"id,omitempty"`
Title string `json:"title,omitempty" firestore:"title,omitempty" yaml:"title,omitempty"`
// Document what is Folder? should it be moved somewhere?
Folder string `json:"folder,omitempty" firestore:"folder,omitempty" yaml:"folder,omitempty"` // TODO: document purpose and usage
ListOfTags
}
ProjItemBrief hold a brief about a project item
func (*ProjItemBrief) GetID ¶ added in v0.15.0
func (v *ProjItemBrief) GetID() string
func (*ProjItemBrief) SetID ¶ added in v0.15.0
func (v *ProjItemBrief) SetID(id string)
func (*ProjItemBrief) ValidateWithOptions ¶ added in v0.16.0
func (v *ProjItemBrief) ValidateWithOptions(isTitleRequired bool) error
ValidateWithOptions returns error if not valid
type Project ¶
type Project struct {
Databases ProjectDatabases `json:"databases,omitempty" firestore:"databases,omitempty"`
Coordination *WatchCoordination `json:"coordination,omitempty" firestore:"coordination,omitempty"`
EnvironmentOrder []string `json:"environmentOrder,omitempty" firestore:"environmentOrder,omitempty"`
ProjectItem
Created *ProjectCreated `json:"created,omitempty" firestore:"created,omitempty"`
Boards Boards `json:"boards,omitempty" firestore:"boards,omitempty"`
Queries *QueriesFolder `json:"queries,omitempty" firestore:"queries,omitempty"`
Entities Entities `json:"entities,omitempty" firestore:"entities,omitempty"`
// Use GetEnvironments to get the latest
Environments Environments `json:"environments,omitempty" firestore:"environments,omitempty"`
DbModels DbModels `json:"dbModels,omitempty" firestore:"dbModels,omitempty"`
DataModels *ProjectDataModels `json:"dataModels,omitempty" firestore:"dataModels,omitempty"`
DbDrivers ProjDbDrivers `json:"dbDrivers,omitempty" firestore:"dbDrivers,omitempty"`
Actions Actions `json:"actions,omitempty" firestore:"actions,omitempty"`
Repository *ProjectRepository `json:"repository,omitempty" firestore:"repository,omitempty"`
// contains filtered or unexported fields
}
Project holds info about a project
func NewProjectWithStore ¶ added in v0.16.5
func NewProjectWithStore(id string, store ProjectStore) (p *Project)
func NewProjectWithStoreFactory ¶ added in v0.16.5
func NewProjectWithStoreFactory(id string, newStore func(p *Project) ProjectStore) (p *Project)
func (*Project) AddProjDbServer ¶ added in v0.16.2
func (p *Project) AddProjDbServer(ctx context.Context, dbServer *ProjDbServer) (err error)
func (*Project) GetDBs ¶ added in v0.16.0
func (p *Project) GetDBs(ctx context.Context, o ...StoreOption) (dbs ProjDbDrivers, err error)
func (*Project) GetEnvironments ¶ added in v0.12.1
func (p *Project) GetEnvironments(ctx context.Context) (environments Environments, err error)
func (*Project) GetProjDbServer ¶ added in v0.16.2
func (*Project) UnmarshalJSON ¶ added in v0.76.0
type ProjectBrief ¶
type ProjectBrief struct {
Access string `json:"access" firestore:"access"` // e.g. private, protected, public
ProjectItem
Repository *ProjectRepository `json:"repository,omitempty" firestore:"repository,omitempty"`
}
ProjectBrief hold project brief info (e.g. for list)
func (*ProjectBrief) Validate ¶
func (v *ProjectBrief) Validate() error
Validate returns error if not valid
type ProjectCardBrief ¶ added in v0.72.0
type ProjectCardBrief = CardBrief
ProjectCardBrief is the wire name of CardBrief used by the web client.
type ProjectConnections ¶ added in v0.45.0
type ProjectConnections struct {
Format string `json:"format"`
Connections []EditionConnection `json:"connections,omitempty"`
BigQueryEditions []EditionConnection `json:"bigQueryEditions,omitempty"`
BigQueryPlans []ConnectionPlan `json:"bigQueryPlans,omitempty"`
}
func ParseProjectConnectionDirectoryJSON ¶ added in v0.125.0
func ParseProjectConnectionDirectoryJSON(name string, body []byte) (ProjectConnections, bool, error)
ParseProjectConnectionDirectoryJSON recognizes the exact owning filename and fully validates its contract. false means a proved log-source document; every unknown format or misplaced log document is an error, never silently skipped.
func ParseProjectConnectionsJSON ¶ added in v0.125.0
func ParseProjectConnectionsJSON(body []byte) (ProjectConnections, error)
ParseProjectConnectionsJSON validates bounded declaration metadata while leaving unrecognized private fields out of the result. Duplicate typed fields are invalid even when the surrounding document contains opaque credentials.
func ParsePublicProjectConnectionDirectoryJSON ¶ added in v0.125.0
func ParsePublicProjectConnectionDirectoryJSON(name string, body []byte) (ProjectConnections, bool, error)
func ParsePublicProjectConnectionsJSON ¶ added in v0.125.0
func ParsePublicProjectConnectionsJSON(body []byte) (ProjectConnections, error)
ParsePublicProjectConnectionsJSON is the shared public catalog read contract. Writers must validate prospective bytes with it before accepting a mutation.
func (ProjectConnections) Validate ¶ added in v0.45.0
func (c ProjectConnections) Validate() error
type ProjectConnectionsReader ¶ added in v0.45.0
type ProjectConnectionsReader interface {
LoadProjectConnections(context.Context) (ProjectConnections, error)
}
ProjectConnectionsReader is an optional ProjectStore capability. The base ProjectStore interface and its existing implementations remain unchanged.
type ProjectCreated ¶
type ProjectCreated struct {
//ByName string `json:"byName,omitempty"`
//ByUsername string `json:"byUsername,omitempty"`
At time.Time `json:"at" firestore:"at"`
}
ProjectCreated hold info about when and who created
type ProjectDataModelReference ¶ added in v0.76.0
type ProjectDataModelReference struct {
ID string `json:"id" firestore:"id"`
DataModelReference
}
type ProjectDataModels ¶ added in v0.76.0
type ProjectDataModels struct {
Version int `json:"version" firestore:"version"`
References []ProjectDataModelReference `json:"references" firestore:"references"`
CatalogBindings []DataModelCatalogBinding `json:"catalogBindings,omitempty" firestore:"catalogBindings,omitempty"`
}
A nil pointer preserves existing metadata on save. An explicit v1 empty document replaces/clears it; JSON null is never a clearing instruction.
func (ProjectDataModels) MarshalJSON ¶ added in v0.76.0
func (d ProjectDataModels) MarshalJSON() ([]byte, error)
func (*ProjectDataModels) ReferenceByID ¶ added in v0.76.0
func (d *ProjectDataModels) ReferenceByID(id string) (DataModelReference, error)
func (*ProjectDataModels) ReferenceForCatalog ¶ added in v0.76.0
func (d *ProjectDataModels) ReferenceForCatalog(environment, catalog string) (DataModelReference, error)
func (*ProjectDataModels) UnmarshalJSON ¶ added in v0.76.0
func (d *ProjectDataModels) UnmarshalJSON(body []byte) error
func (*ProjectDataModels) Validate ¶ added in v0.76.0
func (d *ProjectDataModels) Validate() error
type ProjectDatabase ¶ added in v0.124.0
type ProjectDatabase struct {
ID string `json:"id" firestore:"id"`
Title string `json:"title,omitempty" firestore:"title,omitempty"`
ConnectionID string `json:"connectionId" firestore:"connectionId"`
OVDB PublicOVDBDatabase `json:"ovdb" firestore:"ovdb"`
}
ProjectDatabase is a named database and its explicit anonymous OVDB browser binding. It grants no credentials, backend source binding or mutation rights.
type ProjectDatabases ¶ added in v0.124.0
type ProjectDatabases []ProjectDatabase
func (ProjectDatabases) Validate ¶ added in v0.124.0
func (items ProjectDatabases) Validate() error
type ProjectDefinitionDependency ¶ added in v0.125.0
type ProjectDefinitionDependency struct {
Kind string
ID string
EntityField EntityFieldRef
Meaning MeaningReference
Environment string
Data json.RawMessage
}
ProjectDefinitionDependency preserves the source contract's identity. A host resolves it inside its authorized transaction: bare query IDs, Entity fields, scoped Meanings, connection declarations and source aliases are not synonyms. Data holds the named concrete source contract for lookup, target, federation, recordset or entity-source requests. It is private resolver input, not UI data.
func ProjectBoardDependencies ¶ added in v0.125.0
func ProjectBoardDependencies(board Board) ([]ProjectDefinitionDependency, error)
func ProjectCardDependencies ¶ added in v0.125.0
func ProjectCardDependencies(card Card) ([]ProjectDefinitionDependency, error)
func ProjectEntityDependencies ¶ added in v0.125.0
func ProjectEntityDependencies(entity Entity) ([]ProjectDefinitionDependency, error)
func ProjectQueryDependencies ¶ added in v0.125.0
func ProjectQueryDependencies(query QueryDefWithFolderPath) ([]ProjectDefinitionDependency, error)
These extractors cover typed outgoing definition requests only. Every request needs an explicit provider resolution, a proven external identity or an error; unresolved requests must never silently become an empty dependency list. Execution/history inventory and lifecycle permissions are separate concerns.
type ProjectFile ¶
type ProjectFile struct {
Databases ProjectDatabases `json:"databases,omitempty" firestore:"databases,omitempty"`
Coordination *WatchCoordination `json:"coordination,omitempty" firestore:"coordination,omitempty"`
DataModels *ProjectDataModels `json:"dataModels,omitempty" firestore:"dataModels,omitempty"`
EnvironmentOrder []string `json:"environmentOrder,omitempty" firestore:"environmentOrder,omitempty"`
Created *ProjectCreated `json:"created,omitempty" firestore:"created,omitempty"`
ProjectItem
Repository *ProjectRepository `json:"repository,omitempty" firestore:"repository,omitempty"`
// contains filtered or unexported fields
}
ProjectFile defines what to storage to project file
func (ProjectFile) MarshalJSON ¶ added in v0.67.0
func (v ProjectFile) MarshalJSON() ([]byte, error)
func (*ProjectFile) MergePreservedMetadata ¶ added in v0.76.0
func (p *ProjectFile) MergePreservedMetadata(existing ProjectFile) error
MergePreservedMetadata validates existing recognized metadata even when an explicit replacement was submitted: an unsupported version is never downgraded.
func (*ProjectFile) UnmarshalJSON ¶ added in v0.67.0
func (v *ProjectFile) UnmarshalJSON(body []byte) error
func (ProjectFile) Validate ¶
func (v ProjectFile) Validate() error
Validate returns error if not valid
type ProjectItem ¶
type ProjectItem struct {
ProjItemBrief
UserIDs []string `json:"userIds,omitempty" firestore:"userIds,omitempty"`
Access string `json:"access,omitempty" firestore:"access,omitempty"` // e.g. "private", "protected", "public"
}
ProjectItem base class with GetID and Name
func (ProjectItem) GetProjectItem ¶ added in v0.16.0
func (v ProjectItem) GetProjectItem() ProjectItem
func (ProjectItem) ValidateWithOptions ¶ added in v0.16.0
func (v ProjectItem) ValidateWithOptions(isTitleRequired bool) error
ValidateWithOptions returns error if not valid
type ProjectItems ¶ added in v0.16.0
type ProjectItems[T IProjectItem] []T
func (ProjectItems[T]) GetByID ¶ added in v0.16.0
func (v ProjectItems[T]) GetByID(id string) (t T)
func (ProjectItems[T]) IDs ¶ added in v0.16.0
func (v ProjectItems[T]) IDs() (ids []string)
IDs returns slice of IDs of db models
func (ProjectItems[T]) Validate ¶ added in v0.16.0
func (v ProjectItems[T]) Validate() error
type ProjectLifecycleAck ¶ added in v0.125.0
type ProjectLifecycleAck struct {
OperationID string `json:"operationId"`
Revision string `json:"revision"`
Change ProjectLifecycleChange `json:"change"`
}
type ProjectLifecycleBlocker ¶ added in v0.125.0
type ProjectLifecycleBlocker struct {
Target ProjectObjectRef `json:"target"`
UsedBy ProjectObjectRef `json:"usedBy"`
Archived bool `json:"archived"`
Historical bool `json:"historical,omitempty"`
}
type ProjectLifecycleCatalog ¶ added in v0.125.0
type ProjectLifecycleCatalog struct {
Revision string `json:"revision"`
Complete bool `json:"complete"`
Items []ProjectUsageItem `json:"items"`
}
type ProjectLifecycleChange ¶ added in v0.125.0
type ProjectLifecycleChange struct {
Object ProjectObjectRef `json:"object"`
Action string `json:"action"` // archive, restore or delete
}
type ProjectLifecyclePlan ¶ added in v0.125.0
type ProjectLifecyclePlan struct {
Change ProjectLifecycleChange `json:"change"`
// Admission details can include sources the actor cannot read. Public
// responses use ReviewProjectLifecycle's visibility-filtered items instead.
Blockers []ProjectLifecycleBlocker `json:"-"`
}
func PlanProjectLifecycle ¶ added in v0.125.0
func PlanProjectLifecycle(snapshot ProjectUsageSnapshot, write ProjectLifecycleWrite) (ProjectLifecyclePlan, error)
PlanProjectLifecycle admits exactly one object transition against the current authoritative snapshot. No nested or related-object mutations are supported. This function neither authorizes nor persists.
type ProjectLifecycleReview ¶ added in v0.125.0
type ProjectLifecycleReview struct {
Revision string `json:"revision"`
Complete bool `json:"complete"`
Target ProjectUsageItem `json:"target"`
Incoming []ProjectUsageItem `json:"incoming"`
CanArchive bool `json:"canArchive"`
CanDelete bool `json:"canDelete"`
CanRestore bool `json:"canRestore"`
}
func ReviewProjectLifecycle ¶ added in v0.125.0
func ReviewProjectLifecycle(snapshot ProjectUsageSnapshot, target ProjectObjectRef, visible func(ProjectObjectRef) bool) (ProjectLifecycleReview, error)
ReviewProjectLifecycle does not authorize. A provider calls it only after target access passes, with a visibility decision for every referenced source. A nil visible callback redacts all related resources, never assumes access.
type ProjectLifecycleScope ¶ added in v0.125.0
type ProjectLifecycleScope struct {
ActorID string
Storage string
SpaceID string
Project string
Branch string
// Environment is permission context, not a partition of the reference graph.
// For example, hosted cards have one project-wide identity even when access
// is admitted through a particular environment. Inventory remains project-wide.
Environment string
}
ProjectLifecycleScope is created from the serving authority, never decoded from a client-supplied actor. All identities and branch selectors are bound to one provider scope; a receipt from another scope cannot authorize a mutation.
type ProjectLifecycleStore ¶ added in v0.125.0
type ProjectLifecycleStore interface {
ReviewProjectLifecycle(context.Context, ProjectLifecycleScope, ProjectObjectRef) (ProjectLifecycleReview, error)
ChangeProjectLifecycle(context.Context, ProjectLifecycleScope, ProjectLifecycleWrite) (ProjectLifecycleAck, error)
ListProjectLifecycle(context.Context, ProjectLifecycleScope, bool) (ProjectLifecycleCatalog, error)
}
ProjectLifecycleStore is an optional authoritative provider capability. A plain CRUD ProjectStore MUST NOT be treated as this capability. Unsupported providers leave lifecycle actions unavailable; no legacy delete fallback.
ChangeProjectLifecycle must authorize the current serving actor, inventory every retained reference (including history from other actors and expired but unpurged records), and run PlanProjectLifecycle on that fresh complete graph inside the SAME provider lock/transaction as metadata/definition persistence and its operation receipt. Every concurrent reference-bearing writer must share that admission boundary. A client review or a definitions-only scan is not sufficient. Operation receipts bind actor, full scope and request digest; duplicate operations return the original acknowledgement, never execute twice.
ReviewProjectLifecycle must authorize the target and redact source identity separately from admission. ListProjectLifecycle includes only items the actor can read. It must retain archived objects in the reference graph even when an active-only catalog hides them. Definitions cannot purge execution history. Watch object IDs are qualified as namespace/environment/watch-ID; providers must validate all three against the serving project and current authority. A bare Watch ID is not sufficient to select a lifecycle target.
type ProjectLifecycleWrite ¶ added in v0.125.0
type ProjectLifecycleWrite struct {
OperationID string `json:"operationId"`
ExpectedRevision string `json:"expectedRevision"`
Change ProjectLifecycleChange `json:"change"`
}
func (ProjectLifecycleWrite) Validate ¶ added in v0.125.0
func (write ProjectLifecycleWrite) Validate() error
type ProjectLoader ¶ added in v0.12.1
type ProjectLogCollection ¶ added in v0.125.0
type ProjectLogIdentifier ¶ added in v0.125.0
type ProjectLogRecord ¶ added in v0.125.0
type ProjectLogSource ¶ added in v0.125.0
type ProjectLogSource struct {
ID string `json:"id"`
Title string `json:"title"`
Database string `json:"database"`
Synthetic bool `json:"synthetic,omitempty"`
Collections []ProjectLogCollection `json:"collections"`
Fields map[string]string `json:"fields"`
Identifiers []ProjectLogIdentifier `json:"identifiers,omitempty"`
Window ProjectLogWindow `json:"window"`
Records []ProjectLogRecord `json:"records,omitempty"`
}
type ProjectLogSources ¶ added in v0.125.0
type ProjectLogSources struct {
Format string `json:"format"`
Sources []ProjectLogSource `json:"sources"`
}
func ParseProjectLogSourcesJSON ¶ added in v0.125.0
func ParseProjectLogSourcesJSON(body []byte) (ProjectLogSources, error)
ParseProjectLogSourcesJSON validates the complete known contract. Unknown members fail closed rather than hiding a future connection-bearing extension. It grants no network access and never returns source values in catalog output.
type ProjectLogWindow ¶ added in v0.125.0
type ProjectMeaningAck ¶ added in v0.66.0
type ProjectMeaningAck struct {
Receipt string `json:"receipt"`
Catalog ProjectMeaningsCatalog `json:"catalog"`
}
type ProjectMeaningAction ¶ added in v0.66.0
type ProjectMeaningAction struct {
Action string `json:"action"`
ConceptID string `json:"conceptId,omitempty"`
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
Entity MeaningIdentity `json:"entity,omitempty"`
Field MeaningIdentity `json:"field,omitempty"`
}
type ProjectMeaningWrite ¶ added in v0.66.0
type ProjectMeaningWrite struct {
OperationID string `json:"operationId"`
IfMatch string `json:"ifMatch"`
Change ProjectMeaningAction `json:"change"`
}
type ProjectMeaningsCatalog ¶ added in v0.66.0
type ProjectMeaningsCatalog struct {
Scope MeaningScope `json:"scope"`
Version int `json:"version"`
Revision string `json:"revision"`
Writable bool `json:"writable"`
ReferencesComplete bool `json:"referencesComplete"`
// LifecycleComplete requires the complete cross-domain retained-usage proof.
// The narrow query/board meaning catalog cannot grant this capability.
LifecycleComplete bool `json:"lifecycleComplete"`
Entities []MeaningEntity `json:"entities"`
}
func BuildProjectMeaningsCatalog ¶ added in v0.66.0
func BuildProjectMeaningsCatalog(d ProjectMeaningsDocument, queries []MeaningQuerySource, boards []MeaningBoardSource, scope MeaningScope, writable, complete bool) (ProjectMeaningsCatalog, error)
type ProjectMeaningsDocument ¶ added in v0.66.0
type ProjectMeaningsDocument struct {
Version int `json:"version"`
Entities []MeaningEntity `json:"entities"`
Receipts map[string]MeaningOperationReceipt `json:"receipts,omitempty"`
}
ProjectMeaningsDocument is persisted atomically with its operation receipts. Resources are recomputed; persisted definitions must contain none.
func (ProjectMeaningsDocument) Validate ¶ added in v0.66.0
func (d ProjectMeaningsDocument) Validate() error
type ProjectObjectRef ¶ added in v0.125.0
ProjectObjectRef is a project-scoped definition identity, never a filesystem path.
func (ProjectObjectRef) Validate ¶ added in v0.125.0
func (ref ProjectObjectRef) Validate() error
Validate rejects malformed identities before a provider sees them.
type ProjectObjectUsage ¶ added in v0.125.0
type ProjectObjectUsage struct {
Ref ProjectObjectRef `json:"ref"`
Title string `json:"title"`
Archived bool `json:"archived"`
Historical bool `json:"historical,omitempty"`
ContentRevision string `json:"contentRevision"`
References []ProjectObjectRef `json:"references"`
}
ProjectObjectUsage describes complete outgoing references of a definition or retained execution record. Archived items and completed history remain in the graph and prevent deletion of their targets. Favorites also prevent Delete only: their private navigation references are always Historical. Historical is provider-derived: completed runs and immutable snapshots are inactive references, not deleted references. Running executions remain active references. Archived applies only to definitions; history activity is classified solely through Historical. A reference means retained content or use. Identity-only audit receipts remain provenance and replay metadata; their object IDs alone must not create edges.
type ProjectRepository ¶
type ProjectRepository struct {
Type string `json:"type"` // e.g. "git"
WebURL string `json:"webURL"`
ProjectID string `json:"projectId,omitempty"`
}
ProjectRepository defines project repository
func (*ProjectRepository) Validate ¶
func (v *ProjectRepository) Validate() error
Validate returns error if not valid
type ProjectStore ¶ added in v0.15.0
type ProjectStore interface {
ProjectID() string
LoadProjectFile(ctx context.Context) (ProjectFile, error)
//LoadProjectSummary(ctx context.Context) (ProjectSummary, error)
LoadProject(ctx context.Context, o ...StoreOption) (p *Project, err error)
SaveProject(ctx context.Context, p *Project) error
QueriesStore
BoardsStore
CardsStore
FoldersStore
EntitiesStore
EnvironmentsStore
EnvDbServersStore
EnvDbCatalogStore
ProjDbDriversStore
RecordsetDefinitionsStore
}
type ProjectSummary ¶
type ProjectSummary struct {
ProjectFile
Entities []*ProjEntityBrief `json:"entities,omitempty" firestore:"entities,omitempty"`
}
ProjectSummary hold project summary - this is to be used in Firestore to minimize reads Locally we'd produce it from ProjectFile and shallow scan of nested dirs.
type ProjectUsageItem ¶ added in v0.125.0
type ProjectUsageItem struct {
Ref ProjectObjectRef `json:"ref"`
Title string `json:"title,omitempty"`
Archived bool `json:"archived"`
Historical bool `json:"historical,omitempty"`
Restricted bool `json:"restricted,omitempty"`
}
ProjectUsageItem is presentation metadata only. Providers must authorize its disclosure; callers with restricted source visibility receive an unnamed item.
type ProjectUsageSnapshot ¶ added in v0.125.0
type ProjectUsageSnapshot struct {
Revision string `json:"revision"`
Complete bool `json:"complete"`
Objects []ProjectObjectUsage `json:"objects"`
}
ProjectUsageSnapshot must come from the authoritative provider, within the same lock/transaction as a write. Unknown, unsupported or unreadable sources must leave Complete false. Revision binds definitions, references and lifecycle state. Completeness includes retained history even when its owner is not the current actor or its expiry has passed. Expiry alone does not remove retained references.
type ProjectVisibility ¶ added in v0.15.11
type ProjectVisibility int
const ( PublicProject ProjectVisibility = iota PrivateProject )
func (ProjectVisibility) Validate ¶ added in v0.15.11
func (v ProjectVisibility) Validate() error
type ProjectsStore ¶ added in v0.15.11
type ProjectsStore interface {
CreateNewProject(ctx context.Context, id, title string, visibility ProjectVisibility, report StatusReporter) (project *Project, err error)
}
type PropertyDiff ¶
type PropertyDiff struct {
Name string `json:"name"`
HitAndMiss
}
PropertyDiff holds diffs about some property
type PublicOVDBDatabase ¶ added in v0.124.0
type QueriesFolder ¶ added in v0.16.0
type QueriesFolder struct {
ProjectItem
Folders QueryFolders `json:"folders,omitempty" yaml:"folders,omitempty"`
Items QueryDefs `json:"items,omitempty" yaml:"items,omitempty"`
}
QueriesFolder defines folder
func (QueriesFolder) Validate ¶ added in v0.16.0
func (v QueriesFolder) Validate() error
Validate returns error if not valid
type QueriesStore ¶ added in v0.15.7
type QueriesStore interface {
LoadQueries(ctx context.Context, folderPath string, o ...StoreOption) (folder *QueriesFolder, err error)
LoadQuery(ctx context.Context, id string, o ...StoreOption) (*QueryDef, error)
SaveQuery(ctx context.Context, query *QueryDefWithFolderPath) error
DeleteQuery(ctx context.Context, id string) error
}
type QueryCapture ¶ added in v0.28.1
type QueryCapture struct {
// Author is the serving principal the capture was saved under, set by
// the server, never by the client. Empty when the server ran with no
// identified principal.
Author string `json:"author,omitempty" yaml:"author,omitempty"`
// Environment is the environment the captured lookup ran in.
Environment string `json:"environment" yaml:"environment"`
// Source is the stable project-local source ID (api-contract.md
// SourceRef.source) the captured lookup read.
Source string `json:"source" yaml:"source"`
// Collection is the collection the captured query reads, derived by the
// server from the query itself.
Collection string `json:"collection,omitempty" yaml:"collection,omitempty"`
// Bindings records how each parameter was bound during capture.
Bindings []QueryCaptureBinding `json:"bindings,omitempty" yaml:"bindings,omitempty"`
}
QueryCapture records where a query captured from exploration came from, persisted inside the query's own "<id>.query.json" so the provenance travels with the query through git. Hub datatug/datatug executable-knowledge-library REQ:capture-from-exploration: "Query author, purpose and source/binding provenance are inspectable."
It carries identifiers only - never a bound value, a result row or a credential.
func (QueryCapture) Validate ¶ added in v0.28.1
func (v QueryCapture) Validate() error
Validate returns an error if the capture provenance is incomplete: an environment and a source are required, and every binding must name a parameter, at most once, with one of the capture origins. A capture is persisted inside the git-tracked "<id>.query.json", so every string it records is screened for credential material too - by shape, for the reasons given above.
type QueryCaptureBinding ¶ added in v0.28.1
type QueryCaptureBinding struct {
ParameterID string `json:"parameterId" yaml:"parameterId"`
Origin string `json:"origin" yaml:"origin"` // selection | context | manual
}
QueryCaptureBinding is one parameter's capture-time binding origin.
type QueryComparison ¶ added in v0.70.0
type QueryComparison struct {
Kind string `json:"kind" yaml:"kind"`
PrimaryInput string `json:"primaryInput" yaml:"primaryInput"`
ControlInput string `json:"controlInput" yaml:"controlInput"`
Projection QueryComparisonProjection `json:"projection" yaml:"projection"`
}
QueryComparison declares an explicit pair and result roles. It grants no source authority: the provider must independently verify actual observations.
func (*QueryComparison) UnmarshalJSON ¶ added in v0.70.0
func (v *QueryComparison) UnmarshalJSON(data []byte) error
func (*QueryComparison) UnmarshalYAML ¶ added in v0.70.0
func (v *QueryComparison) UnmarshalYAML(node *yaml.Node) error
func (QueryComparison) Validate ¶ added in v0.70.0
func (v QueryComparison) Validate() error
Validate checks metadata shape and credential safety, never business IDs, timestamp arithmetic, event kinds or asserted source/anchor truth.
type QueryComparisonProjection ¶ added in v0.70.0
type QueryComparisonProjection struct {
MemberColumn string `json:"memberColumn" yaml:"memberColumn"`
ObservationColumn string `json:"observationColumn" yaml:"observationColumn"`
LaneColumn string `json:"laneColumn" yaml:"laneColumn"`
EventColumn string `json:"eventColumn" yaml:"eventColumn"`
SequenceColumn string `json:"sequenceColumn" yaml:"sequenceColumn"`
TimeColumn string `json:"timeColumn" yaml:"timeColumn"`
ClockDomainColumn string `json:"clockDomainColumn" yaml:"clockDomainColumn"`
PrecisionColumn string `json:"precisionColumn" yaml:"precisionColumn"`
StatusColumn string `json:"statusColumn" yaml:"statusColumn"`
AnchorColumn string `json:"anchorColumn" yaml:"anchorColumn"`
}
QueryComparisonProjection maps one declared recordset; names may be aliases. It is not QuerySemanticModel provenance or a client-supplied physical mapping.
func (*QueryComparisonProjection) UnmarshalJSON ¶ added in v0.70.0
func (v *QueryComparisonProjection) UnmarshalJSON(data []byte) error
func (*QueryComparisonProjection) UnmarshalYAML ¶ added in v0.70.0
func (v *QueryComparisonProjection) UnmarshalYAML(node *yaml.Node) error
type QueryDef ¶
type QueryDef struct {
// CreatedAt is mandatory server-owned RFC3339 UTC persisted creation metadata.
CreatedAt string `json:"createdAt" yaml:"createdAt" firestore:"createdAt"`
ProjectItem
Type QueryType `json:"type"` // Possible value: folder, DDL, GraphQL, HTTP, etc.
Text string `json:"text,omitempty" yaml:"text,omitempty"`
// StructuredBody says Text of a TugQL query is the structured YAML
// document (persisted as "<id>.query.tugql.yaml") rather than TugQL text
// (persisted as "<id>.query.tugql"). It is never persisted in the JSON
// sidecar: the body file's name is what records the representation.
StructuredBody bool `json:"structuredBody,omitempty" yaml:"structuredBody,omitempty"`
// HTTP is the saved request of an HTTP query beyond its URL (Text); nil
// for every other query and for an HTTP query that is a plain GET.
HTTP *QueryHTTPRequest `json:"http,omitempty" yaml:"http,omitempty" firestore:"http,omitempty"`
Draft bool `json:"draft,omitempty" yaml:"draft,omitempty"`
Parameters Parameters `json:"parameters,omitempty" yaml:"parameters,omitempty"`
Targets []QueryDefTarget `json:"targets,omitempty" yaml:"targets,omitempty"`
// User might want to now what set of cols is returned even before hitting the RUN button.
Recordsets []RecordsetDefinition `json:"recordsets,omitempty" yaml:"recordsets,omitempty"`
// Purpose says what question the query answers, in the author's words
// (executable-knowledge-library REQ:capture-from-exploration).
Purpose string `json:"purpose,omitempty" yaml:"purpose,omitempty"`
// Capture is the provenance of a query captured from exploration; nil
// for a query authored any other way. See QueryCapture.
Capture *QueryCapture `json:"capture,omitempty" yaml:"capture,omitempty"`
// ConnectionID names a project connection declaration. It is an identifier,
// never a URL, driver string, credential, or execution grant.
ConnectionID string `json:"connectionId,omitempty" yaml:"connectionId,omitempty"`
// Comparison declares result roles, not physical lineage or execution authority.
Comparison *QueryComparison `json:"comparison,omitempty" yaml:"comparison,omitempty"`
SemanticModel *QuerySemanticModel `json:"semanticModel,omitempty" yaml:"semanticModel,omitempty"`
// Federation contains client-side source routing and optional per-row HTTP
// lookups. It is project metadata, never a place for credentials.
Federation *QueryFederation `json:"federation,omitempty" yaml:"federation,omitempty"`
RelationshipBindings QueryRelationshipBindings `json:"relationshipBindings,omitempty" yaml:"relationshipBindings,omitempty"`
}
QueryDef holds query data For HTTP request host, port, etc, are stored in Targets property,
func (QueryDef) ContextVariablesUsed ¶ added in v0.127.0
ContextVariablesUsed returns, sorted and once each, the context variables a TugQL query uses as a "{name}" path segment or a "@name" bound value. It returns nil for other query types and for a body that does not parse.
func (QueryDef) HTTPTemplate ¶ added in v0.74.0
func (v QueryDef) HTTPTemplate() HTTPRequestTemplate
HTTPTemplate is the request template of an HTTP query: its URL (Text) and saved method, headers and body.
func (QueryDef) RefuseContextVariables ¶ added in v0.127.0
RefuseContextVariables returns a ContextVariableNotBoundError naming every context variable the query uses. The Go runtime does not bind context variables, so DataTug Core and the CLI call it before opening any connection rather than run the query with an empty value.
func (*QueryDef) UnmarshalJSON ¶ added in v0.70.0
func (*QueryDef) UnmarshalYAML ¶ added in v0.70.0
func (QueryDef) Validate ¶
Validate returns error if not valid. A QueryDef is persisted to git-tracked project files, so besides its structure every string it persists is screened for credential material - by meaning (EmbeddedCredentialReason, query_credentials.go) where the value is free text, and by shape (identifierShapeReason, query_storage_screen.go) where it names something. The fields with a bespoke refusal message are screened inline below - the title, the purpose, the text whatever the query type, every target and every parameter default; the rest are swept by screenQueryDefForStorage, whose doc comment tables every persisted string and the screen it gets. Every save path validates through here. A query captured from exploration is additionally checked for complete, consistent provenance (QueryCapture.validateCaptureAgainst, query_capture.go).
func (QueryDef) ValidateCreationMetadata ¶ added in v0.68.0
ValidateCreationMetadata validates persisted records, after server metadata assignment. QueryDef.Validate remains the draft/input contract and does not trust client dates.
type QueryDefBrief ¶
type QueryDefBrief struct {
CreatedAt string `json:"createdAt" yaml:"createdAt"`
ProjItemBrief
Type string `json:"type"` // Possible value: folder, DDL, GraphQL, etc.
Draft bool `json:"draft,omitempty" yaml:"draft,omitempty"`
}
func (QueryDefBrief) Validate ¶
func (v QueryDefBrief) Validate() error
type QueryDefTarget ¶
type QueryDefTarget struct {
Driver string `json:"driver,omitempty" yaml:"driver,omitempty"`
Catalog string `json:"catalog,omitempty" yaml:"catalog,omitempty"`
Protocol string `json:"protocol,omitempty" yaml:"protocol,omitempty"`
Host string `json:"host,omitempty" yaml:"host,omitempty"`
Port int `json:"port,omitempty" yaml:"port,omitempty"`
Credentials
}
QueryDefTarget defines target of query
func (QueryDefTarget) Validate ¶ added in v0.17.0
func (v QueryDefTarget) Validate() error
Validate returns error if not valid. QueryDefTarget is persisted to git-tracked project files, so it must never carry credential material: a non-empty password, or a secret embedded in any of its connection-string-like fields (driver, catalog, protocol, host, and the username itself) in any syntax EmbeddedCredentialReason recognizes (query_credentials.go). A username alone is allowed.
type QueryDefWithFolderPath ¶
QueryDefWithFolderPath adds folder path to query definition
func (*QueryDefWithFolderPath) UnmarshalJSON ¶ added in v0.70.0
func (v *QueryDefWithFolderPath) UnmarshalJSON(data []byte) error
func (*QueryDefWithFolderPath) UnmarshalYAML ¶ added in v0.70.0
func (v *QueryDefWithFolderPath) UnmarshalYAML(node *yaml.Node) error
func (QueryDefWithFolderPath) Validate ¶
func (v QueryDefWithFolderPath) Validate() error
Validate returns error if not valid
type QueryExpectedServerIdentity ¶ added in v0.71.0
type QueryExpectedServerIdentity struct {
BaseURL string `json:"baseUrl" yaml:"baseUrl"`
ServerID string `json:"serverId" yaml:"serverId"`
}
QueryExpectedServerIdentity pins descriptive identity, never source authority. Adapters must independently match their admitted origin and returned server.
func (*QueryExpectedServerIdentity) UnmarshalJSON ¶ added in v0.71.0
func (v *QueryExpectedServerIdentity) UnmarshalJSON(data []byte) error
func (*QueryExpectedServerIdentity) UnmarshalYAML ¶ added in v0.71.0
func (v *QueryExpectedServerIdentity) UnmarshalYAML(n *yaml.Node) error
func (QueryExpectedServerIdentity) Validate ¶ added in v0.71.0
func (v QueryExpectedServerIdentity) Validate() error
type QueryFederation ¶ added in v0.41.2
type QueryFederation struct {
ExpectedServerIdentity *QueryExpectedServerIdentity `json:"expectedServerIdentity,omitempty" yaml:"expectedServerIdentity,omitempty"`
OVDBBaseURL string `json:"ovdbBaseUrl,omitempty" yaml:"ovdbBaseUrl,omitempty"`
Tables []QueryFederationTable `json:"tables,omitempty" yaml:"tables,omitempty"`
Lookups []QueryHTTPLookup `json:"lookups,omitempty" yaml:"lookups,omitempty"`
// IngitdbSources names databases a client reads straight from their public
// Git host (inGitDB published views), each described by an OVDB descriptor
// at a public HTTPS URL. Metadata only: no credential, no execution grant.
IngitdbSources []QueryIngitdbSource `json:"ingitdbSources,omitempty" yaml:"ingitdbSources,omitempty"`
}
func (*QueryFederation) UnmarshalJSON ¶ added in v0.71.0
func (v *QueryFederation) UnmarshalJSON(data []byte) error
func (*QueryFederation) UnmarshalYAML ¶ added in v0.71.0
func (v *QueryFederation) UnmarshalYAML(n *yaml.Node) error
type QueryFederationTable ¶ added in v0.41.2
type QueryFolderBrief ¶
type QueryFolderBrief struct {
ProjItemBrief
Folders []*QueryFolderBrief `json:"folders,omitempty" yaml:"folders,omitempty"`
Items []*QueryDefBrief `json:"items,omitempty" yaml:"items,omitempty"`
}
QueryFolderBrief defines brief for queries folder
func (QueryFolderBrief) Validate ¶
func (v QueryFolderBrief) Validate() error
Validate returns error if not valid
type QueryFolderDirectories ¶ added in v0.125.0
type QueryFolderDirectories interface {
CreateQueryFolder(context.Context, string, string) error
DeclaredQueryFolders(context.Context) ([]string, error)
}
QueryFolderDirectories is an optional native provider capability. These are directories under queries/, distinct from the legacy general FoldersStore. Deletion/archive require the independent project lifecycle capability.
type QueryFolders ¶
type QueryFolders []*QueriesFolder
QueryFolders defines slice
func (QueryFolders) Validate ¶
func (v QueryFolders) Validate() error
Validate returns error if not valid
type QueryHTTPLookup ¶ added in v0.41.2
type QueryHTTPLookup struct {
Database string `json:"database" yaml:"database"`
Collection string `json:"collection" yaml:"collection"`
FromColumn string `json:"fromColumn" yaml:"fromColumn"`
Fields []QueryLookupField `json:"fields" yaml:"fields"`
Concurrency int `json:"concurrency,omitempty" yaml:"concurrency,omitempty"`
}
QueryHTTPLookup reads one OVDB record per result row. Source maps a field in the returned JSON object to Target in the output recordset.
type QueryHTTPRequest ¶ added in v0.73.0
type QueryHTTPRequest struct {
Method string `json:"method,omitempty" yaml:"method,omitempty" firestore:"method,omitempty"`
Headers []HTTPHeaderItem `json:"headers,omitempty" yaml:"headers,omitempty" firestore:"headers,omitempty"`
Body string `json:"body,omitempty" yaml:"body,omitempty" firestore:"body,omitempty"`
}
QueryHTTPRequest is the saved request of an HTTP query beyond its URL, which stays in QueryDef.Text. It never holds credentials.
func (*QueryHTTPRequest) Validate ¶ added in v0.73.0
func (v *QueryHTTPRequest) Validate() error
Validate returns error if not valid. A nil request is valid (plain GET).
type QueryIngitdbSource ¶ added in v0.75.0
type QueryIngitdbSource struct {
Database string `json:"database" yaml:"database"`
Descriptor string `json:"descriptor" yaml:"descriptor"`
}
QueryIngitdbSource maps a federation database name to the OVDB descriptor (an ovdb-manifest/draft-1 with storage.engine ingitdb) that says where its inGitDB data lives.
func (QueryIngitdbSource) Validate ¶ added in v0.75.0
func (v QueryIngitdbSource) Validate() error
Validate requires a simple database name and a public HTTPS descriptor URL with no credentials, port, query or fragment.
type QueryLookupField ¶ added in v0.41.2
type QueryMeaning ¶ added in v0.53.0
type QueryMeaning struct {
Format string `json:"format"`
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Models QueryMeaningModels `json:"models"`
Concepts []QueryMeaningConcept `json:"concepts"`
}
type QueryMeaningBinding ¶ added in v0.53.0
type QueryMeaningConcept ¶ added in v0.53.0
type QueryMeaningConcept struct {
MeaningRef *MeaningReference `json:"meaningRef,omitempty"`
ID string `json:"id"`
Kind string `json:"kind"`
Labels QueryMeaningLabels `json:"labels"`
Description string `json:"description"`
Of string `json:"of,omitempty"`
Bindings []QueryMeaningBinding `json:"bindings,omitempty"`
}
type QueryMeaningLabels ¶ added in v0.53.0
type QueryMeaningLabels struct {
En string `json:"en"`
}
type QueryMeaningModels ¶ added in v0.53.0
type QueryMeaningModels struct {
Query string `json:"query"`
}
type QueryModelField ¶ added in v0.53.0
type QueryModelField struct {
Type string `json:"type"`
}
type QueryModelModule ¶ added in v0.53.0
type QueryModelRecord ¶ added in v0.53.0
type QueryModelRecord struct {
Fields map[string]QueryModelField `json:"fields"`
}
type QueryModelRecords ¶ added in v0.53.0
type QueryModelRecords struct {
QueryResult QueryModelRecord `json:"QueryResult"`
}
type QueryModelSpec ¶ added in v0.53.0
type QueryModelSpec struct {
ModelSpec string `json:"modelspec"`
Module QueryModelModule `json:"module"`
Records QueryModelRecords `json:"records"`
}
type QueryRelationshipBinding ¶ added in v0.71.0
type QueryRelationshipBinding struct {
ID string `json:"id" yaml:"id"`
Version string `json:"version" yaml:"version"`
From QueryRelationshipEndpoint `json:"from" yaml:"from"`
To QueryRelationshipEndpoint `json:"to" yaml:"to"`
Pairs []QueryRelationshipFieldPair `json:"pairs" yaml:"pairs"`
}
QueryRelationshipBinding pins a revision of a source-admitted relationship. It is not a foreign-key registry or a grant to execute a join.
func (*QueryRelationshipBinding) UnmarshalJSON ¶ added in v0.71.0
func (v *QueryRelationshipBinding) UnmarshalJSON(data []byte) error
func (*QueryRelationshipBinding) UnmarshalYAML ¶ added in v0.71.0
func (v *QueryRelationshipBinding) UnmarshalYAML(n *yaml.Node) error
func (QueryRelationshipBinding) Validate ¶ added in v0.71.0
func (v QueryRelationshipBinding) Validate() error
type QueryRelationshipBindings ¶ added in v0.71.0
type QueryRelationshipBindings []QueryRelationshipBinding
func (*QueryRelationshipBindings) UnmarshalJSON ¶ added in v0.71.0
func (v *QueryRelationshipBindings) UnmarshalJSON(data []byte) error
func (*QueryRelationshipBindings) UnmarshalYAML ¶ added in v0.71.0
func (v *QueryRelationshipBindings) UnmarshalYAML(n *yaml.Node) error
type QueryRelationshipEndpoint ¶ added in v0.71.0
type QueryRelationshipEndpoint struct {
Schema string `json:"schema" yaml:"schema"`
Table string `json:"table" yaml:"table"`
}
func (*QueryRelationshipEndpoint) UnmarshalJSON ¶ added in v0.71.0
func (v *QueryRelationshipEndpoint) UnmarshalJSON(data []byte) error
func (*QueryRelationshipEndpoint) UnmarshalYAML ¶ added in v0.71.0
func (v *QueryRelationshipEndpoint) UnmarshalYAML(n *yaml.Node) error
type QueryRelationshipFieldPair ¶ added in v0.71.0
type QueryRelationshipFieldPair struct {
FromField string `json:"fromField" yaml:"fromField"`
ToField string `json:"toField" yaml:"toField"`
}
func (*QueryRelationshipFieldPair) UnmarshalJSON ¶ added in v0.71.0
func (v *QueryRelationshipFieldPair) UnmarshalJSON(data []byte) error
func (*QueryRelationshipFieldPair) UnmarshalYAML ¶ added in v0.71.0
func (v *QueryRelationshipFieldPair) UnmarshalYAML(n *yaml.Node) error
type QueryResult ¶
type QueryResult struct {
Created time.Time `json:"created"`
EnvironmentID string `json:"env"`
Driver string `json:"driver"`
Target string `json:"target"`
Recordsets []Recordset `json:"recordset,omitempty"`
}
QueryResult holds results of a query execution
func (QueryResult) Validate ¶
func (v QueryResult) Validate() error
Validate returns error if not valid
type QueryRevision ¶ added in v0.28.0
type QueryRevision string
QueryRevision identifies one persisted state of a query's on-disk pair ("<id>.query.json" + its body sidecar, see pkg/datatug/doc.go). It is derived from the exact bytes a store persisted - metadata bytes, the body sidecar's type-derived extension and exact body bytes - so any change to either file, including one made outside the revisioned API (a hand edit, another process), produces a different revision and invalidates a writer holding the old one. It never depends on how a caller spelled the id to find the pair, so a record read through two spellings a file system resolves to the same files (e.g. letter case on macOS/Windows) has one revision. It carries no meaning beyond equality comparison: callers must not parse it or assume any ordering.
type QueryRevisionConflictError ¶ added in v0.28.0
type QueryRevisionConflictError struct {
FolderPath string
ID string
Expected QueryRevision // the revision the caller supplied, "" for an IfNoneMatch create
Actual QueryRevision // the record's current revision, "" if it does not exist
Reason string
}
QueryRevisionConflictError reports that a RevisionedQueriesStore.PutQuery or DeleteQueryRevision precondition was not met: an IfNoneMatch create found an existing record, or an IfMatch/expected revision did not equal the record's current revision (including because the record does not exist, reported with Actual == ""). No persisted file was changed.
func (*QueryRevisionConflictError) Error ¶ added in v0.28.0
func (e *QueryRevisionConflictError) Error() string
func (*QueryRevisionConflictError) Unwrap ¶ added in v0.28.0
func (e *QueryRevisionConflictError) Unwrap() error
Unwrap makes errors.Is(err, ErrQueryRevisionConflict) true for every *QueryRevisionConflictError.
type QuerySemanticBasis ¶ added in v0.53.0
type QuerySemanticBasis struct {
QueryHash string `json:"queryHash"`
ResultIndex int `json:"resultIndex"`
Columns []QuerySemanticColumn `json:"columns"`
}
type QuerySemanticBinding ¶ added in v0.53.0
type QuerySemanticColumn ¶ added in v0.53.0
type QuerySemanticModel ¶ added in v0.53.0
type QuerySemanticModel struct {
Version int `json:"version"`
Basis QuerySemanticBasis `json:"basis"`
Meaning QueryMeaning `json:"meaning"`
Model QueryModelSpec `json:"model"`
Bindings []QuerySemanticBinding `json:"bindings"`
}
QuerySemanticModel is an atomic, query-scoped pair of portable metadata documents. It contains schema and meaning only, never result values.
func (*QuerySemanticModel) UnmarshalJSON ¶ added in v0.53.0
func (v *QuerySemanticModel) UnmarshalJSON(data []byte) error
UnmarshalJSON refuses unknown metadata instead of silently losing it on save.
func (QuerySemanticModel) Validate ¶ added in v0.53.0
func (v QuerySemanticModel) Validate() error
type QueryWriteCondition ¶ added in v0.28.0
type QueryWriteCondition struct {
IfNoneMatch bool
IfMatch QueryRevision
}
QueryWriteCondition is the optimistic-concurrency precondition a RevisionedQueriesStore.PutQuery call must supply: exactly one of IfNoneMatch (create - succeed only when no record currently exists) or IfMatch (update - succeed only when the current record's revision equals this value). Supplying both, or neither, is a caller error that PutQuery rejects before touching the file system.
type ReadmeEncoder ¶
type ReadmeEncoder interface {
ProjectSummaryToReadme(w io.Writer, project Project) error
DbServerToReadme(w io.Writer, repository *ProjectRepository, dbServer ProjDbServer) error
TableToReadme(w io.Writer, repository *ProjectRepository, catalog string, table *CollectionInfo, dbServer ProjDbServer) error
DbCatalogToReadme(w io.Writer, repository *ProjectRepository, dbServer ProjDbServer, catalog DbCatalog) error
}
ReadmeEncoder defines an interface for encoder implementation that writes to MD files
type Recordset ¶
type Recordset struct {
Duration time.Duration `json:"durationNanoseconds"`
Columns []RecordsetColumn `json:"columns"`
Rows [][]interface{} `json:"rows"`
}
Recordset holds data & stats for recordset returned by executed command
type RecordsetBaseDef ¶
type RecordsetBaseDef struct {
PrimaryKey *UniqueKey `json:"primaryKey,omitempty"`
ForeignKeys ForeignKeys `json:"foreignKeys,omitempty"`
AlternateKeys []UniqueKey `json:"alternateKeys,omitempty"`
ActiveIssues *Issues `json:"issues,omitempty"`
}
RecordsetBaseDef is used by: CollectionInfo, RecordsetDefinition
type RecordsetColumn ¶
type RecordsetColumn struct {
Name string `json:"name"`
DbType string `json:"dbType"`
Meta *EntityFieldRef `json:"meta"`
}
RecordsetColumn describes column in a recordset
func (RecordsetColumn) Validate ¶
func (v RecordsetColumn) Validate() error
Validate returns error if not valid
type RecordsetColumnDef ¶
type RecordsetColumnDef struct {
Name string `json:"name"`
Type string `json:"type"`
Required bool `json:"required,omitempty"`
Meta *EntityFieldRef `json:"meta,omitempty"`
HideIf HideRecordsetColIf `json:"hideIf,omitempty"`
}
RecordsetColumnDef defines a column of a recordset
func (RecordsetColumnDef) Validate ¶
func (v RecordsetColumnDef) Validate() error
Validate returns error if not valid
type RecordsetColumnDefs ¶
type RecordsetColumnDefs []RecordsetColumnDef
RecordsetColumnDefs is a slice of RecordsetColumnDef
func (RecordsetColumnDefs) HasColumn ¶
func (v RecordsetColumnDefs) HasColumn(name string, caseSensitive bool) bool
HasColumn checks if set of columns has a column with a given name
func (RecordsetColumnDefs) Validate ¶
func (v RecordsetColumnDefs) Validate() error
Validate returns error if not valid
type RecordsetDefinition ¶
type RecordsetDefinition struct {
ProjectItem
RecordsetBaseDef
Columns RecordsetColumnDefs `json:"columns,omitempty" yaml:"columns,omitempty"`
// -- formatting spacer --
Type string `json:"type" yaml:"type,omitempty"` // Supported types: "recordset", "json"
JSONSchema string `json:"jsonSchema,omitempty" yaml:"jsonSchema,omitempty"`
Files []string `json:"files,omitempty" yaml:"files,omitempty"`
Errors []string `json:"errors,omitempty"`
}
RecordsetDefinition describes dataset
func (RecordsetDefinition) Validate ¶
func (v RecordsetDefinition) Validate() error
Validate returns error if not valid
type RecordsetDefinitions ¶ added in v0.15.7
type RecordsetDefinitions []*RecordsetDefinition
type RecordsetDefinitionsStore ¶ added in v0.15.7
type RecordsetDefinitionsStore interface {
LoadRecordsetDefinitions(ctx context.Context, o ...StoreOption) ([]*RecordsetDefinition, error)
LoadRecordsetDefinition(ctx context.Context, id string, o ...StoreOption) (*RecordsetDefinition, error)
LoadRecordsetData(ctx context.Context, id string) (Recordset, error)
}
type RefByForeignKey ¶
type RefByForeignKey struct {
Name string `json:"name"`
Columns []string `json:"columns"`
MatchOption string `json:"matchOption,omitempty"`
UpdateRule string `json:"updateRule,omitempty"`
DeleteRule string `json:"deleteRule,omitempty"`
}
RefByForeignKey holds metadata about reference by FK
type ReferencedBy ¶ added in v0.16.0
type ReferencedBy struct {
DBCollectionKey
ForeignKeys []*RefByForeignKey `json:"foreignKeys"`
}
ReferencedBy holds metadata about table/view that reference a table/view
type ReferencedBys ¶ added in v0.16.0
type ReferencedBys []*ReferencedBy
ReferencedBys defines slice
func (ReferencedBys) Validate ¶ added in v0.16.0
func (v ReferencedBys) Validate() error
Validate returns error if not valid
type RegexpValueCheck ¶
type RegexpValueCheck struct {
Regexp string `json:"regexp"`
}
RegexpValueCheck test value with regular expression
func (RegexpValueCheck) Validate ¶
func (v RegexpValueCheck) Validate() error
Validate returns error if not valid
type RepoRootFile ¶ added in v0.15.11
type RepoRootFile struct {
// List of paths to DataTug projects
Projects []string `json:"projects,omitempty" yaml:"projects,omitempty"`
}
type RevisionedQueriesStore ¶ added in v0.28.0
type RevisionedQueriesStore interface {
// LoadQueryRevision loads the query at id (a "<folder>/.../<id>" path,
// like QueriesStore.LoadQuery) together with the revision of the exact
// bytes it was read from. Unlike the tolerant QueriesStore.LoadQuery, it
// rejects an incomplete committed pair (IncompleteQueryRecordError)
// rather than silently treating a missing body sidecar as an empty body.
LoadQueryRevision(ctx context.Context, id string, o ...StoreOption) (*StoredQuery, error)
// PutQuery creates or updates a query under condition. condition must set
// exactly one of IfNoneMatch or IfMatch; a request that sets neither or
// both fails validation before any I/O. On success it returns the stored
// query and its new revision. A failed precondition - the query already
// exists for IfNoneMatch, or the current revision does not equal IfMatch
// (including because the record does not exist) - returns a
// QueryRevisionConflictError and leaves every persisted file unchanged.
PutQuery(ctx context.Context, query *QueryDefWithFolderPath, condition QueryWriteCondition) (*StoredQuery, error)
// DeleteQueryRevision deletes the query at id only when its current
// revision equals expected. A stale or missing revision returns a
// QueryRevisionConflictError and leaves every persisted file unchanged.
DeleteQueryRevision(ctx context.Context, id string, expected QueryRevision) error
}
RevisionedQueriesStore extends QueriesStore with optimistic-concurrency operations for capturing a query as a project asset: create-only, update-if-unchanged and delete-if-unchanged. It is additive - every QueriesStore implementation may add it without breaking source compatibility with existing callers of the plain interface.
Implementations must persist QueryDefWithFolderPath.QueryDef.Text and its JSON metadata as one recoverable logical transaction (see pkg/storage/filestore's query transaction helpers): participating readers never observe a mix of an old and a new revision's bytes, and an interrupted write leaves either the previous complete revision or the new complete revision on disk, never a torn pair.
type SQLCheck ¶
type SQLCheck struct {
Query string `json:"query"`
}
SQLCheck holds and DDL that verifies data
type SQLRowLink ¶ added in v0.130.0
type SQLRowLink struct {
BoardID string `json:"boardId,omitempty"`
QueryID string `json:"queryId,omitempty"`
ProjectID string `json:"projectId,omitempty"`
StoreID string `json:"storeId,omitempty"`
Parameters []SQLRowLinkParameter `json:"parameters,omitempty"`
}
SQLRowLink is the board or saved query a result row opens, exactly one of them, in this project or, with ProjectID, another one. All but Parameters may hold {column} placeholders, filled from the row by the viewer.
func (SQLRowLink) Validate ¶ added in v0.130.0
func (v SQLRowLink) Validate() error
Validate returns error if not valid
type SQLRowLinkParameter ¶ added in v0.130.0
type SQLRowLinkParameter struct {
ID string `json:"id"`
Column string `json:"column,omitempty"`
Value string `json:"value,omitempty"`
}
SQLRowLinkParameter sets one target board parameter from a result column or a literal value: exactly one of them.
type SQLWidgetDef ¶
type SQLWidgetDef struct {
WidgetBase
SQL SQLWidgetSettings `json:"sql"`
// Source, when set, takes the rows from a card parameter instead of a saved
// query. It is exclusive with SQL, which then stays absent in JSON.
Source *ParameterRowsSource `json:"source,omitempty"`
}
SQLWidgetDef holds info about a widget that makes SQL queries
func (SQLWidgetDef) MarshalJSON ¶ added in v0.72.0
func (v SQLWidgetDef) MarshalJSON() ([]byte, error)
MarshalJSON leaves "sql" out of a widget whose rows come from a parameter.
func (*SQLWidgetDef) Validate ¶
func (v *SQLWidgetDef) Validate() error
Validate returns error if not valid
type SQLWidgetSettings ¶
type SQLWidgetSettings struct {
// QueryID references a QueryDef by id within the same project.
QueryID string `json:"queryId"`
// Parameters binds the referenced query's parameters.
Parameters WidgetParameterBindings `json:"parameters,omitempty"`
// PresentationFilter narrows an already admitted, complete result in the
// viewer. It is never sent to the referenced query as a parameter.
PresentationFilter *PresentationFilter `json:"presentationFilter,omitempty"`
// RowLink links each result row to another board of the same project.
RowLink *SQLRowLink `json:"rowLink,omitempty"`
}
SQLWidgetSettings binds a SQL widget to a query in the project's query library. It deliberately carries no query text and no execution target of its own: the text and the target come from the referenced QueryDef, and the environment is the viewer's choice at view time. Founder ruling 2026-09-09 ("I'm Ok with the suggested option 1"). The field shape below is the coding agent's design, not the founder's.
func (*SQLWidgetSettings) UnmarshalJSON ¶ added in v0.60.0
func (v *SQLWidgetSettings) UnmarshalJSON(data []byte) error
func (SQLWidgetSettings) Validate ¶
func (v SQLWidgetSettings) Validate() error
Validate returns error if not valid
type Schema ¶ added in v0.16.0
type Schema struct {
ProjectItem
Tables TableModels `json:"tables"`
Views TableModels `json:"views"`
}
Schema holds model for a DB schema
type SchemaDiff ¶
type SchemaDiff struct {
HitAndMiss
TablesDiff TablesDiff `json:"tablesDiff"`
ViewsDiff TablesDiff `json:"viewsDiff"`
}
SchemaDiff holds schema diffs
type SchemaModels ¶
type SchemaModels []*Schema
SchemaModels is a slice of *Schema
func (SchemaModels) GetByID ¶
func (v SchemaModels) GetByID(id string) (schemaModel *Schema)
GetByID return *Schema by GetID
type ServerRef ¶ added in v0.16.0
type ServerRef struct {
Driver string `json:"driver"`
Host string `json:"host,omitempty"`
Path string `json:"path,omitempty"` // A path to a folder with database files - to be used by SQLite, for example.
Port int `json:"port,omitempty"`
}
ServerRef hold info about DB server
func NewDbServer ¶
NewDbServer creates ServerRef
func (ServerRef) FileName ¶ added in v0.16.0
FileName returns a name for a file (probably should be moved to a func in filestore package)
type ServerReferences ¶
type ServerReferences []ServerRef
ServerReferences defines slice
func (ServerReferences) Validate ¶
func (v ServerReferences) Validate() error
Validate returns error if not valid
type StateByEnv ¶
StateByEnv states by env GetID
func (StateByEnv) Validate ¶
func (v StateByEnv) Validate() error
Validate returns error if not valid
type StatusReporter ¶ added in v0.15.11
type StoreBrief ¶ added in v0.14.1
type StoreBrief struct {
Type string `json:"type,omitempty" firestore:"type,omitempty" yaml:"type,omitempty"`
Title string `json:"title,omitempty" firestore:"title,omitempty" yaml:"title,omitempty"`
Projects map[string]ProjectBrief `json:"projects,omitempty" firestore:"projects,omitempty"`
}
StoreBrief stores info about datatug storage known to a user
func (StoreBrief) Validate ¶ added in v0.14.1
func (v StoreBrief) Validate() error
Validate returns error if not valid
type StoreOption ¶ added in v0.15.0
type StoreOption func(op *StoreOptions)
func Depth ¶ added in v0.16.0
func Depth(depth int) StoreOption
type StoreOptions ¶ added in v0.15.0
type StoreOptions struct {
// contains filtered or unexported fields
}
func GetStoreOptions ¶ added in v0.15.0
func GetStoreOptions(opts ...StoreOption) (o StoreOptions)
func (StoreOptions) Depth ¶ added in v0.16.0
func (o StoreOptions) Depth() int
func (StoreOptions) Next ¶ added in v0.16.0
func (o StoreOptions) Next() StoreOptions
func (StoreOptions) ToSlice ¶ added in v0.16.0
func (o StoreOptions) ToSlice() (options []StoreOption)
type StoredQuery ¶ added in v0.28.0
type StoredQuery struct {
Query QueryDefWithFolderPath
Revision QueryRevision
}
StoredQuery pairs a loaded/persisted query with the revision of the exact bytes it was loaded from or written as.
type StringPattern ¶
type StringPattern struct {
Type string `json:"type,omitempty"` // Options: regexp, exact
Value string `json:"value,omitempty"`
CaseSensitive bool `json:"caseSensitive,omitempty"`
}
StringPattern hold patterns for names
func (StringPattern) Validate ¶
func (v StringPattern) Validate() error
Validate returns error if not valid
type StringPatterns ¶
type StringPatterns []*StringPattern
StringPatterns is a slice of *StringPattern
func (StringPatterns) Validate ¶
func (v StringPatterns) Validate() error
Validate returns error if not valid
type TabWidget ¶
type TabWidget struct {
// ID is a stable identity for newly authored tabs. Legacy tabs may omit it.
ID string `json:"id,omitempty"`
Title string `json:"title"`
Widget BoardWidget `json:"widget,omitempty"`
// Widgets are the tab's widgets, rendered in order; each may carry its
// own title. The legacy single Widget still loads.
Widgets []BoardWidget `json:"widgets,omitempty"`
}
TabWidget describes a tab widget
func (TabWidget) MarshalJSON ¶ added in v0.72.0
MarshalJSON leaves out the legacy single widget of a tab that has none, so a tab that holds only Widgets does not marshal as "widget":{"name":""}.
type TableColumns ¶
type TableColumns []*ColumnInfo
TableColumns defines slice
func (TableColumns) ByPrimaryKeyPosition ¶
func (v TableColumns) ByPrimaryKeyPosition() sort.Interface
ByPrimaryKeyPosition returns sort interface
func (TableColumns) Validate ¶
func (v TableColumns) Validate() error
Validate returns error if not valid
type TableDiff ¶
type TableDiff struct {
HitAndMiss
ColumnsDiff ColumnsDiff `json:"columnsDiff"`
}
TableDiff holds table diffs
type TableForeignKeys ¶ added in v0.43.0
type TableForeignKeys struct {
// Table is the table that holds the keys.
Table DBCollectionKey
ForeignKeys ForeignKeys
}
TableForeignKeys are the foreign keys held by one table.
type TableIndexes ¶ added in v0.78.0
type TableIndexes struct {
// Table is the table the indexes are on.
Table DBCollectionKey
Indexes []*Index
}
TableIndexes are the indexes of one table.
type TableKeys ¶
type TableKeys []DBCollectionKey
TableKeys is a []DBCollectionKey
func (TableKeys) MarshalJSON ¶ added in v0.62.0
func (*TableKeys) UnmarshalJSON ¶ added in v0.62.0
type TableModel ¶
type TableModel struct {
DBCollectionKey
DbType string `json:"dbType,omitempty"` // e.g. "BASE TABLE", "VIEW", etc.
Columns ColumnModels
Checks Checks `json:"checks,omitempty"` // References to checks by type/id
ByEnv StateByEnv `json:"byEnv,omitempty"`
}
TableModel hold models for table or view
func (*TableModel) String ¶
func (v *TableModel) String() string
func (*TableModel) Validate ¶
func (v *TableModel) Validate() error
Validate returns error if not valid
type TableModels ¶
type TableModels []*TableModel
TableModels is a slice of *TableModel
func (TableModels) GetByKey ¶
func (v TableModels) GetByKey(k DBCollectionKey) *TableModel
GetByKey returns table by key (name, schema, catalog)
func (TableModels) GetByName ¶
func (v TableModels) GetByName(name string) *TableModel
GetByName returns table by name
type TableProps ¶
type TableProps struct {
DbType string `json:"dbType,omitempty"` // e.g. "BASE TABLE", "VIEW", "Collection", etc.
UniqueKeys []*UniqueKey `json:"uniqueKeys,omitempty"`
}
TableProps holds properties of a table
func (TableProps) Validate ¶
func (v TableProps) Validate() error
Validate returns error if not valid
type Tables ¶
type Tables []*CollectionInfo
Tables is a slice of *CollectionInfo
func (Tables) GetByKey ¶
func (v Tables) GetByKey(k DBCollectionKey) *CollectionInfo
GetByKey return 9a *CollectionInfo by key or nil if not found
type TabsWidgetDef ¶
type TabsWidgetDef struct {
WidgetBase
Tabs []TabWidget `json:"tabs"`
}
TabsWidgetDef describes set of tab widgets
func (TabsWidgetDef) Validate ¶
func (v TabsWidgetDef) Validate() error
Validate returns error if not valid
type TextWidgetDef ¶ added in v0.72.0
type TextWidgetDef struct {
WidgetBase
Markdown string `json:"markdown"`
}
TextWidgetDef is the `text` widget: markdown with {{parameterId}} placeholders.
func (*TextWidgetDef) Validate ¶ added in v0.72.0
func (v *TextWidgetDef) Validate() error
Validate returns error if not valid.
type TimelineChartSpec ¶ added in v0.61.0
type TimelineChartSpec struct {
TimeMode string `json:"timeMode,omitempty" yaml:"timeMode,omitempty"`
AnchorColumn string `json:"anchorColumn,omitempty" yaml:"anchorColumn,omitempty"`
LaneColumn string `json:"laneColumn" yaml:"laneColumn"`
EventColumn string `json:"eventColumn" yaml:"eventColumn"`
SequenceColumn string `json:"sequenceColumn" yaml:"sequenceColumn"`
TimeColumn string `json:"timeColumn" yaml:"timeColumn"`
ClockDomainColumn string `json:"clockDomainColumn" yaml:"clockDomainColumn"`
PrecisionColumn string `json:"precisionColumn" yaml:"precisionColumn"`
StatusColumn string `json:"statusColumn" yaml:"statusColumn"`
EvidenceRefColumn string `json:"evidenceRefColumn" yaml:"evidenceRefColumn"`
}
TimelineChartSpec maps one complete admitted held result into milestone lanes. timeColumn contains observed RFC3339 instants or null for unattempted events; sequenceColumn is an integer sequence within a lane/attempt. Clock domain and precision are per-row evidence, never inferred from labels or browser time. evidenceRefColumn contains typed artifact references resolved under current ACL, never a URL or protected cached row. Missing spans must remain unavailable.
func (*TimelineChartSpec) UnmarshalJSON ¶ added in v0.70.0
func (v *TimelineChartSpec) UnmarshalJSON(data []byte) error
func (*TimelineChartSpec) UnmarshalYAML ¶ added in v0.70.0
func (v *TimelineChartSpec) UnmarshalYAML(node *yaml.Node) error
func (TimelineChartSpec) Validate ¶ added in v0.61.0
func (s TimelineChartSpec) Validate() error
type TimingChartSpec ¶ added in v0.63.0
type TimingChartSpec struct {
RowKeyColumn string `json:"rowKeyColumn"`
LabelColumn string `json:"labelColumn"`
StartTimeColumn string `json:"startTimeColumn"`
EndTimeColumn string `json:"endTimeColumn"`
StartClockDomainColumn string `json:"startClockDomainColumn"`
EndClockDomainColumn string `json:"endClockDomainColumn"`
StartPrecisionColumn string `json:"startPrecisionColumn"`
EndPrecisionColumn string `json:"endPrecisionColumn"`
StartEvidenceRefColumn string `json:"startEvidenceRefColumn"`
EndEvidenceRefColumn string `json:"endEvidenceRefColumn"`
StartIdentityColumn string `json:"startIdentityColumn"`
EndIdentityColumn string `json:"endIdentityColumn"`
}
TimingChartSpec persists column mappings, not durations or protected results. Observed endpoint identity, clock/precision compatibility and admitted evidence must be checked against the held result by the provider/consumer.
func (*TimingChartSpec) UnmarshalJSON ¶ added in v0.63.0
func (s *TimingChartSpec) UnmarshalJSON(data []byte) error
UnmarshalJSON enforces the closed canonical mapping wire even in nested boards.
func (TimingChartSpec) Validate ¶ added in v0.63.0
func (s TimingChartSpec) Validate() error
type UniqueKey ¶
type UniqueKey struct {
Name string `json:"name"`
Columns []string `json:"columns"`
IsClustered bool `json:"isClustered,omitempty"`
}
UniqueKey holds metadata about unique key
type UniqueKeys ¶
type UniqueKeys []UniqueKey
UniqueKeys defines slice
func (UniqueKeys) Validate ¶
func (v UniqueKeys) Validate() error
Validate returns error if not valid
type User ¶ added in v0.14.1
type User struct {
Datatug *UserDatatugInfo `json:"datatug,omitempty" firestore:"datatug,omitempty"`
}
User defines a user record with props related to Datatug
type UserDatatugInfo ¶
type UserDatatugInfo struct {
Stores map[string]StoreBrief `json:"stores,omitempty" firestore:"stores,omitempty"`
}
UserDatatugInfo holds user info for DataTug project
func (UserDatatugInfo) Validate ¶
func (v UserDatatugInfo) Validate() error
Validate returns error if not valid
type ValueRegexCheck ¶
type ValueRegexCheck struct {
Regex string `json:"regex"`
}
ValueRegexCheck holds regex to check
type VarInfo ¶
type VarInfo struct {
Type string `json:"type" firestore:"type"`
Value string `json:"value,omitempty" firestore:"value,omitempty"`
}
VarInfo hold info about var type & value
type VarSetting ¶
type VarSetting struct {
Type string `json:"type" firestore:"type"`
ValuePattern string `json:"valuePattern,omitempty" firestore:"valuePattern,omitempty"`
Min *int `json:"min,omitempty" firestore:"min,omitempty"`
Max *int `json:"max,omitempty" firestore:"max,omitempty"`
}
VarSetting record
type Variables ¶
type Variables struct {
Vars map[string]VarInfo `json:"vars,omitempty" firestore:"vars,omitempty"`
}
Variables properties holder
type WatchCoordination ¶ added in v0.79.0
type WatchCoordination struct {
Endpoint string `json:"endpoint" firestore:"endpoint"`
Namespace string `json:"namespace" firestore:"namespace"`
}
WatchCoordination identifies the project's explicitly selected DataTug daemon. Storage settings, user tokens, runner credentials and personal definitions belong to the coordinator deployment, never this shared project descriptor.
func (*WatchCoordination) UnmarshalJSON ¶ added in v0.79.0
func (v *WatchCoordination) UnmarshalJSON(body []byte) error
func (*WatchCoordination) Validate ¶ added in v0.79.0
func (v *WatchCoordination) Validate() error
type WidgetBase ¶
type WidgetBase struct {
Title string `json:"title,omitempty"`
Parameters Parameters `json:"parameters,omitempty"`
}
WidgetBase is base struct for widgets
func (WidgetBase) Validate ¶
func (v WidgetBase) Validate(isTitleRequired bool) error
Validate returns error if not valid
type WidgetParameterBinding ¶ added in v0.25.0
type WidgetParameterBinding struct {
// ID is the id of the referenced query's parameter.
ID string `json:"id"`
// Value is a constant value for the parameter, e.g. recorded by
// "pin this result to a board". Mutually exclusive with BoardParameterID.
Value interface{} `json:"value,omitempty"`
// BoardParameterID takes the value from the board parameter with this id,
// so a viewer changing a board parameter re-runs the widget's query.
// Mutually exclusive with Value.
BoardParameterID string `json:"boardParameterId,omitempty"`
}
WidgetParameterBinding binds one parameter of the referenced query to either a constant value or one of the board's own parameters.
func (WidgetParameterBinding) Validate ¶ added in v0.25.0
func (v WidgetParameterBinding) Validate() error
Validate returns error if not valid. Neither Value nor BoardParameterID being set is VALID: it means "use the query parameter's own default", i.e. ParameterDef.DefaultValue for the referenced query parameter.
type WidgetParameterBindings ¶ added in v0.25.0
type WidgetParameterBindings []WidgetParameterBinding
WidgetParameterBindings is a slice of WidgetParameterBinding.
func (WidgetParameterBindings) Validate ¶ added in v0.25.0
func (v WidgetParameterBindings) Validate() error
Validate returns error if not valid
Source Files
¶
- api_catalog.go
- board_create.go
- boards.go
- boards_evidence_charts.go
- cards.go
- change_type.go
- changeset.go
- checks.go
- columns.go
- comparison_mapping_codec.go
- connections.go
- created_at.go
- credentials.go
- datasets.go
- db_collection.go
- db_collection_key.go
- db_model.go
- db_objects.go
- dbcatalog.go
- diffs.go
- doc.go
- encoder.go
- entities.go
- entity_tables_json.go
- env_db.go
- env_db_server.go
- env_server.go
- env_summary.go
- environment.go
- environment_json.go
- environment_order.go
- errors.go
- folder.go
- helpers.go
- interfaces.go
- log_sources.go
- models.go
- parameters.go
- proj_item.go
- proj_loader.go
- project.go
- project_coordination.go
- project_data_models.go
- project_databases.go
- project_definition_dependencies.go
- project_environment_json.go
- project_file_json.go
- project_lifecycle.go
- project_lifecycle_review.go
- project_lifecycle_store.go
- project_meanings.go
- project_meanings_bounds.go
- project_usage_revision.go
- query.go
- query_capture.go
- query_comparison.go
- query_context_variables.go
- query_credentials.go
- query_folders.go
- query_http.go
- query_http_template.go
- query_http_values.go
- query_revision.go
- query_revision_errors.go
- query_semantic_model.go
- query_source_bindings.go
- query_storage_screen.go
- recordset.go
- recordset_def.go
- repository_root_datatug_file.go
- scripts.go
- server.go
- store_interfaces.go
- store_options.go
- tag.go
- types.go
- user.go
- variables.go