# db-scout

> get database information, generate migration files, create models based on information

Latest version **0.0.13** (published 2024-06-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install db-scout
pnpm add db-scout
yarn add db-scout
bun add db-scout
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.13 |
| Published | 2024-06-26 |
| First published | 2024-06-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 162.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | pradip kharal |
| Keywords | db, database, introspection, schema, metadata, ORM, TypeORM, SQL, Postgresql, database management, database exploration, db scout |

## Links

- npm: https://www.npmjs.com/package/db-scout
- Repository: https://github.com/92P96AK/db-scout
- Homepage: https://github.com/92P96AK/db-scout#readme
- Issues: https://github.com/92P96AK/db-scout/issues
- npm.io page: https://npm.io/package/db-scout

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.0.13 (latest) — 2024-06-26
- 0.0.12 — 2024-06-25

## README

# DB-SCOUT

DB-SCOUT is a Node.js package designed to simplify PostgreSQL database schema migration by generating migration files based on an existing schema.

## Features

- **Automatic Migration Generation**: DB-SCOUT automatically generates migration files based on your existing PostgreSQL database schema.
- **Database Agnostic**: Works specifically with PostgreSQL databases.
- **Customizable Configuration**: Easily configure DB-SCOUT to suit your project's needs.

## Installation

You can install DB-SCOUT via npm:

```bash
npm install db-scout
```

### Configuration

# Configuration

DB-SCOUT can be configured using a `dbscout.json` file in your project's root directory. Here's an example configuration:

```json
{
  "sourceDbUrl": "YOUR_POSTGRESQL_SOURCE_DATABASE_URL",
  "destinationDbUrl": "YOUR_POSTGRESQL_DESTINATION_DATABASE_URL",
  "outputDirectory": "./migrations"
}

 sourceDbUrl: The URL of your PostgreSQL database.
 outputDirectory: The directory where migration files will be generated.
```

```javascript
import { DbScout } from 'db-scout'
const dbScout= new DbScout({
 sourceDbUrl: "",
 outputDirectory: "",
 destinationDbUrl: ""
})

to get migration files use 

await dbScout.getMigration();

Your migration files will be created in a specified directory.

also to migrate generated migration files to destination url simply use

await dbScout.runMigration() 
it will run migration in transaction so if any error occurred it will roll back.

```

## License

This project is licensed under the MIT License.

## Acknowledgements

DB-SCOUT is built using Node.js and PostgreSQL.

## Next Version Targets

In the next version of DB-SCOUT, I plan to include support for additional databases, including MySQL and others. Stay tuned for updates!

---
_Source: https://npm.io/package/db-scout · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
