We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Issues with installation process that connects an existing DB
- [x] Tester Marius reports (server credentials in Upwork)
  - [ ] It seems that even if you select existing database, it still tries to start a docker container for the database, creating a conflict?
- [x] Tester Mohammad reports an error as well ([details here](https://docs.google.com/document/d/15m9eZFocAsU1V9inLKxC6i_KQxMdu28snRrBPOrf5Hk/edit))

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `db/install.py`
Content:
```
1 from sqlalchemy import text
2 from sqlalchemy.exc import OperationalError
3 
4 from db import engine
5 from db.types import install
6 
7 
8 def install_mathesar(
9         database_name, username, password, hostname, port, skip_confirm
10 ):
11     """Create database and install Mathesar on it."""
12     user_db_engine = engine.create_future_engine(
13         username, password, hostname, database_name, port,
14         connect_args={"connect_timeout": 10}
15     )
16     try:
17         user_db_engine.connect()
18         print(f"Installing Mathesar on preexisting PostgreSQL database {database_name} at host {hostname}...")
19         install.install_mathesar_on_database(user_db_engine)
20         user_db_engine.dispose()
21     except OperationalError:
22         database_created = _create_database(
23             database_name=database_name,
24             hostname=hostname,
25             username=username,
26             password=password,
27             port=port,
28             skip_confirm=skip_confirm
29         )
30         if database_created:
31             print(f"Installing Mathesar on PostgreSQL database {database_name} at host {hostname}...")
32             install.install_mathesar_on_database(user_db_engine)
33             user_db_engine.dispose()
34         else:
35             print(f"Skipping installing on DB with key {database_name}.")
36 
37 
38 def _create_database(database_name, hostname, username, password, port, skip_confirm=True):
39     if skip_confirm is True:
40         create_database = "y"
41     else:
42         create_database = input(
43             f"Create a new Database called {database_name}? (y/n) > "
44         )
45     if create_database.lower() in ["y", "yes"]:
46         # We need to connect to an existing database inorder to create a new Database.
47         # So we use the default Database `postgres` that comes with postgres.
48         # TODO Throw correct error when the default postgres database does not exists(which is very rare but still possible)
49         root_database = "postgres"
50         root_db_engine = engine.create_future_engine(
51             username, password, hostname, root_database, port,
52             connect_args={"connect_timeout": 10}
53         )
54         with root_db_engine.connect() as conn:
55             conn.execution_options(isolation_level="AUTOCOMMIT")
56             conn.execute(text(f"CREATE DATABASE {database_name}"))
57         root_db_engine.dispose()
58         print(f"Created DB is {database_name}.")
59         return True
60     else:
61         print(f"Database {database_name} not created!")
62         return False
63
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/db/install.py b/db/install.py
--- a/db/install.py
+++ b/db/install.py
@@ -53,7 +53,7 @@
         )
         with root_db_engine.connect() as conn:
             conn.execution_options(isolation_level="AUTOCOMMIT")
-            conn.execute(text(f"CREATE DATABASE {database_name}"))
+            conn.execute(text(f'CREATE DATABASE "{database_name}"'))
         root_db_engine.dispose()
         print(f"Created DB is {database_name}.")
         return True

{"golden_diff": "diff --git a/db/install.py b/db/install.py\n--- a/db/install.py\n+++ b/db/install.py\n@@ -53,7 +53,7 @@\n         )\n         with root_db_engine.connect() as conn:\n             conn.execution_options(isolation_level=\"AUTOCOMMIT\")\n-            conn.execute(text(f\"CREATE DATABASE {database_name}\"))\n+            conn.execute(text(f'CREATE DATABASE \"{database_name}\"'))\n         root_db_engine.dispose()\n         print(f\"Created DB is {database_name}.\")\n         return True\n", "issue": "Issues with installation process that connects an existing DB\n- [x] Tester Marius reports (server credentials in Upwork)\r\n  - [ ] It seems that even if you select existing database, it still tries to start a docker container for the database, creating a conflict?\r\n- [x] Tester Mohammad reports an error as well ([details here](https://docs.google.com/document/d/15m9eZFocAsU1V9inLKxC6i_KQxMdu28snRrBPOrf5Hk/edit))\n", "before_files": [{"content": "from sqlalchemy import text\nfrom sqlalchemy.exc import OperationalError\n\nfrom db import engine\nfrom db.types import install\n\n\ndef install_mathesar(\n        database_name, username, password, hostname, port, skip_confirm\n):\n    \"\"\"Create database and install Mathesar on it.\"\"\"\n    user_db_engine = engine.create_future_engine(\n        username, password, hostname, database_name, port,\n        connect_args={\"connect_timeout\": 10}\n    )\n    try:\n        user_db_engine.connect()\n        print(f\"Installing Mathesar on preexisting PostgreSQL database {database_name} at host {hostname}...\")\n        install.install_mathesar_on_database(user_db_engine)\n        user_db_engine.dispose()\n    except OperationalError:\n        database_created = _create_database(\n            database_name=database_name,\n            hostname=hostname,\n            username=username,\n            password=password,\n            port=port,\n            skip_confirm=skip_confirm\n        )\n        if database_created:\n            print(f\"Installing Mathesar on PostgreSQL database {database_name} at host {hostname}...\")\n            install.install_mathesar_on_database(user_db_engine)\n            user_db_engine.dispose()\n        else:\n            print(f\"Skipping installing on DB with key {database_name}.\")\n\n\ndef _create_database(database_name, hostname, username, password, port, skip_confirm=True):\n    if skip_confirm is True:\n        create_database = \"y\"\n    else:\n        create_database = input(\n            f\"Create a new Database called {database_name}? (y/n) > \"\n        )\n    if create_database.lower() in [\"y\", \"yes\"]:\n        # We need to connect to an existing database inorder to create a new Database.\n        # So we use the default Database `postgres` that comes with postgres.\n        # TODO Throw correct error when the default postgres database does not exists(which is very rare but still possible)\n        root_database = \"postgres\"\n        root_db_engine = engine.create_future_engine(\n            username, password, hostname, root_database, port,\n            connect_args={\"connect_timeout\": 10}\n        )\n        with root_db_engine.connect() as conn:\n            conn.execution_options(isolation_level=\"AUTOCOMMIT\")\n            conn.execute(text(f\"CREATE DATABASE {database_name}\"))\n        root_db_engine.dispose()\n        print(f\"Created DB is {database_name}.\")\n        return True\n    else:\n        print(f\"Database {database_name} not created!\")\n        return False\n", "path": "db/install.py"}], "after_files": [{"content": "from sqlalchemy import text\nfrom sqlalchemy.exc import OperationalError\n\nfrom db import engine\nfrom db.types import install\n\n\ndef install_mathesar(\n        database_name, username, password, hostname, port, skip_confirm\n):\n    \"\"\"Create database and install Mathesar on it.\"\"\"\n    user_db_engine = engine.create_future_engine(\n        username, password, hostname, database_name, port,\n        connect_args={\"connect_timeout\": 10}\n    )\n    try:\n        user_db_engine.connect()\n        print(f\"Installing Mathesar on preexisting PostgreSQL database {database_name} at host {hostname}...\")\n        install.install_mathesar_on_database(user_db_engine)\n        user_db_engine.dispose()\n    except OperationalError:\n        database_created = _create_database(\n            database_name=database_name,\n            hostname=hostname,\n            username=username,\n            password=password,\n            port=port,\n            skip_confirm=skip_confirm\n        )\n        if database_created:\n            print(f\"Installing Mathesar on PostgreSQL database {database_name} at host {hostname}...\")\n            install.install_mathesar_on_database(user_db_engine)\n            user_db_engine.dispose()\n        else:\n            print(f\"Skipping installing on DB with key {database_name}.\")\n\n\ndef _create_database(database_name, hostname, username, password, port, skip_confirm=True):\n    if skip_confirm is True:\n        create_database = \"y\"\n    else:\n        create_database = input(\n            f\"Create a new Database called {database_name}? (y/n) > \"\n        )\n    if create_database.lower() in [\"y\", \"yes\"]:\n        # We need to connect to an existing database inorder to create a new Database.\n        # So we use the default Database `postgres` that comes with postgres.\n        # TODO Throw correct error when the default postgres database does not exists(which is very rare but still possible)\n        root_database = \"postgres\"\n        root_db_engine = engine.create_future_engine(\n            username, password, hostname, root_database, port,\n            connect_args={\"connect_timeout\": 10}\n        )\n        with root_db_engine.connect() as conn:\n            conn.execution_options(isolation_level=\"AUTOCOMMIT\")\n            conn.execute(text(f'CREATE DATABASE \"{database_name}\"'))\n        root_db_engine.dispose()\n        print(f\"Created DB is {database_name}.\")\n        return True\n    else:\n        print(f\"Database {database_name} not created!\")\n        return False\n", "path": "db/install.py"}]}