There are two major adapter types: base and sql.
BaseAdapter defines the base functionality an adapter is required to implement in order to function with dbt-core.
There are several methods which have default implementations as well as methods that require the concrete adapter to implement them.
SQLAdapter inherits from BaseAdapter, updates default implementations to work with SQL-based platforms,
and defines additional required methods to support those defaults.
An adapter is composed of several components.
- connections
- dialect
- relation caching
- integration with
dbt-core
The first two are platform-specific and require significant implementation in a concrete adapter.
The last two are largely implemented in dbt-adapters with minor adjustments in a concrete adapter.
This component is responsible for creating and managing connections to storage and compute.
dbt/adapters/{base|sql}/connections.py
This component is responsible for translating a request from dbt-core into a specific set of actions on the platform.
dbt/adapters/base/column.pydbt/adapters/base/query_headers.pydbt/adapters/base/relation.pydbt/adapters/relation_configs/*dbt/adapters/clients/jinja.pydbt/include/global_project/*
This component is responsible for managing a local cache of relations, relation metadata, and dependencies between relations.
dbt/adapters/cache.py
This component is responsible for managing the interface between dbt-core and a concrete adapter.
dbt/adapters/{base|sql}/impl.pydbt/adapters/base/meta.pydbt/adapters/base/plugin.pydbt/adapters/capability.pydbt/adapters/factory.pydbt/adapters/protocol.pydbt/adapters/contracts/*dbt/adapters/events/*dbt/adapters/exceptions/*