Documentation
¶
Overview ¶
Package sqlite reads v1 c1z files without modifying their SQLite database.
Index ¶
- Variables
- type ConvertOption
- type ConvertStageStats
- type ConvertStats
- type DiscardedSync
- type File
- func (f *File) Close(context.Context) error
- func (f *File) ResolveSyncID(ctx context.Context, behavior ResolveBehavior) (string, error)
- func (f *File) SyncRuns(ctx context.Context) ([]*c1zstore.SyncRun, error)
- func (f *File) ToPebble(ctx context.Context, outPath string, sourceSyncID string, ...) (*ConvertStats, error)
- func (f *File) ToPebbleOpen(ctx context.Context, outPath string, sourceSyncID string, ...) (_ c1zstore.Store, _ *ConvertStats, err error)
- type OpenOption
- type ResolveBehavior
Constants ¶
This section is empty.
Variables ¶
var ErrNoSyncRuns = errors.New("sqlite: source has no sync runs")
ErrNoSyncRuns reports that the source has no sync_runs rows.
Functions ¶
This section is empty.
Types ¶
type ConvertOption ¶
type ConvertOption func(*convertConfig)
ConvertOption configures ToPebble and ToPebbleOpen.
func WithBatchSize ¶
func WithBatchSize(n int) ConvertOption
WithBatchSize sets the number of records passed to each bulk-import call.
func WithConvertTmpDir ¶
func WithConvertTmpDir(dir string) ConvertOption
WithConvertTmpDir sets the destination engine's temporary directory.
func WithParallelism ¶
func WithParallelism(n int) ConvertOption
WithParallelism sets the grant scan lane count.
func WithResolveBehavior ¶
func WithResolveBehavior(behavior ResolveBehavior) ConvertOption
WithResolveBehavior selects how an empty source sync ID is resolved.
type ConvertStageStats ¶
ConvertStageStats records the rows and elapsed time for one conversion stage.
type ConvertStats ¶
type ConvertStats struct {
SourceSyncID string
DestSyncID string
ResourceTypes ConvertStageStats
Resources ConvertStageStats
Entitlements ConvertStageStats
Grants ConvertStageStats
Assets ConvertStageStats
AssetBytes int64
Sessions ConvertStageStats
DiscardedSyncs []DiscardedSync
Total time.Duration
// contains filtered or unexported fields
}
ConvertStats reports conversion row counts, timing, and omitted source syncs.
type DiscardedSync ¶
type DiscardedSync struct {
ID string
Type connectorstore.SyncType
StartedAt *time.Time
EndedAt *time.Time
}
DiscardedSync describes a source sync omitted from the single-sync destination.
type File ¶
type File struct {
// contains filtered or unexported fields
}
File is an open read-only v1 SQLite source.
func (*File) ResolveSyncID ¶
ResolveSyncID applies behavior to the source sync runs.
func (*File) ToPebble ¶
func (f *File) ToPebble( ctx context.Context, outPath string, sourceSyncID string, opts ...ConvertOption, ) (*ConvertStats, error)
ToPebble converts one source sync and closes the destination store.
func (*File) ToPebbleOpen ¶
func (f *File) ToPebbleOpen( ctx context.Context, outPath string, sourceSyncID string, opts ...ConvertOption, ) (_ c1zstore.Store, _ *ConvertStats, err error)
ToPebbleOpen converts one source sync and returns the destination store open. Callers that bind the converted sync and mutate records must clear inherited ingest-invariant verification, call EndSync, and restore the converted sync's source timestamps through pebble.AsEngine before Close.
type OpenOption ¶
type OpenOption func(*openConfig)
OpenOption configures Open.
func WithDecoderOptions ¶
func WithDecoderOptions(opts ...dotc1z.DecoderOption) OpenOption
WithDecoderOptions passes options to the v1 c1z decoder.
func WithTmpDir ¶
func WithTmpDir(dir string) OpenOption
WithTmpDir sets the directory used for a decoded v1 c1z database.
type ResolveBehavior ¶
type ResolveBehavior string
ResolveBehavior selects how an empty source sync ID is resolved.
const ( // ResolveNewest selects the newest finished or resumable sync before abandoned unfinished syncs. ResolveNewest ResolveBehavior = "newest" // ResolveFullFinished selects the latest finished full sync. ResolveFullFinished ResolveBehavior = "full_finished" )