validation

package
v1.2.15 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GoType added in v1.0.0

func GoType(pkType PKType) string

GoType converts a PKType to its corresponding Go type string

func IsAutoIncrement added in v1.0.0

func IsAutoIncrement(dataType string) bool

IsAutoIncrement returns true if the data type is auto-incrementing (serial/bigserial)

func ValidatePrimaryKeyDatatype

func ValidatePrimaryKeyDatatype(dataType, databaseType, migrationFile, columnName string) error

ValidatePrimaryKeyDatatype validates primary key data types

Types

type PKType added in v1.0.0

type PKType string

PKType represents the type category of a primary key

const (
	// PKTypeUUID is a constant value for primary key type UUID.
	PKTypeUUID PKType = "uuid"
	// PKTypeInt32 is a constant value for primary key type int32.
	PKTypeInt32 PKType = "int32"
	// PKTypeInt64 is a constant value for primary key type int64.
	PKTypeInt64 PKType = "int64"
	// PKTypeString is a constant value for primary key type string.
	PKTypeString PKType = "string"
)

func ClassifyPrimaryKeyType added in v1.0.0

func ClassifyPrimaryKeyType(dataType string) (PKType, error)

ClassifyPrimaryKeyType determines the PKType for a given SQL data type

Jump to

Keyboard shortcuts

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