Complete the code to import the correct database client for Deno.
import { Client } from "https://deno.land/x/[1]/mod.ts";
The postgres client is imported from the deno.land repository to connect to a PostgreSQL database.
Complete the code to create a connection pool with the correct database type.
const pool = new [1]({ hostname: "localhost", database: "testdb" });
The Client is used to create a connection for PostgreSQL databases in Deno.
Fix the error in the query method to match the database client syntax.
const result = await client.[1]("SELECT * FROM users WHERE id = $1", [userId]);
The query method is used to run SQL commands with parameters in PostgreSQL clients.
Fill both blanks to define a schema and insert data correctly for the chosen database.
await client.[1]("CREATE TABLE users (id SERIAL PRIMARY KEY, name VARCHAR(100));"); await client.[2]("INSERT INTO users (name) VALUES ($1);", [userName]);
Both schema creation and data insertion use the query method in PostgreSQL clients for Deno.
Fill all three blanks to handle connection, query, and closing properly in Deno.
const client = new [1](); await client.[2](); const result = await client.[3]("SELECT * FROM products;"); await client.end();
Use Client to create the client, connect to open the connection, and query to run SQL commands.
