{"modulePath":"github.com/viant/datly","version":"v1.1.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package sequencer\n\nPackage sequencer provides SQLX-backed identifier allocation.\n\n## Types\n\n```go\ntype Sequence struct {\n\tValue       int64\n\tIncrementBy int64\n}\n```\nSequence represents a sequence.\n\n```go\ntype Service struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc New(db *sql.DB, tx ...*sql.Tx) *Service\n```\n\n```go\nfunc (s *Service) Allocate(ctx context.Context, table string, dest any, selector string) error\n```\n\n```go\nfunc (s *Service) Reserve(ctx context.Context, table string, dest any, selector string) error\n```\nReserve records supplied values before the first allocation for a table. It does not allocate, change the destination, or advance a database sequence. Callers with original-presence evidence pass only originally supplied rows. Native metadata unifies supplied-only aliases before allocation. A supplied transaction acquires native write intent before reading sequence identity.\n\n```go\nfunc (s *Service) WithStrategy(strategy dialect.PresetIDStrategy) *Service\n```\nWithStrategy explicitly selects a native strategy. Empty means the product default; Datly never substitutes a strategy based on transaction presence. Configure before the service is first used.\n\n```go\ntype Walker struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewWalker(value interface{}, selectors []string) (*Walker, error)\n```\n\n```go\nfunc (w *Walker) Allocate(value interface{}, seq *Sequence) error\n```\nAllocate allocate sequence.\n\n```go\nfunc (w *Walker) CountEmpty(value interface{}) (int, error)\n```\n\n```go\nfunc (w *Walker) EmptyLeaf(value interface{}) (interface{}, error)\n```\nEmptyLeaf returns the first record whose leaf selector currently has a zero value.\n\n```go\nfunc (w *Walker) Leaf(value interface{}) (interface{}, error)\n```\nLeaf returns a leaf value.\n\n","path":"github.com/viant/datly/sql/sequencer","name":"sequencer","synopsis":"Package sequencer provides SQLX-backed identifier allocation.","isRedistributable":true}
