# Not able to use the custom adapter

**URL:** <https://discourse.getdbt.com/t/not-able-to-use-the-custom-adapter/15007>\
**Category:** Help\
**Created:** [August 20, 2024, 10:41am UTC](https://discourse.getdbt.com/t/not-able-to-use-the-custom-adapter/15007 "2024-08-20T10:41:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ambuj](https://avatars.discourse-cdn.com/v4/letter/a/9d8465/32.png) [@Ambuj](https://discourse.getdbt.com/u/Ambuj)\
**Post date:** [August 20, 2024, 10:41am UTC](https://discourse.getdbt.com/t/not-able-to-use-the-custom-adapter/15007/1 "2024-08-20T10:41:18Z")

</div>

I am trying to build a new adapter for one of the database so i created the custom macro in adapter.sql

{% macro mybaseadapter\_\_list\_schemas(database) -%}

SELECT SCHEMA\_NAME FROM SYS.SCHEMAS;

{% endmacro %}

and then the function in impl to use this macro

def list\_schemas(self, database: str):  
schemas = self.execute\_macro(“mybaseadapter\_\_list\_schemas”)  
rel = [self.Relation.create(database=database, schema = schema) for schema in schemas]  
return rel

but when i use the dbt run command i get this error  
Encountered an error:  
‘BaseRelation’ object has no attribute ‘lower’  
09:21:26 Traceback (most recent call last):  
File “/Users/Downloads/Trial\_Proj/dbt-env/lib/python3.11/site-packages/dbt/cli/requires.py”, line 138, in wrapper  
result, success = func(\*args, \*\*kwargs)  
^^^^^^^^^^^^^^^^^^^^^  
File “/Users/Downloads/Trial\_Proj/dbt-env/lib/python3.11/site-packages/dbt/cli/requires.py”, line 101, in wrapper  
return func(\*args, \*\*kwargs)  
^^^^^^^^^^^^^^^^^^^^^  
File “/Users/Downloads/Trial\_Proj/dbt-env/lib/python3.11/site-packages/dbt/cli/requires.py”, line 218, in wrapper  
return func(\*args, \*\*kwargs)  
^^^^^^^^^^^^^^^^^^^^^  
File “/Users/Downloads/Trial\_Proj/dbt-env/lib/python3.11/site-packages/dbt/cli/requires.py”, line 247, in wrapper  
return func(\*args, \*\*kwargs)  
^^^^^^^^^^^^^^^^^^^^^  
File “/Users/Downloads/Trial\_Proj/dbt-env/lib/python3.11/site-packages/dbt/cli/requires.py”, line 294, in wrapper  
return func(\*args, \*\*kwargs)  
^^^^^^^^^^^^^^^^^^^^^  
File “/Users/Downloads/Trial\_Proj/dbt-env/lib/python3.11/site-packages/dbt/cli/requires.py”, line 332, in wrapper  
return func(\*args, \*\*kwargs)  
^^^^^^^^^^^^^^^^^^^^^  
File “/Users/Downloads/Trial\_Proj/dbt-env/lib/python3.11/site-packages/dbt/cli/main.py”, line 569, in run  
results = task.run()  
^^^^^^^^^^  
File “/Users/Downloads/Trial\_Proj/dbt-env/lib/python3.11/site-packages/dbt/task/runnable.py”, line 526, in run  
result = self.execute\_with\_hooks(selected\_uids)  
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
File “/Users/Downloads/Trial\_Proj/dbt-env/lib/python3.11/site-packages/dbt/task/runnable.py”, line 486, in execute\_with\_hooks  
self.before\_run(adapter, selected\_uids)  
File “/Users/Downloads/Trial\_Proj/dbt-env/lib/python3.11/site-packages/dbt/task/run.py”, line 459, in before\_run  
self.create\_schemas(adapter, required\_schemas)  
File “/Users/Downloads/Trial\_Proj/dbt-env/lib/python3.11/site-packages/dbt/task/runnable.py”, line 627, in create\_schemas  
existing\_schemas\_lowered.update(ls\_future.result())  
^^^^^^^^^^^^^^^^^^  
File “/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/concurrent/futures/\_base.py”, line 449, in result  
return self.\_\_get\_result()  
^^^^^^^^^^^^^^^^^^^  
File “/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/concurrent/futures/\_base.py”, line 401, in \_\_get\_result  
raise self.\_exception  
File “/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/concurrent/futures/thread.py”, line 58, in run  
result = self.fn(\*self.args, \*\*self.kwargs)  
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
File “/Users/Downloads/Trial\_Proj/dbt-env/lib/python3.11/site-packages/dbt\_common/utils/executor.py”, line 16, in connected  
return func(\*args, \*\*kwargs)  
^^^^^^^^^^^^^^^^^^^^^  
File “/Users/Downloads/Trial\_Proj/dbt-env/lib/python3.11/site-packages/dbt/task/runnable.py”, line 600, in list\_schemas  
return [  
^  
File “/Users/Downloads/Trial\_Proj/dbt-env/lib/python3.11/site-packages/dbt/task/runnable.py”, line 601, in  
(db\_lowercase, s.lower())  
^^^^^^^  
AttributeError: ‘BaseRelation’ object has no attribute ‘lower’
