# Adapter

All adapters share the same set of methods. That enables you to switch an adapter for a different one, and everything will work just fine.

For every adapter, given method takes the very same argument(s) and behaves in similar fashion. Eventually, some adapters might throw (e.g. when connection to DB is lost), but generally speaking (for instance) `getItem` will always take a string as an argument (`key`), will return an Item (if found) or `undefined` (if not found). Always, regardless of the adapter being used at the moment.

Methods described on following pages explain what those methods consume and what is being returned. This will come in handy when you will be constructing your own adapters, to stay consistent with all other adapters.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://stash-it.gitbook.io/stash-it/api/adapter.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
