schema

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ObjectTypeNamedSchema          = internalschema.ObjectTypeNamedSchema
	ObjectTypeExtension            = internalschema.ObjectTypeExtension
	ObjectTypeEnum                 = internalschema.ObjectTypeEnum
	ObjectTypeTable                = internalschema.ObjectTypeTable
	ObjectTypeIndex                = internalschema.ObjectTypeIndex
	ObjectTypeForeignKeyConstraint = internalschema.ObjectTypeForeignKeyConstraint
	ObjectTypeSequence             = internalschema.ObjectTypeSequence
	ObjectTypeFunction             = internalschema.ObjectTypeFunction
	ObjectTypeProcedure            = internalschema.ObjectTypeProcedure
	ObjectTypeTrigger              = internalschema.ObjectTypeTrigger

	ObjectTypeCheckConstraint = internalschema.ObjectTypeCheckConstraint
	ObjectTypePolicy          = internalschema.ObjectTypePolicy
	ObjectTypeReplicaIdentity = internalschema.ObjectTypeReplicaIdentity
	ObjectTypePartitioning    = internalschema.ObjectTypePartitioning
)

Variables

View Source
var (
	WithIncludeSchemas = internalschema.WithIncludeSchemas
	WithExcludeSchemas = internalschema.WithExcludeSchemas

	// AllObjectTypes is the default set used when WithIncludeObjectTypes isn't
	// passed.
	AllObjectTypes = internalschema.AllObjectTypes
	// WithIncludeObjectTypes restricts the schema to the given object types.
	// Use it when the schema you are diffing against only models a subset of
	// Postgres, so the classes you don't model aren't seen as objects to drop.
	WithIncludeObjectTypes = internalschema.WithIncludeObjectTypes
)

Functions

func GetSchemaHash

func GetSchemaHash(ctx context.Context, queryable sqldb.Queryable, opts ...GetSchemaOpt) (string, error)

GetSchemaHash hash gets the hash of the target schema. It can be used to compare against the hash in the migration plan to determine if the plan is still valid.

We do not expose the Schema struct yet because it is subject to change, and we do not want folks depending on its API.

Types

type GetSchemaOpt

type GetSchemaOpt = internalschema.GetSchemaOpt

type ObjectType added in v0.9.0

type ObjectType = internalschema.ObjectType

ObjectType identifies a class of schema object. See WithIncludeObjectTypes.

Jump to

Keyboard shortcuts

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