mirror of
https://github.com/perstarkse/minne.git
synced 2026-03-19 07:54:29 +01:00
benchmarks: v1
Benchmarking ingestion, retrieval precision and performance
This commit is contained in:
@@ -7,7 +7,7 @@ use include_dir::{include_dir, Dir};
|
||||
use std::{ops::Deref, sync::Arc};
|
||||
use surrealdb::{
|
||||
engine::any::{connect, Any},
|
||||
opt::auth::Root,
|
||||
opt::auth::{Namespace, Root},
|
||||
Error, Notification, Surreal,
|
||||
};
|
||||
use surrealdb_migrations::MigrationRunner;
|
||||
@@ -48,6 +48,24 @@ impl SurrealDbClient {
|
||||
Ok(SurrealDbClient { client: db })
|
||||
}
|
||||
|
||||
pub async fn new_with_namespace_user(
|
||||
address: &str,
|
||||
namespace: &str,
|
||||
username: &str,
|
||||
password: &str,
|
||||
database: &str,
|
||||
) -> Result<Self, Error> {
|
||||
let db = connect(address).await?;
|
||||
db.signin(Namespace {
|
||||
namespace,
|
||||
username,
|
||||
password,
|
||||
})
|
||||
.await?;
|
||||
db.use_ns(namespace).use_db(database).await?;
|
||||
Ok(SurrealDbClient { client: db })
|
||||
}
|
||||
|
||||
pub async fn create_session_store(
|
||||
&self,
|
||||
) -> Result<SessionStore<SessionSurrealPool<Any>>, SessionError> {
|
||||
|
||||
Reference in New Issue
Block a user