Akhil - I wanted to build an example that uses SurrealDB with Rust. I used SurrealDB a while back and noticed how simple it was to install it - just one command and ZERO configs and also start the DB with the username and password of my choice. I LOVED it and along with Rust, it's the perfect combo!
You need SurrealDB on your PC.
If you're on linux this is how to install it -
curl -sSf https://install.surrealdb.com | sh
mac - brew install surrealdb/tap/surreal
windows - iwr https://windows.surrealdb.com -useb | iex
and then start surreal db with this command that sets the username and password -
surreal start --user root --pass root --auth memory
If you to want the feature to run in watch mode, install cargo-watch
- cargo-watch
cargo install cargo-watch
- Clone the repo
git clone https://github.com/akhilsharma90/rust_surrealdb_API.git
- Build the project to install the dependecies
cargo build
- Run with
Or, for more dynamic development, run in watch mode
cargo run
cargo watch -q -c -w src/ -x run
-q
quiet mode
-c
clear the console on reload
-w
watch all change to files undersrc/
-x
executesrun
command
- Working api structure
- Clean Architecure
- Database
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'feat: add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt
for more information.
Akhil Sharma - @akhilairi - akhil.sharma@myrl.tech
Project Link: https://github.com/akhilsharma90/rust_surrealdb_API