def METHOD_NAME() -> None:
    """Restore the database backup."""
    parser = argparse.ArgumentParser(description="Restore the database backup.")
    parser.add_argument(
        "--env",
        help="The env file to use to get the connection settings, by default we log in the composition to "
        "do the restore.",
    )
    parser.add_argument(
        "--docker-compose-file",
        action="append",
        default=[],
        help="The docker-compose file to used.",
    )
    parser.add_argument(
        "--arg",
        action="append",
        default=[],
        help="Additional pg_restore argument, example: '--arg=--schema=main', may be used multiple times.",
    )
    parser.add_argument("file", help="The file path to restore")
    args = parser.parse_args()
    with open(args.file, "rb") as file_in:
        if args.env:
            env = {}
            with open(args.env, encoding="utf-8") as file_env:
                for line in file_env:
                    if line and line[0] != "#":
                        try:
                            index = line.index("=")
                            env[line[:index].strip()] = line[index + 1 :].strip()
                        except ValueError:
                            # Ignore lines that don't have a '='
                            pass
            subprocess.run(
                [
                    "docker",
                    "run",
                    "--rm",
                    "--interactive",
                    "--env=PGHOST={}".format(env["PGHOST"]),
                    "--env=PGPORT={}".format(env["PGPORT"]),
                    "--env=PGUSER={}".format(env["PGUSER"]),
                    "--env=PGPASSWORD={}".format(env["PGPASSWORD"]),
                ]
                + (["--env=PGSSLMODE={}".format(env["PGSSLMODE"])] if "PGSSLMODE" in env else [])
                + (["--env=PGOPTIONS={}".format(env["PGOPTIONS"])] if "PGOPTIONS" in env else [])
                + [
                    "camptocamp/postgres:{}".format(env["POSTGRES_TAG"]),
                ]
                + [
                    "pg_restore",
                    "--dbname={}".format(env["PGDATABASE"]),
                ]
                + args.arg,
                stdin=file_in,
                check=True,
            )
        else:
            subprocess.run(
                ["docker-compose"]
                + [f"--file={f}" for f in args.docker_compose_file]
                + [
                    "exec",
                    "-T",
                    "db",
                    "bash",
                    "-c",
                    'pg_restore --dbname="$PGDATABASE" ' + " ".join(args.arg),
                ],
                stdin=file_in,
                check=True,
            )