Enable DEFINE EVENT queries in exported SQL

This commit is contained in:
Tobie Morgan Hitchcock 2019-02-01 00:13:24 +00:00
parent 71192d2e36
commit 775c3ca96a

View file

@ -48,21 +48,12 @@ func export(c *fibre.Context, NS, DB string) error {
defer executorPool.Put(exe) defer executorPool.Put(exe)
// ------------------------------ // ------------------------------
// Databases // Options
// ------------------------------ // ------------------------------
dbs, err := exe.dbo.AllDB(ctx, NS) fmt.Fprintf(w, sep, "OPTION")
if err != nil { fmt.Fprintln(w)
return err fmt.Fprintf(w, "OPTION IMPORT;\n")
}
if len(dbs) > 0 {
fmt.Fprintf(w, sep, "DATABASE")
fmt.Fprintln(w)
for _, v := range dbs {
fmt.Fprintf(w, "%s;\n", v)
}
}
// ------------------------------ // ------------------------------
// Tokens // Tokens
@ -131,10 +122,9 @@ func export(c *fibre.Context, NS, DB string) error {
for _, v := range sct { for _, v := range sct {
fmt.Fprintf(w, "%s;\n", v) fmt.Fprintf(w, "%s;\n", v)
} }
fmt.Fprintln(w)
} }
fmt.Fprintln(w)
} }
} }
@ -182,7 +172,7 @@ func export(c *fibre.Context, NS, DB string) error {
if len(evs) > 0 { if len(evs) > 0 {
fmt.Fprintln(w) fmt.Fprintln(w)
for _, v := range evs { for _, v := range evs {
fmt.Fprintf(w, "-- %s;\n", v) fmt.Fprintf(w, "%s;\n", v)
} }
} }