Ensure DEFINE TOKEN ON SCOPE statments are included in database export

This commit is contained in:
Tobie Morgan Hitchcock 2023-04-01 19:28:44 +01:00
parent da2fd133ec
commit 683c1adbd4

View file

@ -1571,20 +1571,6 @@ impl Transaction {
chn.send(bytes!("")).await?;
}
}
// Output SCOPES
{
let scs = self.all_sc(ns, db).await?;
if !scs.is_empty() {
chn.send(bytes!("-- ------------------------------")).await?;
chn.send(bytes!("-- SCOPES")).await?;
chn.send(bytes!("-- ------------------------------")).await?;
chn.send(bytes!("")).await?;
for sc in scs.iter() {
chn.send(bytes!(format!("{sc};"))).await?;
}
chn.send(bytes!("")).await?;
}
}
// Output PARAMS
{
let pas = self.all_pa(ns, db).await?;
@ -1599,6 +1585,31 @@ impl Transaction {
chn.send(bytes!("")).await?;
}
}
// Output SCOPES
{
let scs = self.all_sc(ns, db).await?;
if !scs.is_empty() {
chn.send(bytes!("-- ------------------------------")).await?;
chn.send(bytes!("-- SCOPES")).await?;
chn.send(bytes!("-- ------------------------------")).await?;
chn.send(bytes!("")).await?;
for sc in scs.iter() {
// Output SCOPE
chn.send(bytes!(format!("{sc};"))).await?;
// Output TOKENS
{
let sts = self.all_st(ns, db, &sc.name).await?;
if !sts.is_empty() {
for st in sts.iter() {
chn.send(bytes!(format!("{st};"))).await?;
}
chn.send(bytes!("")).await?;
}
}
}
chn.send(bytes!("")).await?;
}
}
// Output TABLES
{
let tbs = self.all_tb(ns, db).await?;