# guff

> A no-nonsense extension of Knex migrations for use with PostgreSQL clients.

Latest version **0.1.6** (published 2019-06-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install guff
pnpm add guff
yarn add guff
bun add guff
```

## 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.1.6 |
| Published | 2019-06-18 |
| First published | 2018-10-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 4 |
| Unpacked size | 200.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Jared Lunde |
| Maintainers | jaredlunde |

## Links

- npm: https://www.npmjs.com/package/guff
- Repository: https://github.com/jaredLunde/guff
- npm.io page: https://npm.io/package/guff

## Dependencies (4)

- [chalk](https://npm.io/package/chalk.md) ^2.4.1
- [empty](https://npm.io/package/empty.md) ^0.10.1
- [invariant](https://npm.io/package/invariant.md) ^2.2.4
- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^7.1.2

## Recent versions

- 0.1.6 (latest) — 2019-06-18
- 0.1.5 — 2018-10-25
- 0.1.4 — 2018-10-25
- 0.1.3 — 2018-10-22
- 0.1.2 — 2018-10-22
- 0.1.1 — 2018-10-21
- 0.1.0 — 2018-10-19
- 0.1.0-beta.0 — 2018-10-02

## README

<h1 align="center">😤 guff</h1>
<p align="center">
  A no-nonsense extension of Knex migrations for use with PostgreSQL
  clients.
</p>

----

Guff extends the functionality of Knex with special column types and extra
utilities for building out your schemas (e.g. triggers and functions).

## Requirements
- Node 8+
- [Knex](https://knexjs.org)


```js
const guff = require('guff')

const TABLE = 'accounts'
exports.TABLE = TABLE

exports.up = function (knex, Promise) {
  return guff.createTable(
    knex,
    TABLE, [
      guff.col('uid').primary(),
      guff.col('email').unique().notNullable(),
      guff.col('password', 'text').notNullable(),
      guff.col('key'),
      guff.col('oauth_providers', 'jsonb'),
      guff.col('join_ip', 'ip').notNullable(),
      guff.col('last_ip', 'ip').notNullable(),
      guff.col('activated', 'boolean').defaultTo(false).notNullable(),
      guff.col('created_at'),
      guff.col('updated_at')
    ]
  )
}

exports.down = function (knex) {
  return guff.dropTable(knex, TABLE)
}
```

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