From 3b99761c177e221ba22e2373ff067cc0f7b19825 Mon Sep 17 00:00:00 2001 From: Boyd Kane <33420535+beyarkay@users.noreply.github.com> Date: Tue, 30 May 2023 15:04:19 +0200 Subject: [PATCH 1/2] Add detail to postgres/docker AWS RDS setup --- resources/shuttle-aws-rds.mdx | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/resources/shuttle-aws-rds.mdx b/resources/shuttle-aws-rds.mdx index 53f89fa..afe0913 100644 --- a/resources/shuttle-aws-rds.mdx +++ b/resources/shuttle-aws-rds.mdx @@ -31,6 +31,26 @@ async fn tide(#[shuttle_aws_rds::Postgres( )] pool: PgPool) -> ShuttleTide { ... } ``` +The URI should be formatted according to the +[postgres documentation](https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING), +for example: + +``` +postgresql:// +postgresql://localhost +postgresql://localhost:5432 +postgresql://localhost/mydb +postgresql://user@localhost +postgresql://user:secret@localhost +postgresql://other@localhost/otherdb?connect_timeout=10&application_name=myapp +postgresql://localhost/mydb?user=other&password=secret +``` + +If you do not specify a `local_uri`, then shuttle will attempt to spin up a docker instance and launch the database inside of it. +For this to succeed, you must have docker installed and you must also have started the docker engine. If you have not used docker +before, the easiest way is to [install the desktop app](https://docs.docker.com/get-docker/) and then launch it in order to start +the docker engine. + ## Example This snippet shows the main function of a tide app that uses the `shuttle_aws_rds::Postgres` attribute to provision an RDS Postgres database. It gives you an authenticated [sqlx Pool](https://docs.rs/sqlx/latest/sqlx/pool/index.html), which you can use to interact with the database. From 5060d6faebf387586ae34d5f20fc935051fcda5d Mon Sep 17 00:00:00 2001 From: Boyd Kane <33420535+beyarkay@users.noreply.github.com> Date: Fri, 2 Jun 2023 12:17:42 +0200 Subject: [PATCH 2/2] Update shuttle-aws-rds based on feedback --- resources/shuttle-aws-rds.mdx | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/resources/shuttle-aws-rds.mdx b/resources/shuttle-aws-rds.mdx index afe0913..c6db7f9 100644 --- a/resources/shuttle-aws-rds.mdx +++ b/resources/shuttle-aws-rds.mdx @@ -32,19 +32,9 @@ async fn tide(#[shuttle_aws_rds::Postgres( ``` The URI should be formatted according to the -[postgres documentation](https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING), -for example: - -``` -postgresql:// -postgresql://localhost -postgresql://localhost:5432 -postgresql://localhost/mydb -postgresql://user@localhost -postgresql://user:secret@localhost -postgresql://other@localhost/otherdb?connect_timeout=10&application_name=myapp -postgresql://localhost/mydb?user=other&password=secret -``` +[Postgres](https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING) or +[MySql and MariaDB](https://dev.mysql.com/doc/refman/8.0/en/connecting-using-uri-or-key-value-pairs.html#connecting-using-uri) +documentation, depending on which one you're using. If you do not specify a `local_uri`, then shuttle will attempt to spin up a docker instance and launch the database inside of it. For this to succeed, you must have docker installed and you must also have started the docker engine. If you have not used docker