# @viadee/nibbler

> Backup and restore PostgreSQL databases in style

Latest version **0.0.7** (published 2022-11-25) · UNLICENSED license · 0 weekly downloads

## Install

```sh
npm install @viadee/nibbler
pnpm add @viadee/nibbler
yarn add @viadee/nibbler
bun add @viadee/nibbler
```

Provides the command `nibbler`.

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.7 |
| Published | 2022-11-25 |
| First published | 2022-11-24 |
| Weekly downloads | 0 |
| License | UNLICENSED |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 5 |
| Unpacked size | 107.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | David Schütz |
| Maintainers | davemaul, danielreinert |

## Links

- npm: https://www.npmjs.com/package/@viadee/nibbler
- Homepage: https://www.viadee.de/
- npm.io page: https://npm.io/package/@viadee/nibbler

## Dependencies (5)

- [pg](https://npm.io/package/pg.md) ^8.8.0
- [figlet](https://npm.io/package/figlet.md) ^1.5.2
- [date-fns](https://npm.io/package/date-fns.md) ^2.29.1
- [inquirer](https://npm.io/package/inquirer.md) ^9.0.3
- [nanospinner](https://npm.io/package/nanospinner.md) ^1.1.0

## Recent versions

- 0.0.7 (latest) — 2022-11-25
- 0.0.6 — 2022-11-24
- 0.0.5 — 2022-11-24
- 0.0.4 — 2022-11-24
- 0.0.3 — 2022-11-24
- 0.0.2 — 2022-11-24
- 0.0.1 — 2022-11-24

## README

# Nibbler

This little fellow handles backups and restores for your PostgreSQL databases with a handy wizard directly from your terminal.

### Usage

To run Nibbler just use `npx @viadee/nibbler@latest`. The tool will guide you through the process. Just make sure to create an `nibbler.config.js` file in the directory where you want to use Nibbler. The file should look like this:

```
const config = {
  pg: '/usr/local/opt/libpq/bin',
  dumps: './dumps',
  servers: {
    local: {
      host: 'localhost',
      port: 5432,
      username: 'username',
      password: 'password',
      defaultDb: 'postgres',
    },
    'managed-server': {
      host: 'postgresql-my-hoster.net',
      port: 5432,
      username: 'username',
      password: 'password',
      defaultDb: 'postgres',
      secure: true,
      production: true,
    },
  },
};

export default config;
```

The following properties are supported:

| Parameter | Description                                                                                     | Required | Type   |
| --------- | ----------------------------------------------------------------------------------------------- | -------- | ------ |
| `pg`      | The absolute path to where the PostgreSQL binaries like `pg_dump` and `pg_restore` are located. | yes      | string |
| `dumps`   | The path relative to `.env.json` where dumps will be stored.                                    | yes      | string |
| `servers` | The colleciton of servers to operate with                                                       | yes      | array  |

A server supports following properties:

| Parameter    | Description                                                                                                                      | Required | Type    |
| ------------ | -------------------------------------------------------------------------------------------------------------------------------- | -------- | ------- |
| `host`       | Host of the PostgreSQL Server                                                                                                    | yes      | string  |
| `port`       | Port of the PostgreSQL Server                                                                                                    | yes      | string  |
| `username`   | Username of the PostgreSQL Server                                                                                                | yes      | string  |
| `password`   | Password of the PostgreSQL Server                                                                                                | yes      | string  |
| `defaultDb`  | Default database of the PostgreSQL Server. This will be used to connect to for creating a new database on restore if neccessary. | yes      | string  |
| `secure`     | Flag whether the connection should be secured.                                                                                   | no       | boolean |
| `production` | Flag to mark a server as production. Nibbler will ask for confirmation before restoring to this server.                          | no       | boolean |

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