2d3f4b4448
001_init.sql como espejo del schema, gentemplate para crear operations.db vacias con schema aplicado, y template lista para copiar con fn ops init.
28 lines
412 B
Go
28 lines
412 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
ops "fn-registry/fn_operations"
|
|
)
|
|
|
|
func main() {
|
|
path := "fn_operations/project_template/operations.db"
|
|
if len(os.Args) > 1 {
|
|
path = os.Args[1]
|
|
}
|
|
|
|
// Remove existing template
|
|
os.Remove(path)
|
|
|
|
db, err := ops.Open(path)
|
|
if err != nil {
|
|
fmt.Fprintf(os.Stderr, "error: %v\n", err)
|
|
os.Exit(1)
|
|
}
|
|
defer db.Close()
|
|
|
|
fmt.Printf("Template DB created at %s\n", path)
|
|
}
|