# @barelyhuman/knex-types

> Generate Model types from Knex

Latest version **0.0.5** (published 2024-03-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install @barelyhuman/knex-types
pnpm add @barelyhuman/knex-types
yarn add @barelyhuman/knex-types
bun add @barelyhuman/knex-types
```

## 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.5 |
| Published | 2024-03-27 |
| First published | 2024-03-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | >=12 |
| Dependencies | 1 |
| Unpacked size | 45.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | reaper |
| Maintainers | barelyreaper |
| Keywords | knex, types, typescript, generator |

## Links

- npm: https://www.npmjs.com/package/@barelyhuman/knex-types
- Repository: https://github.com/barelyhuman/knex-types
- Homepage: https://github.com/barelyhuman/knex-types#readme
- Issues: https://github.com/barelyhuman/knex-types/issues
- npm.io page: https://npm.io/package/@barelyhuman/knex-types

## Dependencies (1)

- [knex-schema-inspector](https://npm.io/package/knex-schema-inspector.md) ^3.1.0

## 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.5 (latest) — 2024-03-27
- 0.0.4 — 2024-03-27
- 0.0.3 — 2024-03-26
- 0.0.2 — 2024-03-26
- 0.0.1 — 2024-03-26

## README

# @barelyhuman/knex-types

> Generate Model types from Knex

- [@barelyhuman/knex-types](#barelyhumanknex-types)
  - [Schema Support](#schema-support)
  - [Usage](#usage)
  - [License](#license)

## Schema Support

While the below checklist mentions **Partial**, most of what the library can generate should be usable. It says partial because things like `enum` and other constraints that can be used to generate better types and models for knex are still not done.

- [x] Sqlite
- [ ] Postgres (Partial)
- [ ] MSSQL (Partial)
- [ ] Oracle (Partial)

## Usage

```js
// in CJS
import { generateTypes } from "@barelyhuman/knex-types";
const knexInstance = knex(config);

generateTypes(knexInstance, {
  output: "./types.d.ts",
}).then((d) => {
  // Done
});
```

```js
// in ESM
import { generateTypes } from "@barelyhuman/knex-types";
const knexInstance = knex(config);
await generateTypes(knexInstance, {
  output: "./types.d.ts",
});
```

## License

[MIT](/LICENSE)

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