Documentation
¶
Index ¶
- func CI(homeDir func() (string, error), getWd func() (string, error), ...) *cobra.Command
- func Delete(homeDir func() (string, error), getWd func() (string, error), ...) *cobra.Command
- func Describe(homeDir func() (string, error), getWd func() (string, error), ...) *cobra.Command
- func Docs(homeDir func() (string, error), getWd func() (string, error), ...) *cobra.Command
- func Drop(homeDir func() (string, error), getWd func() (string, error), ...) *cobra.Command
- func Insert(homeDir func() (string, error), getWd func() (string, error), ...) *cobra.Command
- func List(homeDir func() (string, error), getWd func() (string, error), ...) *cobra.Command
- func Materialize(homeDir func() (string, error), getWd func() (string, error), ...) *cobra.Command
- func Pull() *cobra.Command
- func Rebase(getWd func() (string, error), ...) *cobra.Command
- func Resolve(homeDir func() (string, error), getWd func() (string, error), ...) *cobra.Command
- func ResolveDBPathArgs(dirPath string, homeDir func() (string, error), getWd func() (string, error)) (string, error)
- func Select(homeDir func() (string, error), getWd func() (string, error), ...) *cobra.Command
- func Serve(homeDir func() (string, error), getWd func() (string, error), ...) *cobra.Command
- func Setup() *cobra.Command
- func Update(homeDir func() (string, error), getWd func() (string, error), ...) *cobra.Command
- func Validate(homeDir func() (string, error), getWd func() (string, error), ...) *cobra.Command
- func Version(ver, commit, date string) *cobra.Command
- func Watch() *cobra.Command
- type GitHubDBFactory
- type GitHubFileReaderFactory
- type TreeWriterFactory
- type ViewBuilderFactory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CI ¶ added in v0.37.4
func CI( homeDir func() (string, error), getWd func() (string, error), readDefinition func(string, ...ingitdb.ReadOption) (*ingitdb.Definition, error), viewBuilder materializer.ViewBuilder, logf func(...any), ) *cobra.Command
CI returns the ci command. Currently it executes materialize; future versions may add CI-specific optimisations such as validating and materializing only the collections affected by a pull-request diff.
func Delete ¶
func Delete( homeDir func() (string, error), getWd func() (string, error), readDefinition func(string, ...ingitdb.ReadOption) (*ingitdb.Definition, error), newDB func(string, *ingitdb.Definition) (dal.DB, error), logf func(...any), ) *cobra.Command
Delete returns the `ingitdb delete` command. Two modes inherited from sqlflags: single-record (--id) and set (--from + --where|--all). --min-affected guards set-mode invocations with all-or-nothing destructive atomicity: when the matched count is below the threshold, NO record is deleted.
This command replaces the legacy `delete record`, `delete records`, `delete collection`, and `delete view` subcommands. Per cli-sql-verbs Idea: when a new verb's name collides with an old top-level command, the legacy parent is removed in the same release.
func Describe ¶ added in v1.11.0
func Describe( homeDir func() (string, error), getWd func() (string, error), readDefinition func(string, ...ingitdb.ReadOption) (*ingitdb.Definition, error), ) *cobra.Command
Describe returns the `ingitdb describe` command. Two kinds are supported: `describe collection <name>` (alias `table`) and `describe view <name>` (with `--in=<collection>` to disambiguate). `desc` is registered as a top-level alias for `describe`.
func Docs ¶ added in v0.26.0
func Docs( homeDir func() (string, error), getWd func() (string, error), readDefinition func(string, ...ingitdb.ReadOption) (*ingitdb.Definition, error), logf func(...any), ) *cobra.Command
Docs returns the docs command.
func Drop ¶ added in v0.64.0
func Drop( homeDir func() (string, error), getWd func() (string, error), readDefinition func(string, ...ingitdb.ReadOption) (*ingitdb.Definition, error), newDB func(string, *ingitdb.Definition) (dal.DB, error), logf func(...any), ) *cobra.Command
Drop returns the `ingitdb drop` command. Two kinds are supported: `drop collection <name>` and `drop view <name>`. The flags --if-exists (idempotent on missing target) and --cascade (no-op in the current data model; reserved for future cross-object dependency graphs) are inherited by both subcommands.
func Insert ¶ added in v0.61.0
func Insert( homeDir func() (string, error), getWd func() (string, error), readDefinition func(string, ...ingitdb.ReadOption) (*ingitdb.Definition, error), newDB func(string, *ingitdb.Definition) (dal.DB, error), logf func(...any), stdin io.Reader, isStdinTTY func() bool, openEditor func(string) error, ) *cobra.Command
Insert returns the `ingitdb insert` command.
Required: --into=<collection>. Exactly one data source: --data, stdin (when not a TTY), --edit (opens $EDITOR), or --empty (key-only record). Record key comes from --key or a top-level $id field in the data; supplying both with different values is rejected.
func List ¶
func List( homeDir func() (string, error), getWd func() (string, error), readDefinition func(string, ...ingitdb.ReadOption) (*ingitdb.Definition, error), ) *cobra.Command
List returns the list command.
func Materialize ¶
func Materialize( homeDir func() (string, error), getWd func() (string, error), readDefinition func(string, ...ingitdb.ReadOption) (*ingitdb.Definition, error), viewBuilder materializer.ViewBuilder, logf func(...any), ) *cobra.Command
Materialize returns the materialize command.
func Resolve ¶
func Resolve( homeDir func() (string, error), getWd func() (string, error), readDefinition func(string, ...ingitdb.ReadOption) (*ingitdb.Definition, error), logf func(...any), isTerminal func() bool, runConflictsTUI func(ctx context.Context, files []string) error, ) *cobra.Command
Resolve returns the resolve command. It is the working-tree conflict engine: it auto-resolves merge conflicts in generated files (collection README.md) by regenerating them from source records and staging them, independent of which git operation produced the conflict. Source-data conflicts that need a human decision are handed to runConflictsTUI (interactive) on a terminal, or reported as text otherwise.
func ResolveDBPathArgs ¶ added in v0.52.0
func ResolveDBPathArgs( dirPath string, homeDir func() (string, error), getWd func() (string, error), ) (string, error)
ResolveDBPathArgs resolves a database directory path from an explicit dirPath string (e.g. from a --path flag already read by the caller), falling back to getWd when dirPath is empty. Home-directory expansion ("~") is applied via homeDir.
func Select ¶ added in v0.60.0
func Select( homeDir func() (string, error), getWd func() (string, error), readDefinition func(string, ...ingitdb.ReadOption) (*ingitdb.Definition, error), newDB func(string, *ingitdb.Definition) (dal.DB, error), logf func(...any), ) *cobra.Command
Select returns the `ingitdb select` command. It queries records from a single collection in either single-record mode (--id) or set mode (--from with optional --where/--order-by/--fields/--limit/--min-affected). Output format defaults to yaml in single-record mode and csv in set mode.
func Serve ¶
func Serve( homeDir func() (string, error), getWd func() (string, error), readDefinition func(string, ...ingitdb.ReadOption) (*ingitdb.Definition, error), newDB func(string, *ingitdb.Definition) (dal.DB, error), logf func(...any), ) *cobra.Command
Serve returns the serve command.
func Update ¶ added in v0.9.0
func Update( homeDir func() (string, error), getWd func() (string, error), readDefinition func(string, ...ingitdb.ReadOption) (*ingitdb.Definition, error), newDB func(string, *ingitdb.Definition) (dal.DB, error), logf func(...any), ) *cobra.Command
Update returns the `ingitdb update` command. Two modes inherited from sqlflags: single-record (--id) and set (--from + --where|--all). Patch operations: --set (repeatable assignment) and --unset (comma-separated field list). Shallow patch at the top level. --min-affected guards set-mode invocations with all-or-nothing semantics.
func Validate ¶
func Validate( homeDir func() (string, error), getWd func() (string, error), readDefinition func(string, ...ingitdb.ReadOption) (*ingitdb.Definition, error), dataVal datavalidator.DataValidator, incVal datavalidator.IncrementalValidator, logf func(...any), ) *cobra.Command
Validate returns the validate command.
Types ¶
type GitHubDBFactory ¶ added in v0.14.0
type GitHubDBFactory interface {
NewGitHubDBWithDef(cfg dalgo2ghingitdb.Config, def *ingitdb.Definition) (dal.DB, error)
}
GitHubDBFactory creates a GitHub-backed DAL database.
type GitHubFileReaderFactory ¶ added in v0.14.0
type GitHubFileReaderFactory interface {
NewGitHubFileReader(cfg dalgo2ghingitdb.Config) (dalgo2ghingitdb.FileReader, error)
}
GitHubFileReaderFactory creates a GitHub file reader.
type TreeWriterFactory ¶ added in v1.1.0
type TreeWriterFactory interface {
NewTreeWriter(cfg dalgo2ghingitdb.Config) (treeWriter, error)
}
TreeWriterFactory creates a treeWriter for atomic multi-file commits.
type ViewBuilderFactory ¶ added in v0.14.0
type ViewBuilderFactory interface {
ViewBuilderForCollection(colDef *ingitdb.CollectionDef) (materializer.ViewBuilder, error)
}
ViewBuilderFactory creates a view builder for a collection.
Source Files
¶
- ci.go
- cobra_helpers.go
- conflict_resolver.go
- delete.go
- describe.go
- describe_format.go
- describe_output.go
- docs.go
- docs_update.go
- drop.go
- drop_remote.go
- drop_schema.go
- editor.go
- flags.go
- github_helpers.go
- insert.go
- insert_batch.go
- insert_context.go
- list.go
- materialize.go
- pull.go
- query_output.go
- rebase.go
- record_context.go
- record_merge_resolver.go
- record_projection.go
- remote_helpers.go
- resolve.go
- seams.go
- select.go
- select_output.go
- select_where.go
- serve.go
- serve_http.go
- serve_mcp.go
- setup.go
- update_new.go
- validate.go
- version.go
- view_builder_helper.go
- watch.go