refactor: simplify and improve testing for initialization

This commit is contained in:
Per Stark
2026-05-26 15:09:09 +02:00
parent 000852c94c
commit a52dc802de
5 changed files with 160 additions and 234 deletions
+4 -2
View File
@@ -41,8 +41,10 @@ impl SurrealDbClient {
) -> Result<Self, Error> {
let db = connect(address).await?;
// Sign in to database
db.signin(Root { username, password }).await?;
// Skip sign-in for in-memory engine (no auth support)
if !address.starts_with("mem://") {
db.signin(Root { username, password }).await?;
}
// Set namespace
db.use_ns(namespace).use_db(database).await?;