# numfin-sequelize

> sequelize + typescript = numfin-sequelize

Latest version **0.0.8** (published 2018-08-04) · ISC license · 0 weekly downloads

## Install

```sh
npm install numfin-sequelize
pnpm add numfin-sequelize
yarn add numfin-sequelize
bun add numfin-sequelize
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.8 |
| Published | 2018-08-04 |
| First published | 2018-08-03 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 17 KB |
| Known vulnerabilities | 0 (+5 in 1 direct dependencies) |
| Install scripts | no |
| Author | numfin |
| Maintainers | numfin |
| Keywords | sequelize, typescript, classes, numfin-sequelize |

## Links

- npm: https://www.npmjs.com/package/numfin-sequelize
- Repository: https://github.com/numfin/numfin-sequelize
- Homepage: https://github.com/numfin/numfin-sequelize#readme
- Issues: https://github.com/numfin/numfin-sequelize/issues
- npm.io page: https://npm.io/package/numfin-sequelize

## Dependencies (3)

- [sequelize](https://npm.io/package/sequelize.md) ^4.38.0
- [typescript](https://npm.io/package/typescript.md) ^3.0.1
- [@types/sequelize](https://npm.io/package/@types/sequelize.md) ^4.27.24

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 0.0.8 (latest) — 2018-08-04
- 0.0.7 — 2018-08-04
- 0.0.6 — 2018-08-04
- 0.0.5 — 2018-08-04
- 0.0.4 — 2018-08-04
- 0.0.3 — 2018-08-04
- 0.0.2 — 2018-08-04
- 0.0.1 — 2018-08-03

## README

Ez types with Sequelize!

# Example:

## Create Sequelize instance:

```javascript
// database.util.ts
import Sequelize from 'sequelize';

export const db = new Sequelize('db', 'user', 'password', {
  host: 'localhost',
  port: port,
  dialect: 'postgres',
  operatorsAliases: false,
});
```

## Create model:

```javascript
// user.model.ts
import { db } from '../database.util';
import { CreateModel, Types } from 'numfin-sequelize';

export class UserType {
  name = Types.STRING();
  // second argument of Types.UUID gives you
  // ability to make it autogenerated
  id = Types.UUID({ primaryKey: true }, true);
}
export const User = CreateModel(db, 'users', UserType);
```

## How to use it:

```javascript
// index.main.ts
import { db } from '../database.util';
import { User } from '../user.model.ts';

db.sync().then(async () => {
  // autocomplete for User fields is here
  await User.create({ name: 'hi' }); // done!
});
```

`If anything wrong - write in issues`

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