Enable DEFINE EVENT queries in exported SQL
This commit is contained in:
parent
71192d2e36
commit
775c3ca96a
1 changed files with 6 additions and 16 deletions
22
db/export.go
22
db/export.go
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue