sqlcwrap

package
v0.0.7 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const EntliteAccessFileName = "entlite_access.go"

EntliteAccessFileName exposes the connection handle sqlc keeps unexported. sqlc only rewrites its own files, so this one survives regeneration.

Variables

This section is empty.

Functions

func Generate

func Generate(inputFilePath string, pbDir string, parsedEntities []schema.Entity, entityImports map[string]internalParser.ImportInfo, sqlDialect schema.SQLDialect) (string, error)

func GenerateAccessFile

func GenerateAccessFile(packageName string) string

GenerateAccessFile emits EntliteAccessFileName. The wrapper needs the handle to open a transaction around multi-row operations.

func GenerateConvertFile

func GenerateConvertFile(packageName string, entities []schema.Entity, sqlDialect schema.SQLDialect) string

func GoTypeFor added in v0.0.3

func GoTypeFor(fieldType schema.FieldType) string

func PackageNameOf

func PackageNameOf(dir string) (string, error)

PackageNameOf reads the package clause of the first Go file in dir. sqlc takes the name from sqlc.yaml, so it cannot be guessed from the directory.

Types

type FileType

type FileType int

FileType represents the type of sqlc-generated file being wrapped

const (
	FileTypeUnknown FileType = iota
	FileTypeQuery            // *.sql.go files (queries.sql.go, etc.)
	FileTypeModel            // models.go
	FileTypeDB               // db.go
)

Jump to

Keyboard shortcuts

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