This commit is contained in:
jdl
2024-11-19 16:30:42 +01:00
parent 0d8cc762c0
commit 9070d8cfc0
6 changed files with 43 additions and 24 deletions

View File

@@ -8,16 +8,16 @@ import (
"text/template"
)
//go:embed sqlite.go.tmpl
var sqliteTemplate string
//go:embed gen.go.tmpl
var fileTemplate string
func render(templateStr, schemaPath, outputPath string) error {
sch, err := parsePath(schemaPath)
func render(driver, schemaPath, outputPath string) error {
sch, err := parsePath(driver, schemaPath)
if err != nil {
return err
}
tmpl := template.Must(template.New("").Parse(templateStr))
tmpl := template.Must(template.New("").Parse(fileTemplate))
fOut, err := os.Create(outputPath)
if err != nil {
return err