Ignore any errors when adding default NS / DB / TB

This commit is contained in:
Tobie Morgan Hitchcock 2022-04-04 23:24:39 +01:00
parent 64eedd413f
commit 8980929a3c

View file

@ -245,35 +245,41 @@ impl Transaction {
// Get all namespaces // Get all namespaces
pub async fn add_ns(&mut self, ns: &str) -> Result<(), Error> { pub async fn add_ns(&mut self, ns: &str) -> Result<(), Error> {
let key = crate::key::ns::new(ns); let key = crate::key::ns::new(ns);
self.put( let _ = self
.put(
key, key,
DefineNamespaceStatement { DefineNamespaceStatement {
name: ns.to_owned(), name: ns.to_owned(),
}, },
) )
.await .await;
Ok(())
} }
// Get all namespace logins // Get all namespace logins
pub async fn add_db(&mut self, ns: &str, db: &str) -> Result<(), Error> { pub async fn add_db(&mut self, ns: &str, db: &str) -> Result<(), Error> {
let key = crate::key::db::new(ns, db); let key = crate::key::db::new(ns, db);
self.put( let _ = self
.put(
key, key,
DefineDatabaseStatement { DefineDatabaseStatement {
name: db.to_owned(), name: db.to_owned(),
}, },
) )
.await .await;
Ok(())
} }
// Get all namespace tokens // Get all namespace tokens
pub async fn add_tb(&mut self, ns: &str, db: &str, tb: &str) -> Result<(), Error> { pub async fn add_tb(&mut self, ns: &str, db: &str, tb: &str) -> Result<(), Error> {
let key = crate::key::tb::new(ns, db, tb); let key = crate::key::tb::new(ns, db, tb);
self.put( let _ = self
.put(
key, key,
DefineTableStatement { DefineTableStatement {
name: tb.to_owned(), name: tb.to_owned(),
..DefineTableStatement::default() ..DefineTableStatement::default()
}, },
) )
.await .await;
Ok(())
} }
} }