Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zamarawka/typeorm-explain
Tiny helper to wrap TypeORM's query builder queries to EXPLAIN
https://github.com/zamarawka/typeorm-explain
orm typeorm typescript
Last synced: about 10 hours ago
JSON representation
Tiny helper to wrap TypeORM's query builder queries to EXPLAIN
- Host: GitHub
- URL: https://github.com/zamarawka/typeorm-explain
- Owner: zamarawka
- License: mit
- Created: 2021-12-15T00:15:08.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2021-12-15T01:34:45.000Z (almost 3 years ago)
- Last Synced: 2024-11-14T13:38:29.569Z (3 days ago)
- Topics: orm, typeorm, typescript
- Language: TypeScript
- Homepage:
- Size: 38.1 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Ci Status](https://github.com/zamarawka/typeorm-explain/workflows/CI/badge.svg)](https://github.com/zamarawka/typeorm-explain/actions)
[![Npm version](https://img.shields.io/npm/v/typeorm-explain.svg?style=flat&logo=npm)](https://www.npmjs.com/package/typeorm-explain)# typeorm-explain
Tiny helper to wrap TypeORM's query builder queries into `EXPLAIN`.
# Install
```sh
npm install typeorm-explain
```# Usage
> Currently supports only Postgres driver. Feel free to open PR and add more drivers.
```ts
import explain from 'typeorm-explain';import { getConnection } from 'typeorm';
const userQuery = getConnection()
.createQueryBuilder()
.select('user')
.from(User, 'user')
.where('user.id = :id', { id: 1 });console.log(await explain(userQuery)); // Print explain in console
const user = await userQuery.getOne();
```# Development
```sh
npm run format # code fomatting
npm run lint # linting
npm run build # build
```Active maintenance with care and ❤️.
Feel free to send a PR.