> For the complete documentation index, see [llms.txt](https://docs.schemajs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.schemajs.com/fundamentals/custom-queries.md).

# Custom Queries

Custom queries in **SchemaJS** offer a flexible way to define specialized database operations, simplifying the complexities of traditional database procedures without relying on raw SQL. These queries allow developers to create custom logic that can be easily reused and adapted within the application, enhancing efficiency while keeping the codebase clean and maintainable.

## Motivation

The motivation behind **SchemaJS** custom queries is to move away from the complexities and rigidity of traditional SQL procedures by allowing developers to write powerful database operations directly in JavaScript. This approach not only simplifies the process of defining and executing database logic, but also unlocks new possibilities by integrating the vast ecosystem of JavaScript libraries and tools.

## Calling Custom Queries

Custom queries can be called via:

* gRPC
