data

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package data compiles protobuf message descriptors into Invariant's language-neutral logical data schema.

Index

Constants

View Source
const (
	// IRVersion is the current SchemaBundle protobuf model version.
	IRVersion uint32 = 1

	// MappingVersion is the current protobuf-to-logical-type mapping version.
	MappingVersion uint32 = 1
)

Variables

This section is empty.

Functions

func CompileDescriptorBytes

func CompileDescriptorBytes(
	descriptor []byte,
	messageNames []string,
	previous *datav1.SchemaBundle,
) (*datav1.SchemaBundle, error)

CompileDescriptorBytes compiles the explicitly selected protobuf messages from a serialized FileDescriptorSet. Dataset roots are required: ordinary RPC request and response messages are not implicitly storage datasets.

Pass the last committed bundle as previous when evolving a schema. Stable field identities are retained by protobuf number path, and removed identities are permanently retired.

func CompileMessage

func CompileMessage(
	md protoreflect.MessageDescriptor,
	previous *datav1.DatasetSchema,
) (*datav1.DatasetSchema, error)

CompileMessage compiles one protobuf message descriptor into a logical dataset schema. The previous schema, when supplied, must be the prior state for the same fully-qualified protobuf message.

func FindDataset

func FindDataset(bundle *datav1.SchemaBundle, sourceMessage string) *datav1.DatasetSchema

FindDataset returns the dataset compiled from sourceMessage, if present.

func MarshalSchemaBundle

func MarshalSchemaBundle(bundle *datav1.SchemaBundle) ([]byte, error)

MarshalSchemaBundle validates and deterministically serializes a bundle.

func ParseSchemaBundle

func ParseSchemaBundle(encoded []byte) (*datav1.SchemaBundle, error)

ParseSchemaBundle decodes a bundle and rejects IR or mapping rules this package cannot interpret.

func ValidateSchemaBundle

func ValidateSchemaBundle(bundle *datav1.SchemaBundle) error

ValidateSchemaBundle rejects IR or mapping rules this package cannot interpret. It validates the artifact version, not every compiler invariant.

Types

This section is empty.

Directories

Path Synopsis
Package arrow projects Invariant's canonical protobuf data schema into an Apache Arrow schema.
Package arrow projects Invariant's canonical protobuf data schema into an Apache Arrow schema.
Package iceberg projects Invariant's canonical protobuf data schema into an official Apache Iceberg schema.
Package iceberg projects Invariant's canonical protobuf data schema into an official Apache Iceberg schema.
Package parquet projects Invariant's canonical protobuf data schema into an Apache Parquet schema through Arrow's official pqarrow bridge.
Package parquet projects Invariant's canonical protobuf data schema into an Apache Parquet schema through Arrow's official pqarrow bridge.
Package postgres projects Invariant's canonical protobuf data schema into PostgreSQL DDL.
Package postgres projects Invariant's canonical protobuf data schema into PostgreSQL DDL.

Jump to

Keyboard shortcuts

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