Skip to content

Commit

Permalink
Add readme
Browse files Browse the repository at this point in the history
  • Loading branch information
zamarawka committed Dec 15, 2021
1 parent 6a5edda commit 8b5e798
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 5 deletions.
45 changes: 44 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,44 @@
# typeorm-explain
[![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.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{
"name": "typeorm-explain",
"version": "0.0.1",
"description": "",
"main": "index.js",
"description": "Tiny helper to wrap TypeORM's query builder queries to EXPLAIN",
"main": "lib",
"module": "esm",
"types": "lib/index.d.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"format": "prettier --write src",
Expand Down

0 comments on commit 8b5e798

Please sign in to comment.