# SQLRecordManager

> **Class** in `langchain_community`

📖 [View in docs](https://reference.langchain.com/python/langchain-community/indexes/_sql_record_manager/SQLRecordManager)

A SQL Alchemy based implementation of the record manager.

## Signature

```python
SQLRecordManager(
    self,
    namespace: str,
    *,
    engine: Optional[Union[Engine, AsyncEngine]] = None,
    db_url: Union[None, str, URL] = None,
    engine_kwargs: Optional[Dict[str, Any]] = None,
    async_mode: bool = False,
)
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `namespace` | `str` | Yes | The namespace associated with this record manager. |
| `engine` | `Optional[Union[Engine, AsyncEngine]]` | No | An already existing SQL Alchemy engine. Default is None. (default: `None`) |
| `db_url` | `Union[None, str, URL]` | No | A database connection string used to create an SQL Alchemy engine. Default is None. (default: `None`) |
| `engine_kwargs` | `Optional[Dict[str, Any]]` | No | Additional keyword arguments to be passed when creating the engine. Default is an empty dictionary. (default: `None`) |
| `async_mode` | `bool` | No | Whether to create an async engine. Driver should support async operations. It only applies if db_url is provided. Default is False. (default: `False`) |

## Extends

- `RecordManager`

## Constructors

```python
__init__(
    self,
    namespace: str,
    *,
    engine: Optional[Union[Engine, AsyncEngine]] = None,
    db_url: Union[None, str, URL] = None,
    engine_kwargs: Optional[Dict[str, Any]] = None,
    async_mode: bool = False,
) -> None
```

| Name | Type |
|------|------|
| `namespace` | `str` |
| `engine` | `Optional[Union[Engine, AsyncEngine]]` |
| `db_url` | `Union[None, str, URL]` |
| `engine_kwargs` | `Optional[Dict[str, Any]]` |
| `async_mode` | `bool` |


## Properties

- `engine`
- `dialect`
- `session_factory`

## Methods

- [`create_schema()`](https://reference.langchain.com/python/langchain-community/indexes/_sql_record_manager/SQLRecordManager/create_schema)
- [`acreate_schema()`](https://reference.langchain.com/python/langchain-community/indexes/_sql_record_manager/SQLRecordManager/acreate_schema)
- [`get_time()`](https://reference.langchain.com/python/langchain-community/indexes/_sql_record_manager/SQLRecordManager/get_time)
- [`aget_time()`](https://reference.langchain.com/python/langchain-community/indexes/_sql_record_manager/SQLRecordManager/aget_time)
- [`update()`](https://reference.langchain.com/python/langchain-community/indexes/_sql_record_manager/SQLRecordManager/update)
- [`aupdate()`](https://reference.langchain.com/python/langchain-community/indexes/_sql_record_manager/SQLRecordManager/aupdate)
- [`exists()`](https://reference.langchain.com/python/langchain-community/indexes/_sql_record_manager/SQLRecordManager/exists)
- [`aexists()`](https://reference.langchain.com/python/langchain-community/indexes/_sql_record_manager/SQLRecordManager/aexists)
- [`list_keys()`](https://reference.langchain.com/python/langchain-community/indexes/_sql_record_manager/SQLRecordManager/list_keys)
- [`alist_keys()`](https://reference.langchain.com/python/langchain-community/indexes/_sql_record_manager/SQLRecordManager/alist_keys)
- [`delete_keys()`](https://reference.langchain.com/python/langchain-community/indexes/_sql_record_manager/SQLRecordManager/delete_keys)
- [`adelete_keys()`](https://reference.langchain.com/python/langchain-community/indexes/_sql_record_manager/SQLRecordManager/adelete_keys)

---

[View source on GitHub](https://github.com/langchain-ai/langchain-community/blob/4b280287bd55b99b44db2dd849f02d66c89534d5/libs/community/langchain_community/indexes/_sql_record_manager.py#L96)