> ## Documentation Index
> Fetch the complete documentation index at: https://docs.open-metadata.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Query Mixin

[<img src="https://img.shields.io/badge/-source-cccccc?style=flat-square" />](https://github.com/open-metadata/OpenMetadata/tree/main/ingestion/src/metadata/ingestion/ometa/mixins/query_mixin.py#L0")

# module `query_mixin`

Mixin class containing Query specific methods

To be used by OpenMetadata class

***

[<img src="https://img.shields.io/badge/-source-cccccc?style=flat-square" />](https://github.com/open-metadata/OpenMetadata/tree/main/ingestion/src/metadata/ingestion/ometa/mixins/query_mixin.py#L30")

## class `OMetaQueryMixin`

OpenMetadata API methods related to Queries.

To be inherited by OpenMetadata

***

[<img src="https://img.shields.io/badge/-source-cccccc?style=flat-square" />](https://github.com/open-metadata/OpenMetadata/tree/main/ingestion/src/metadata/ingestion/ometa/mixins/query_mixin.py#L92")

### method `get_entity_queries`

```python theme={null}
get_entity_queries(
    entity_id: Union[Uuid, str],
    fields: Optional[List[str]] = None
) → Optional[List[Query]]
```

Get the queries attached to a table

**Args:**

* `entity_id` (Union\[Uuid,str]):  entity id of given entity
* `fields` (Optional\[List\[str]]):  list of fields to be included in response

**Returns:**

* `Optional[List[Query]]`:  List of queries

***

[<img src="https://img.shields.io/badge/-source-cccccc?style=flat-square" />](https://github.com/open-metadata/OpenMetadata/tree/main/ingestion/src/metadata/ingestion/ometa/mixins/query_mixin.py#L52")

### method `ingest_entity_queries_data`

```python theme={null}
ingest_entity_queries_data(
    entity: Union[Table, Dashboard],
    queries: List[CreateQueryRequest]
) → None
```

PUT queries for an entity

**Args:**

`entity`: Entity to update

`queries`: CreateQueryRequest to add

***
