schemamode

package
v1.56.1 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package schemamode defines the schema storage mode for datastore operations. It is a leaf package so that configuration packages can name the mode without depending on pkg/datalayer itself.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SchemaMode

type SchemaMode uint8

SchemaMode represents the experimental schema mode for datastore operations. It controls how schema is read from and written to the datastore, allowing a gradual migration from legacy per-definition storage to unified schema storage.

const (
	// SchemaModeReadLegacyWriteLegacy uses legacy schema reader and writer.
	// This is the default and backward-compatible mode.
	SchemaModeReadLegacyWriteLegacy SchemaMode = iota

	// SchemaModeReadLegacyWriteBoth uses legacy schema reader and writes to both
	// legacy and unified schema storage. Use this as the first migration step.
	SchemaModeReadLegacyWriteBoth

	// SchemaModeReadNewWriteBoth uses unified schema reader and writes to both
	// legacy and unified schema storage. Use this as the second migration step.
	SchemaModeReadNewWriteBoth

	// SchemaModeReadNewWriteNew uses unified schema reader and writer only.
	// This is the final migration target.
	SchemaModeReadNewWriteNew
)

func ParseSchemaMode

func ParseSchemaMode(s string) (SchemaMode, error)

ParseSchemaMode converts a string to a SchemaMode. Returns an error if the string is invalid.

func (SchemaMode) ReadsFromNew

func (s SchemaMode) ReadsFromNew() bool

ReadsFromNew returns true if the mode reads from the unified schema storage.

func (SchemaMode) String

func (s SchemaMode) String() string

String returns the string representation of the SchemaMode.

func (SchemaMode) WritesToLegacy

func (s SchemaMode) WritesToLegacy() bool

WritesToLegacy returns true if the mode writes to legacy schema storage.

func (SchemaMode) WritesToNew

func (s SchemaMode) WritesToNew() bool

WritesToNew returns true if the mode writes to unified schema storage.

Jump to

Keyboard shortcuts

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