We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Support sqlserver
Add support for MS sqlserver

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `projects/adapter/src/dbt/adapters/fal_experimental/adapter_support.py`
Content:
```
1 import functools
2 from time import sleep
3 from typing import Any
4 
5 import pandas as pd
6 import sqlalchemy
7 from contextlib import contextmanager
8 from dbt.adapters.base import BaseAdapter, BaseRelation, RelationType
9 from dbt.adapters.base.connections import AdapterResponse, Connection
10 from dbt.config import RuntimeConfig
11 from dbt.parser.manifest import MacroManifest, Manifest, ManifestLoader
12 
13 from dbt.adapters import factory
14 
15 _SQLALCHEMY_DIALECTS = {
16     "redshift": "redshift+psycopg2",
17 }
18 
19 
20 def _get_alchemy_engine(adapter: BaseAdapter, connection: Connection) -> Any:
21     # The following code heavily depends on the implementation
22     # details of the known adapters, hence it can't work for
23     # arbitrary ones.
24     adapter_type = adapter.type()
25 
26     sqlalchemy_kwargs = {}
27     format_url = lambda url: url
28     if adapter_type == 'trino':
29         import dbt.adapters.fal_experimental.support.trino as support_trino
30         return support_trino.create_engine(adapter)
31 
32     if adapter_type == "redshift":
33         # If the given adapter supports the DBAPI (PEP 249), we can
34         # use its connection directly for the engine.
35         sqlalchemy_kwargs["creator"] = lambda *args, **kwargs: connection.handle
36         url = _SQLALCHEMY_DIALECTS.get(adapter_type, adapter_type) + "://"
37         url = format_url(url)
38     else:
39         message = (
40             f"dbt-fal does not support {adapter_type} adapter. ",
41             f"If you need {adapter_type} support, you can create an issue ",
42             "in our GitHub repository: https://github.com/fal-ai/fal. ",
43             "We will look into it ASAP."
44         )
45         raise NotImplementedError(message)
46 
47     return sqlalchemy.create_engine(url, **sqlalchemy_kwargs)
48 
49 
50 def drop_relation_if_it_exists(adapter: BaseAdapter, relation: BaseRelation) -> None:
51     if adapter.get_relation(
52         database=relation.database,
53         schema=relation.schema,
54         identifier=relation.identifier,
55     ):
56         adapter.drop_relation(relation)
57 
58 
59 def write_df_to_relation(
60     adapter: BaseAdapter,
61     relation: BaseRelation,
62     dataframe: pd.DataFrame,
63     *,
64     if_exists: str = "replace",
65 ) -> AdapterResponse:
66     """Generic version of the write_df_to_relation. Materialize the given
67     dataframe to the targeted relation on the adapter."""
68 
69     adapter_type = adapter.type()
70 
71     if adapter_type == "snowflake":
72         import dbt.adapters.fal_experimental.support.snowflake as support_snowflake
73 
74         return support_snowflake.write_df_to_relation(adapter, dataframe, relation)
75 
76     elif adapter_type == "bigquery":
77         import dbt.adapters.fal_experimental.support.bigquery as support_bq
78 
79         return support_bq.write_df_to_relation(adapter, dataframe, relation)
80 
81     elif adapter_type == "duckdb":
82         import dbt.adapters.fal_experimental.support.duckdb as support_duckdb
83 
84         return support_duckdb.write_df_to_relation(adapter, dataframe, relation)
85 
86     elif adapter_type == "postgres":
87         import dbt.adapters.fal_experimental.support.postgres as support_postgres
88 
89         return support_postgres.write_df_to_relation(adapter, dataframe, relation)
90 
91     else:
92         with new_connection(adapter, "fal:write_df_to_relation") as connection:
93             # TODO: this should probably live in the materialization macro.
94             temp_relation = relation.replace_path(
95                 identifier=f"__dbt_fal_temp_{relation.identifier}"
96             )
97             drop_relation_if_it_exists(adapter, temp_relation)
98 
99             alchemy_engine = _get_alchemy_engine(adapter, connection)
100 
101             # TODO: probably worth handling errors here an returning
102             # a proper adapter response.
103             rows_affected = dataframe.to_sql(
104                 con=alchemy_engine,
105                 name=temp_relation.identifier,
106                 schema=temp_relation.schema,
107                 if_exists=if_exists,
108                 index=False,
109             )
110             adapter.cache.add(temp_relation)
111             drop_relation_if_it_exists(adapter, relation)
112             adapter.rename_relation(temp_relation, relation)
113             adapter.commit_if_has_connection()
114 
115             return AdapterResponse("OK", rows_affected=rows_affected)
116 
117 
118 def read_relation_as_df(adapter: BaseAdapter, relation: BaseRelation) -> pd.DataFrame:
119     """Generic version of the read_df_from_relation."""
120 
121     adapter_type = adapter.type()
122 
123     if adapter_type == "snowflake":
124         import dbt.adapters.fal_experimental.support.snowflake as support_snowflake
125 
126         return support_snowflake.read_relation_as_df(adapter, relation)
127 
128     elif adapter_type == "bigquery":
129         import dbt.adapters.fal_experimental.support.bigquery as support_bq
130 
131         return support_bq.read_relation_as_df(adapter, relation)
132 
133     elif adapter_type == "duckdb":
134         import dbt.adapters.fal_experimental.support.duckdb as support_duckdb
135 
136         return support_duckdb.read_relation_as_df(adapter, relation)
137 
138     elif adapter_type == "postgres":
139         import dbt.adapters.fal_experimental.support.postgres as support_postgres
140 
141         return support_postgres.read_relation_as_df(adapter, relation)
142 
143     else:
144         with new_connection(adapter, "fal:read_relation_as_df") as connection:
145             alchemy_engine = _get_alchemy_engine(adapter, connection)
146             return pd.read_sql_table(
147                 con=alchemy_engine,
148                 table_name=relation.identifier,
149                 schema=relation.schema,
150             )
151 
152 
153 def prepare_for_adapter(adapter: BaseAdapter, function: Any) -> Any:
154     """Prepare the given function to be used with string-like inputs
155     (for relations) on the given adapter."""
156 
157     @functools.wraps(function)
158     def wrapped(quoted_relation: str, *args, **kwargs) -> Any:
159         relation = adapter.Relation.create(
160             *quoted_relation.split("."), type=RelationType.Table
161         )
162         return function(adapter, relation, *args, **kwargs)
163 
164     return wrapped
165 
166 
167 def reconstruct_adapter(config: RuntimeConfig, manifest: Manifest, macro_manifest: MacroManifest) -> BaseAdapter:
168     from dbt.tracking import do_not_track
169 
170     # Prepare the DBT to not to track us.
171     do_not_track()
172 
173     # Prepare the plugin loading system to handle the adapter.
174     factory.load_plugin(config.credentials.type)
175     factory.load_plugin(config.python_adapter_credentials.type)
176     factory.register_adapter(config)
177 
178     # Initialize the adapter
179     db_adapter = factory.get_adapter(config)
180     db_adapter._macro_manifest_lazy = macro_manifest
181     reload_adapter_cache(db_adapter, manifest)
182 
183     return db_adapter
184 
185 
186 def reload_adapter_cache(adapter: BaseAdapter, manifest: Manifest) -> None:
187     with new_connection(adapter, "fal:reload_adapter_cache"):
188         adapter.set_relations_cache(manifest, True)
189 
190 
191 @contextmanager
192 def new_connection(adapter: BaseAdapter, connection_name: str) -> Connection:
193     with adapter.connection_named(connection_name):
194         yield adapter.connections.get_thread_connection()
195
```
--- 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/projects/adapter/src/dbt/adapters/fal_experimental/adapter_support.py b/projects/adapter/src/dbt/adapters/fal_experimental/adapter_support.py
--- a/projects/adapter/src/dbt/adapters/fal_experimental/adapter_support.py
+++ b/projects/adapter/src/dbt/adapters/fal_experimental/adapter_support.py
@@ -14,6 +14,7 @@
 
 _SQLALCHEMY_DIALECTS = {
     "redshift": "redshift+psycopg2",
+    "sqlserver": "mssql+pyodbc",
 }
 
 
@@ -35,6 +36,10 @@
         sqlalchemy_kwargs["creator"] = lambda *args, **kwargs: connection.handle
         url = _SQLALCHEMY_DIALECTS.get(adapter_type, adapter_type) + "://"
         url = format_url(url)
+    elif adapter_type == "sqlserver":
+        sqlalchemy_kwargs["creator"] = lambda *args, **kwargs: connection.handle
+        url = _SQLALCHEMY_DIALECTS.get(adapter_type, adapter_type) + "://"
+        url = format_url(url)
     else:
         message = (
             f"dbt-fal does not support {adapter_type} adapter. ",

{"golden_diff": "diff --git a/projects/adapter/src/dbt/adapters/fal_experimental/adapter_support.py b/projects/adapter/src/dbt/adapters/fal_experimental/adapter_support.py\n--- a/projects/adapter/src/dbt/adapters/fal_experimental/adapter_support.py\n+++ b/projects/adapter/src/dbt/adapters/fal_experimental/adapter_support.py\n@@ -14,6 +14,7 @@\n \n _SQLALCHEMY_DIALECTS = {\n     \"redshift\": \"redshift+psycopg2\",\n+    \"sqlserver\": \"mssql+pyodbc\",\n }\n \n \n@@ -35,6 +36,10 @@\n         sqlalchemy_kwargs[\"creator\"] = lambda *args, **kwargs: connection.handle\n         url = _SQLALCHEMY_DIALECTS.get(adapter_type, adapter_type) + \"://\"\n         url = format_url(url)\n+    elif adapter_type == \"sqlserver\":\n+        sqlalchemy_kwargs[\"creator\"] = lambda *args, **kwargs: connection.handle\n+        url = _SQLALCHEMY_DIALECTS.get(adapter_type, adapter_type) + \"://\"\n+        url = format_url(url)\n     else:\n         message = (\n             f\"dbt-fal does not support {adapter_type} adapter. \",\n", "issue": "Support sqlserver\nAdd support for MS sqlserver\n", "before_files": [{"content": "import functools\nfrom time import sleep\nfrom typing import Any\n\nimport pandas as pd\nimport sqlalchemy\nfrom contextlib import contextmanager\nfrom dbt.adapters.base import BaseAdapter, BaseRelation, RelationType\nfrom dbt.adapters.base.connections import AdapterResponse, Connection\nfrom dbt.config import RuntimeConfig\nfrom dbt.parser.manifest import MacroManifest, Manifest, ManifestLoader\n\nfrom dbt.adapters import factory\n\n_SQLALCHEMY_DIALECTS = {\n    \"redshift\": \"redshift+psycopg2\",\n}\n\n\ndef _get_alchemy_engine(adapter: BaseAdapter, connection: Connection) -> Any:\n    # The following code heavily depends on the implementation\n    # details of the known adapters, hence it can't work for\n    # arbitrary ones.\n    adapter_type = adapter.type()\n\n    sqlalchemy_kwargs = {}\n    format_url = lambda url: url\n    if adapter_type == 'trino':\n        import dbt.adapters.fal_experimental.support.trino as support_trino\n        return support_trino.create_engine(adapter)\n\n    if adapter_type == \"redshift\":\n        # If the given adapter supports the DBAPI (PEP 249), we can\n        # use its connection directly for the engine.\n        sqlalchemy_kwargs[\"creator\"] = lambda *args, **kwargs: connection.handle\n        url = _SQLALCHEMY_DIALECTS.get(adapter_type, adapter_type) + \"://\"\n        url = format_url(url)\n    else:\n        message = (\n            f\"dbt-fal does not support {adapter_type} adapter. \",\n            f\"If you need {adapter_type} support, you can create an issue \",\n            \"in our GitHub repository: https://github.com/fal-ai/fal. \",\n            \"We will look into it ASAP.\"\n        )\n        raise NotImplementedError(message)\n\n    return sqlalchemy.create_engine(url, **sqlalchemy_kwargs)\n\n\ndef drop_relation_if_it_exists(adapter: BaseAdapter, relation: BaseRelation) -> None:\n    if adapter.get_relation(\n        database=relation.database,\n        schema=relation.schema,\n        identifier=relation.identifier,\n    ):\n        adapter.drop_relation(relation)\n\n\ndef write_df_to_relation(\n    adapter: BaseAdapter,\n    relation: BaseRelation,\n    dataframe: pd.DataFrame,\n    *,\n    if_exists: str = \"replace\",\n) -> AdapterResponse:\n    \"\"\"Generic version of the write_df_to_relation. Materialize the given\n    dataframe to the targeted relation on the adapter.\"\"\"\n\n    adapter_type = adapter.type()\n\n    if adapter_type == \"snowflake\":\n        import dbt.adapters.fal_experimental.support.snowflake as support_snowflake\n\n        return support_snowflake.write_df_to_relation(adapter, dataframe, relation)\n\n    elif adapter_type == \"bigquery\":\n        import dbt.adapters.fal_experimental.support.bigquery as support_bq\n\n        return support_bq.write_df_to_relation(adapter, dataframe, relation)\n\n    elif adapter_type == \"duckdb\":\n        import dbt.adapters.fal_experimental.support.duckdb as support_duckdb\n\n        return support_duckdb.write_df_to_relation(adapter, dataframe, relation)\n\n    elif adapter_type == \"postgres\":\n        import dbt.adapters.fal_experimental.support.postgres as support_postgres\n\n        return support_postgres.write_df_to_relation(adapter, dataframe, relation)\n\n    else:\n        with new_connection(adapter, \"fal:write_df_to_relation\") as connection:\n            # TODO: this should probably live in the materialization macro.\n            temp_relation = relation.replace_path(\n                identifier=f\"__dbt_fal_temp_{relation.identifier}\"\n            )\n            drop_relation_if_it_exists(adapter, temp_relation)\n\n            alchemy_engine = _get_alchemy_engine(adapter, connection)\n\n            # TODO: probably worth handling errors here an returning\n            # a proper adapter response.\n            rows_affected = dataframe.to_sql(\n                con=alchemy_engine,\n                name=temp_relation.identifier,\n                schema=temp_relation.schema,\n                if_exists=if_exists,\n                index=False,\n            )\n            adapter.cache.add(temp_relation)\n            drop_relation_if_it_exists(adapter, relation)\n            adapter.rename_relation(temp_relation, relation)\n            adapter.commit_if_has_connection()\n\n            return AdapterResponse(\"OK\", rows_affected=rows_affected)\n\n\ndef read_relation_as_df(adapter: BaseAdapter, relation: BaseRelation) -> pd.DataFrame:\n    \"\"\"Generic version of the read_df_from_relation.\"\"\"\n\n    adapter_type = adapter.type()\n\n    if adapter_type == \"snowflake\":\n        import dbt.adapters.fal_experimental.support.snowflake as support_snowflake\n\n        return support_snowflake.read_relation_as_df(adapter, relation)\n\n    elif adapter_type == \"bigquery\":\n        import dbt.adapters.fal_experimental.support.bigquery as support_bq\n\n        return support_bq.read_relation_as_df(adapter, relation)\n\n    elif adapter_type == \"duckdb\":\n        import dbt.adapters.fal_experimental.support.duckdb as support_duckdb\n\n        return support_duckdb.read_relation_as_df(adapter, relation)\n\n    elif adapter_type == \"postgres\":\n        import dbt.adapters.fal_experimental.support.postgres as support_postgres\n\n        return support_postgres.read_relation_as_df(adapter, relation)\n\n    else:\n        with new_connection(adapter, \"fal:read_relation_as_df\") as connection:\n            alchemy_engine = _get_alchemy_engine(adapter, connection)\n            return pd.read_sql_table(\n                con=alchemy_engine,\n                table_name=relation.identifier,\n                schema=relation.schema,\n            )\n\n\ndef prepare_for_adapter(adapter: BaseAdapter, function: Any) -> Any:\n    \"\"\"Prepare the given function to be used with string-like inputs\n    (for relations) on the given adapter.\"\"\"\n\n    @functools.wraps(function)\n    def wrapped(quoted_relation: str, *args, **kwargs) -> Any:\n        relation = adapter.Relation.create(\n            *quoted_relation.split(\".\"), type=RelationType.Table\n        )\n        return function(adapter, relation, *args, **kwargs)\n\n    return wrapped\n\n\ndef reconstruct_adapter(config: RuntimeConfig, manifest: Manifest, macro_manifest: MacroManifest) -> BaseAdapter:\n    from dbt.tracking import do_not_track\n\n    # Prepare the DBT to not to track us.\n    do_not_track()\n\n    # Prepare the plugin loading system to handle the adapter.\n    factory.load_plugin(config.credentials.type)\n    factory.load_plugin(config.python_adapter_credentials.type)\n    factory.register_adapter(config)\n\n    # Initialize the adapter\n    db_adapter = factory.get_adapter(config)\n    db_adapter._macro_manifest_lazy = macro_manifest\n    reload_adapter_cache(db_adapter, manifest)\n\n    return db_adapter\n\n\ndef reload_adapter_cache(adapter: BaseAdapter, manifest: Manifest) -> None:\n    with new_connection(adapter, \"fal:reload_adapter_cache\"):\n        adapter.set_relations_cache(manifest, True)\n\n\n@contextmanager\ndef new_connection(adapter: BaseAdapter, connection_name: str) -> Connection:\n    with adapter.connection_named(connection_name):\n        yield adapter.connections.get_thread_connection()\n", "path": "projects/adapter/src/dbt/adapters/fal_experimental/adapter_support.py"}], "after_files": [{"content": "import functools\nfrom time import sleep\nfrom typing import Any\n\nimport pandas as pd\nimport sqlalchemy\nfrom contextlib import contextmanager\nfrom dbt.adapters.base import BaseAdapter, BaseRelation, RelationType\nfrom dbt.adapters.base.connections import AdapterResponse, Connection\nfrom dbt.config import RuntimeConfig\nfrom dbt.parser.manifest import MacroManifest, Manifest, ManifestLoader\n\nfrom dbt.adapters import factory\n\n_SQLALCHEMY_DIALECTS = {\n    \"redshift\": \"redshift+psycopg2\",\n    \"sqlserver\": \"mssql+pyodbc\",\n}\n\n\ndef _get_alchemy_engine(adapter: BaseAdapter, connection: Connection) -> Any:\n    # The following code heavily depends on the implementation\n    # details of the known adapters, hence it can't work for\n    # arbitrary ones.\n    adapter_type = adapter.type()\n\n    sqlalchemy_kwargs = {}\n    format_url = lambda url: url\n    if adapter_type == 'trino':\n        import dbt.adapters.fal_experimental.support.trino as support_trino\n        return support_trino.create_engine(adapter)\n\n    if adapter_type == \"redshift\":\n        # If the given adapter supports the DBAPI (PEP 249), we can\n        # use its connection directly for the engine.\n        sqlalchemy_kwargs[\"creator\"] = lambda *args, **kwargs: connection.handle\n        url = _SQLALCHEMY_DIALECTS.get(adapter_type, adapter_type) + \"://\"\n        url = format_url(url)\n    elif adapter_type == \"sqlserver\":\n        sqlalchemy_kwargs[\"creator\"] = lambda *args, **kwargs: connection.handle\n        url = _SQLALCHEMY_DIALECTS.get(adapter_type, adapter_type) + \"://\"\n        url = format_url(url)\n    else:\n        message = (\n            f\"dbt-fal does not support {adapter_type} adapter. \",\n            f\"If you need {adapter_type} support, you can create an issue \",\n            \"in our GitHub repository: https://github.com/fal-ai/fal. \",\n            \"We will look into it ASAP.\"\n        )\n        raise NotImplementedError(message)\n\n    return sqlalchemy.create_engine(url, **sqlalchemy_kwargs)\n\n\ndef drop_relation_if_it_exists(adapter: BaseAdapter, relation: BaseRelation) -> None:\n    if adapter.get_relation(\n        database=relation.database,\n        schema=relation.schema,\n        identifier=relation.identifier,\n    ):\n        adapter.drop_relation(relation)\n\n\ndef write_df_to_relation(\n    adapter: BaseAdapter,\n    relation: BaseRelation,\n    dataframe: pd.DataFrame,\n    *,\n    if_exists: str = \"replace\",\n) -> AdapterResponse:\n    \"\"\"Generic version of the write_df_to_relation. Materialize the given\n    dataframe to the targeted relation on the adapter.\"\"\"\n\n    adapter_type = adapter.type()\n\n    if adapter_type == \"snowflake\":\n        import dbt.adapters.fal_experimental.support.snowflake as support_snowflake\n\n        return support_snowflake.write_df_to_relation(adapter, dataframe, relation)\n\n    elif adapter_type == \"bigquery\":\n        import dbt.adapters.fal_experimental.support.bigquery as support_bq\n\n        return support_bq.write_df_to_relation(adapter, dataframe, relation)\n\n    elif adapter_type == \"duckdb\":\n        import dbt.adapters.fal_experimental.support.duckdb as support_duckdb\n\n        return support_duckdb.write_df_to_relation(adapter, dataframe, relation)\n\n    elif adapter_type == \"postgres\":\n        import dbt.adapters.fal_experimental.support.postgres as support_postgres\n\n        return support_postgres.write_df_to_relation(adapter, dataframe, relation)\n\n    else:\n        with new_connection(adapter, \"fal:write_df_to_relation\") as connection:\n            # TODO: this should probably live in the materialization macro.\n            temp_relation = relation.replace_path(\n                identifier=f\"__dbt_fal_temp_{relation.identifier}\"\n            )\n            drop_relation_if_it_exists(adapter, temp_relation)\n\n            alchemy_engine = _get_alchemy_engine(adapter, connection)\n\n            # TODO: probably worth handling errors here an returning\n            # a proper adapter response.\n            rows_affected = dataframe.to_sql(\n                con=alchemy_engine,\n                name=temp_relation.identifier,\n                schema=temp_relation.schema,\n                if_exists=if_exists,\n                index=False,\n            )\n            adapter.cache.add(temp_relation)\n            drop_relation_if_it_exists(adapter, relation)\n            adapter.rename_relation(temp_relation, relation)\n            adapter.commit_if_has_connection()\n\n            return AdapterResponse(\"OK\", rows_affected=rows_affected)\n\n\ndef read_relation_as_df(adapter: BaseAdapter, relation: BaseRelation) -> pd.DataFrame:\n    \"\"\"Generic version of the read_df_from_relation.\"\"\"\n\n    adapter_type = adapter.type()\n\n    if adapter_type == \"snowflake\":\n        import dbt.adapters.fal_experimental.support.snowflake as support_snowflake\n\n        return support_snowflake.read_relation_as_df(adapter, relation)\n\n    elif adapter_type == \"bigquery\":\n        import dbt.adapters.fal_experimental.support.bigquery as support_bq\n\n        return support_bq.read_relation_as_df(adapter, relation)\n\n    elif adapter_type == \"duckdb\":\n        import dbt.adapters.fal_experimental.support.duckdb as support_duckdb\n\n        return support_duckdb.read_relation_as_df(adapter, relation)\n\n    elif adapter_type == \"postgres\":\n        import dbt.adapters.fal_experimental.support.postgres as support_postgres\n\n        return support_postgres.read_relation_as_df(adapter, relation)\n\n    else:\n        with new_connection(adapter, \"fal:read_relation_as_df\") as connection:\n            alchemy_engine = _get_alchemy_engine(adapter, connection)\n            return pd.read_sql_table(\n                con=alchemy_engine,\n                table_name=relation.identifier,\n                schema=relation.schema,\n            )\n\n\ndef prepare_for_adapter(adapter: BaseAdapter, function: Any) -> Any:\n    \"\"\"Prepare the given function to be used with string-like inputs\n    (for relations) on the given adapter.\"\"\"\n\n    @functools.wraps(function)\n    def wrapped(quoted_relation: str, *args, **kwargs) -> Any:\n        relation = adapter.Relation.create(\n            *quoted_relation.split(\".\"), type=RelationType.Table\n        )\n        return function(adapter, relation, *args, **kwargs)\n\n    return wrapped\n\n\ndef reconstruct_adapter(config: RuntimeConfig, manifest: Manifest, macro_manifest: MacroManifest) -> BaseAdapter:\n    from dbt.tracking import do_not_track\n\n    # Prepare the DBT to not to track us.\n    do_not_track()\n\n    # Prepare the plugin loading system to handle the adapter.\n    factory.load_plugin(config.credentials.type)\n    factory.load_plugin(config.python_adapter_credentials.type)\n    factory.register_adapter(config)\n\n    # Initialize the adapter\n    db_adapter = factory.get_adapter(config)\n    db_adapter._macro_manifest_lazy = macro_manifest\n    reload_adapter_cache(db_adapter, manifest)\n\n    return db_adapter\n\n\ndef reload_adapter_cache(adapter: BaseAdapter, manifest: Manifest) -> None:\n    with new_connection(adapter, \"fal:reload_adapter_cache\"):\n        adapter.set_relations_cache(manifest, True)\n\n\n@contextmanager\ndef new_connection(adapter: BaseAdapter, connection_name: str) -> Connection:\n    with adapter.connection_named(connection_name):\n        yield adapter.connections.get_thread_connection()\n", "path": "projects/adapter/src/dbt/adapters/fal_experimental/adapter_support.py"}]}