Documentation
¶
Index ¶
- Constants
- func Generate(inputFilePath string, pbDir string, parsedEntities []schema.Entity, ...) (string, error)
- func GenerateAccessFile(packageName string) string
- func GenerateConvertFile(packageName string, entities []schema.Entity) string
- func PackageNameOf(dir string) (string, error)
- type FileType
Constants ¶
View Source
const EntliteAccessFileName = "entlite_access.go"
EntliteAccessFileName is the file entlite adds to sqlc's generated package to expose the connection handle that sqlc keeps in an unexported field. sqlc only rewrites the files it generates itself, 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 ¶
GenerateAccessFile emits the sqlc-package addition described above. The wrapper package needs the handle to open a transaction around multi-row operations; without it the unexported field is unreachable.
func GenerateConvertFile ¶
func PackageNameOf ¶
PackageNameOf reads the package clause of the first Go file in dir. sqlc's package name comes from sqlc.yaml and need not match the directory name, so it has to be read from the generated source rather than guessed.
Types ¶
Click to show internal directories.
Click to hide internal directories.