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)
|
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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue