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