Closed goliatone closed 1 year ago
By default the package name is the same as --output-dir
. Is the use-case to set a different package name from the output directory?
Going to close. Re-open if you need something beyond what --output-dir
does.
The only issue is when using --output-dir .
it generated package .
which is invalid, but using pwd
instead works.
Context
all: ../../db/schema.sql
pggen gen go --schema-glob '../../db/schema.sql' --query-glob '../../db/queries/*.sql' -output-dir "$(PWD)"
../../db/schema.sql:
$(MAKE) -C ../../db/ schema.sql
.PHONY: clean
clean:
rm *.sql.go
Would of preferred to of done
all: ../../db/schema.sql
pggen gen go --schema-glob '../../db/schema.sql' --query-glob '../../db/queries/*.sql' -output-dir . --go-package storage
The only issue is when using --output-dir . it generated package .
Oh, that's a silly bug worth fixing. I'll re-open with an aim of fixing that.
Is there a way to configure the package in the generated file?
Looking here the mapping from flags to
pggen.GenerateOptions
it seems we are missing a flag forGoPackage
? I was expecting to be able to use a--go-package
flag to set a custom package name.