Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
brettbedarfmw committed Jun 20, 2024
2 parents 80695e9 + a6a4889 commit a457486
Show file tree
Hide file tree
Showing 25 changed files with 596 additions and 229 deletions.
19 changes: 15 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@

- [Installation](#installation)
- [Generating type definitions](#generating-type-definitions)
- [Include/exclude patterns](#includeexclude-patterns)
- [Help](#help)
- [Using the type definitions](#using-the-type-definitions)
- [Issue funding](#issue-funding)

## Installation

Expand Down Expand Up @@ -99,24 +102,26 @@ export interface DB {

## Include/exclude patterns

You can choose which tables should be included during code generation by providing a glob pattern to the `--include` and `--exclude` flags. We use [micromatch](https://github.com/micromatch/micromatch) under the hood which provides advanced glob support. For instance, if you only want to include your public tables:
You can choose which tables should be included during code generation by providing a glob pattern to the `--include-pattern` and `--exclude-pattern` flags. We use [micromatch](https://github.com/micromatch/micromatch) under the hood which provides advanced glob support. For instance, if you only want to include your public tables:

```bash
kysely-codegen --include="public.*"
kysely-codegen --include-pattern="public.*"
```

You can also include only certain tables within a schema:

```bash
kysely-codegen --include="public.+(user|post)"
kysely-codegen --include-pattern="public.+(user|post)"
```

Or exclude an entire class of tables:

```bash
kysely-codegen --exclude="documents.*"
kysely-codegen --exclude-pattern="documents.*"
```

## Help

For more options, run `kysely-codegen --help`.

## Using the type definitions
Expand All @@ -139,3 +144,9 @@ const db = new Kysely<DB>({
const rows = await db.selectFrom('user').selectAll().execute();
// ^ { company_id: number | null; created_at: Date; email: string; id: number; ... }[]
```

## Issue funding

We use [Polar.sh](https://polar.sh/RobinBlomberg) to upvote and promote specific features that you would like to see implemented. Check the backlog and help out:

<a href="https://polar.sh/RobinBlomberg"><img src="https://polar.sh/embed/fund-our-backlog.svg?org=RobinBlomberg" /></a>
31 changes: 17 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kysely-codegen",
"version": "0.13.1",
"version": "0.15.0",
"author": "Robin Blomberg",
"license": "MIT",
"main": "./dist/index.js",
Expand Down Expand Up @@ -49,30 +49,30 @@
"devDependencies": {
"@libsql/kysely-libsql": "^0.3.0",
"@robinblomberg/eslint-config-prettier": "^0.1.4",
"@robinblomberg/eslint-config-robinblomberg": "0.26.0",
"@robinblomberg/eslint-config-robinblomberg": "0.28.0",
"@robinblomberg/prettier-config": "^0.1.2",
"@types/better-sqlite3": "^7.6.9",
"@types/git-diff": "^2.0.7",
"@types/micromatch": "^4.0.6",
"@types/minimist": "^1.2.5",
"@types/node": "^20.11.25",
"@types/pg": "^8.11.2",
"@types/node": "^20.12.2",
"@types/pg": "^8.11.4",
"@types/tedious": "^4.0.14",
"@typescript-eslint/parser": "^7.1.1",
"@typescript-eslint/parser": "^7.4.0",
"better-sqlite3": "^9.4.3",
"eslint": "^8.57.0",
"kysely": "^0.27.2",
"kysely-bun-worker": "^0.5.7",
"mysql2": "^3.9.2",
"kysely": "^0.27.3",
"kysely-bun-worker": "^0.6.0",
"mysql2": "^3.9.3",
"npm-run-all": "^4.1.5",
"pg": "^8.11.3",
"pnpm": "^8.15.4",
"pg": "^8.11.4",
"pnpm": "^8.15.5",
"prettier": "^3.2.5",
"rimraf": "^5.0.5",
"ts-node-dev": "^2.0.0",
"tsx": "^4.7.1",
"typescript": "^5.4.2",
"vitest": "^1.3.1"
"typescript": "^5.4.3",
"vitest": "^1.4.0"
},
"peerDependencies": {
"@libsql/kysely-libsql": "^0.3.0",
Expand All @@ -99,7 +99,7 @@
"optional": false
},
"kysely-bun-worker": {
"optional": false
"optional": true
},
"mysql2": {
"optional": true
Expand All @@ -119,7 +119,10 @@
"@robinblomberg/robinblomberg",
"@robinblomberg/prettier"
],
"ignorePatterns": "**/src/core/outputs/*.ts"
"ignorePatterns": "**/src/core/outputs/*.ts",
"rules": {
"unicorn/prefer-node-protocol": 0
}
},
"prettier": "@robinblomberg/prettier-config"
}
Loading

0 comments on commit a457486

Please sign in to comment.