diff --git a/core/src/kvs/ds.rs b/core/src/kvs/ds.rs index 0e1f52ff..ba0101c1 100644 --- a/core/src/kvs/ds.rs +++ b/core/src/kvs/ds.rs @@ -224,7 +224,7 @@ impl Datastore { /// # use surrealdb_core::err::Error; /// # #[tokio::main] /// # async fn main() -> Result<(), Error> { - /// let ds = Datastore::new("file://temp.db").await?; + /// let ds = Datastore::new("surrealkv://temp.skv").await?; /// # Ok(()) /// # } /// ``` @@ -298,6 +298,7 @@ impl Datastore { #[cfg(feature = "kv-rocksdb")] { info!(target: TARGET, "Starting kvs store at {}", path); + warn!("file:// is deprecated, please use surrealkv:// or rocksdb://"); let s = s.trim_start_matches("file://"); let s = s.trim_start_matches("file:"); let v = super::rocksdb::Datastore::new(s).await.map(DatastoreFlavor::RocksDB); diff --git a/lib/src/api/engine/local/mod.rs b/lib/src/api/engine/local/mod.rs index c26526b2..0acfb3cd 100644 --- a/lib/src/api/engine/local/mod.rs +++ b/lib/src/api/engine/local/mod.rs @@ -169,6 +169,7 @@ pub struct Mem; #[cfg(feature = "kv-rocksdb")] #[cfg_attr(docsrs, doc(cfg(feature = "kv-rocksdb")))] #[derive(Debug)] +#[deprecated] pub struct File; /// RocksDB database diff --git a/lib/src/api/opt/endpoint/rocksdb.rs b/lib/src/api/opt/endpoint/rocksdb.rs index aee75ba3..36efb523 100644 --- a/lib/src/api/opt/endpoint/rocksdb.rs +++ b/lib/src/api/opt/endpoint/rocksdb.rs @@ -1,4 +1,5 @@ use crate::api::engine::local::Db; +#[allow(deprecated)] use crate::api::engine::local::File; use crate::api::engine::local::RocksDb; use crate::api::opt::Config; @@ -35,6 +36,7 @@ macro_rules! endpoints { } } + #[allow(deprecated)] impl IntoEndpoint for $name { type Client = Db; @@ -48,6 +50,7 @@ macro_rules! endpoints { } } + #[allow(deprecated)] impl IntoEndpoint for ($name, Config) { type Client = Db; diff --git a/lib/tests/api.rs b/lib/tests/api.rs index 8ad14863..22a0819f 100644 --- a/lib/tests/api.rs +++ b/lib/tests/api.rs @@ -275,6 +275,7 @@ mod api_integration { mod file { use super::*; use surrealdb::engine::local::Db; + #[allow(deprecated)] use surrealdb::engine::local::File; async fn new_db() -> (SemaphorePermit<'static>, Surreal) { @@ -288,6 +289,7 @@ mod api_integration { .user(root) .tick_interval(TICK_INTERVAL) .capabilities(Capabilities::all()); + #[allow(deprecated)] let db = Surreal::new::((path, config)).await.unwrap(); db.signin(root).await.unwrap(); (permit, db) diff --git a/src/cli/export.rs b/src/cli/export.rs index 37c15dfc..f7a37e70 100644 --- a/src/cli/export.rs +++ b/src/cli/export.rs @@ -45,7 +45,7 @@ pub async fn init( crate::telemetry::builder().with_log_level("error").init(); // If username and password are specified, and we are connecting to a remote SurrealDB server, then we need to authenticate. - // If we are connecting directly to a datastore (i.e. file://local.db or tikv://...), then we don't need to authenticate because we use an embedded (local) SurrealDB instance with auth disabled. + // If we are connecting directly to a datastore (i.e. surrealkv://local.skv or tikv://...), then we don't need to authenticate because we use an embedded (local) SurrealDB instance with auth disabled. let client = if username.is_some() && password.is_some() && !endpoint.clone().into_endpoint()?.parse_kind()?.is_local() diff --git a/src/cli/import.rs b/src/cli/import.rs index 599edf56..a892e355 100644 --- a/src/cli/import.rs +++ b/src/cli/import.rs @@ -44,7 +44,7 @@ pub async fn init( let config = Config::new().capabilities(Capabilities::all()); // If username and password are specified, and we are connecting to a remote SurrealDB server, then we need to authenticate. - // If we are connecting directly to a datastore (i.e. file://local.db or tikv://...), then we don't need to authenticate because we use an embedded (local) SurrealDB instance with auth disabled. + // If we are connecting directly to a datastore (i.e. surrealkv://local.skv or tikv://...), then we don't need to authenticate because we use an embedded (local) SurrealDB instance with auth disabled. let client = if username.is_some() && password.is_some() && !endpoint.clone().into_endpoint()?.parse_kind()?.is_local() diff --git a/src/cli/ml/export.rs b/src/cli/ml/export.rs index 63562a12..55a0d6bb 100644 --- a/src/cli/ml/export.rs +++ b/src/cli/ml/export.rs @@ -61,7 +61,7 @@ pub async fn init( crate::telemetry::builder().with_log_level("error").init(); // If username and password are specified, and we are connecting to a remote SurrealDB server, then we need to authenticate. - // If we are connecting directly to a datastore (i.e. file://local.db or tikv://...), then we don't need to authenticate because we use an embedded (local) SurrealDB instance with auth disabled. + // If we are connecting directly to a datastore (i.e. surrealkv://local.skv or tikv://...), then we don't need to authenticate because we use an embedded (local) SurrealDB instance with auth disabled. let client = if username.is_some() && password.is_some() && !endpoint.clone().into_endpoint()?.parse_kind()?.is_local() diff --git a/src/cli/ml/import.rs b/src/cli/ml/import.rs index ffdbdda9..e1d32167 100644 --- a/src/cli/ml/import.rs +++ b/src/cli/ml/import.rs @@ -44,7 +44,7 @@ pub async fn init( let config = Config::new().capabilities(Capabilities::all()); // If username and password are specified, and we are connecting to a remote SurrealDB server, then we need to authenticate. - // If we are connecting directly to a datastore (i.e. file://local.db or tikv://...), then we don't need to authenticate because we use an embedded (local) SurrealDB instance with auth disabled. + // If we are connecting directly to a datastore (i.e. surrealkv://local.skv or tikv://...), then we don't need to authenticate because we use an embedded (local) SurrealDB instance with auth disabled. let client = if username.is_some() && password.is_some() && !endpoint.clone().into_endpoint()?.parse_kind()?.is_local() diff --git a/src/cli/sql.rs b/src/cli/sql.rs index 1b062777..dbf1fb37 100644 --- a/src/cli/sql.rs +++ b/src/cli/sql.rs @@ -67,7 +67,7 @@ pub async fn init( let config = Config::new().capabilities(Capabilities::all()); // If username and password are specified, and we are connecting to a remote SurrealDB server, then we need to authenticate. - // If we are connecting directly to a datastore (i.e. file://local.db or tikv://...), then we don't need to authenticate because we use an embedded (local) SurrealDB instance with auth disabled. + // If we are connecting directly to a datastore (i.e. surrealkv://local.skv or tikv://...), then we don't need to authenticate because we use an embedded (local) SurrealDB instance with auth disabled. let client = if username.is_some() && password.is_some() && !endpoint.clone().into_endpoint()?.parse_kind()?.is_local()