Module 20: Database Postgres
Check your understanding
A quick multiple-choice check before you move on. Answer every question, then submit to see how you did.
1.When connecting to Postgres with sqlx, what is the difference between connect(...) and connect_lazy(...) on PgPoolOptions?
2.Given email: Option<String> in a #[derive(FromRow)] struct, what does the Option wrapper represent for the mapped Postgres column?
3.Which sqlx method should you use to run an INSERT when you do not need any rows returned?
4.To safely pass user-supplied values into a parameterized Postgres query with sqlx, what should you do?
5.In the example, main is written as async fn main() -> Result<(), sqlx::Error> with #[tokio::main]. Why is this signature used?
Answer every question to submit.