Connecting our Transactions to the Server
We are now at the final stage of integrating our Postgres handle into our system. As we removed the reference to the type of storage from our core making it engine agonistic, we now must define our engine in our server dependencies with the following:
# nanoservices/to_do/networking/actix_server/Cargo.toml
[dependencies]
tokio = { version = "1.36.0", features = ["full"] }
actix-web = "4.5.1"
core = { path = "../../core" }
dal = { path = "../../dal", features = ["sqlx-postgres"]}
glue = { path = "../../../../glue", features = ["actix"] }
Here we can see that we have activated the sqlx-postgres
feature otherwise our handle will not have implemented all the required traits to be used in our endpoints.
For our create endpoint, we first need to import the traits with the code below:
// nanoservices/to_do/networking/actix_server/src
// /api/basic_actions/create.rs
use...