From 8980929a3c68572fef2dbf1e7c55cd7af49a6dcf Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Mon, 4 Apr 2022 23:24:39 +0100 Subject: [PATCH] Ignore any errors when adding default NS / DB / TB --- lib/src/kvs/ex.rs | 50 ++++++++++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/lib/src/kvs/ex.rs b/lib/src/kvs/ex.rs index cde51a40..51a1855c 100644 --- a/lib/src/kvs/ex.rs +++ b/lib/src/kvs/ex.rs @@ -245,35 +245,41 @@ impl Transaction { // Get all namespaces pub async fn add_ns(&mut self, ns: &str) -> Result<(), Error> { let key = crate::key::ns::new(ns); - self.put( - key, - DefineNamespaceStatement { - name: ns.to_owned(), - }, - ) - .await + let _ = self + .put( + key, + DefineNamespaceStatement { + name: ns.to_owned(), + }, + ) + .await; + Ok(()) } // Get all namespace logins pub async fn add_db(&mut self, ns: &str, db: &str) -> Result<(), Error> { let key = crate::key::db::new(ns, db); - self.put( - key, - DefineDatabaseStatement { - name: db.to_owned(), - }, - ) - .await + let _ = self + .put( + key, + DefineDatabaseStatement { + name: db.to_owned(), + }, + ) + .await; + Ok(()) } // Get all namespace tokens pub async fn add_tb(&mut self, ns: &str, db: &str, tb: &str) -> Result<(), Error> { let key = crate::key::tb::new(ns, db, tb); - self.put( - key, - DefineTableStatement { - name: tb.to_owned(), - ..DefineTableStatement::default() - }, - ) - .await + let _ = self + .put( + key, + DefineTableStatement { + name: tb.to_owned(), + ..DefineTableStatement::default() + }, + ) + .await; + Ok(()) } }