2022-11-20

How to connect to SurrealDB in a Docker container from a Rust app?

I am trying to figure out how to connect my Rust app to a surrealdb database that is running inside a docker container.

The docs on the SurrealDB website only specify three ways to connect to the database, these are: memory, file, and tikv.

I am running surrealdb on docker as indicated on their website:

docker run --rm -p 8000:8000 surrealdb/surrealdb:latest start

I tried doing something like the following:

let ds = Datastore::new("http://0.0.0.0:8000").await?;

But I am getting the following error:

value: Ds("Unable to load the specified datastore")'

Perhaps it has not been implemented yet?



No comments:

Post a Comment