util

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GeneratedGo  = "// Code generated by entlite. DO NOT EDIT.\n\n"
	GeneratedSQL = "-- Code generated by entlite. DO NOT EDIT.\n\n"
	GeneratedMD  = "<!-- Code generated by entlite. DO NOT EDIT. -->\n\n"
)

Variables

This section is empty.

Functions

func Diff

func Diff(expected, actual string) string

Diff styles cmp.Diff in readable format

func FindModuleInfo

func FindModuleInfo(startDir string) (moduleName string, rootDir string, err error)

FindModuleInfo walks up from startDir and returns the module name with the absolute directory holding go.mod. startDir may be relative or absolute.

func PathToImport

func PathToImport(path string) (string, error)

func ReservedNameSuffix added in v0.0.5

func ReservedNameSuffix(name string) string

func ValidateQueryNames added in v0.0.5

func ValidateQueryNames(entities []schema.Entity) error

check for name collision in sqlc and proto

Types

type BufGenConfig

type BufGenConfig struct {
	// ProtoTypesDir is where the buf.build/protocolbuffers/go plugin writes Go types
	ProtoTypesDir string
}

func GetBufConfigFromYaml

func GetBufConfigFromYaml(bufYamlPath string) (*BufGenConfig, error)

type SQLDialect

type SQLDialect string
const (
	MySQL      SQLDialect = "mysql"
	SQLite     SQLDialect = "sqlite"
	PostgreSQL SQLDialect = "postgresql"
)

type SqlcGenConfig

type SqlcGenConfig struct {
	InputDir string
	Dialect  schema.SQLDialect
}

func GetSqlcConfigFromYaml

func GetSqlcConfigFromYaml(sqlcYamlPath string) (*SqlcGenConfig, error)

Jump to

Keyboard shortcuts

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