https://github.com/launchbadge/sqlx/blob/main/sqlx-cli/README.md#sqlx-cli
if you only want postgres support.
cargo install sqlx-cli --no-default-features --features native-tls,postgres
https://diesel.rs/guides/getting-started
if you only want postgres support.
cargo install diesel_cli --no-default-features --features postgres
https://www.docker.com/products/docker-desktop/
docker compose -f docker-compose.yml up -d
We'll cover the topics in the following order
-
connection pooling. ->
connection-pool
crate.
-> Has Both SQLX and Diesel connection pools and fixtures (for tests) -
migrations. ->
migrations
folder.
migrations/diesel-migrations
-> How to handle diesel migrations. (Challenge included)
migrations/sqlx-migrations
-> SQLX migrations. (Challenge included) -
querying, indexing and tracing. ->
query-and-indexing/diesel-publishers
crate.
We'll use a book publishing example to showcase the 3 actions. (Including tests) -
transactions ->
SQLX
-> We'll look at an "online" store example. We'll look at product creation and report generation. -
partitions ->
partitions
folder (Challenges included in both)
partitions/diesel_pg_table_partitions
-> Postgres table partitions using Diesel ORM
partitions/sqlx_enterprise_partitions
-> A multitenant setup in postgres with SQLX
Download https://tableplus.com/download
Download db connection group from here https://drive.google.com/drive/folders/1BBABdXIGb2O5jufwh56V_nTp1cBYSclA?usp=sharing
docker exec -it <container_name> psql -U postgres -d <db_name>
eg: The base_db
docker exec -it rust_db_talk-base_db-1 psql -U postgres -d base_db
eg: pg_table_partition
docker exec -it rust_db_talk-pg_table_partitions-1 psql -U postgres -d pg_table_partitions