Using Paho MQTT and SQLx

I'm receiving a JSON object via MQTT which I want store in my PostgreSQL. After receiving the MQTT message I can't store the JSON in my DB with the following message:

thread '<unnamed>' panicked at /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-core-0.7.2/src/pool/inner.rs:503:5:
this functionality requires a Tokio context

I already tried to disconnect the MQTT subscriber but that does not work. I'm using SeaORM which seems to be a crate that uses sqlx. I do not understand the error and can't find a possible solution.

AFAICT paho-mqtt runs on the async-std asynchronous runtime. You should be able to use sqlx with async-std by enabling it as a feature in your Cargo.toml:

[dependencies]
sqlx = { version = "0.7", features = ["runtime-async-std"] }

Does that mean I don't need "runtime-tokio-native-tls"? And replace it with "runtime-async-std"

Yes, I'd give that a try:

[dependencies]
sqlx = { version = "0.7", features = ["runtime-async-std", "tls-native-tls"] }

instead of

[dependencies]
sqlx = { version = "0.7", features = ["runtime-tokio-native-tls"] }

SeaORM does not support "tls-native-tls"

Ah yes, my bad, then try the runtime-async-std-native-tls feature please.