Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hacks #1

Open
wants to merge 34 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
7b59d02
feat: runtime enum support
lsnow99 Feb 18, 2024
c8e4a3e
add cli flag description
lsnow99 Feb 18, 2024
d6a9b95
support single enum value
lsnow99 Feb 18, 2024
0ebd72a
feat: add skip-domains flag
RobinClowers Mar 8, 2024
f8a3300
camel case edits
brettbedarfmw Mar 8, 2024
56a854f
ignore generated types
brettbedarfmw Mar 8, 2024
90b7e4a
add lower case option
brettbedarfmw Mar 8, 2024
b0b85d7
column comments
elitan Mar 17, 2024
9e2b3e4
Merge pull request #1 from elitan/column-comments
elitan Mar 17, 2024
633599f
fix
elitan Mar 17, 2024
fea605a
feat: adjust API for --no-domains flag
RobinBlomberg Mar 17, 2024
997bd93
Update package.json
tmrclark Mar 12, 2024
2b3d30f
Update package.json
tmrclark Mar 12, 2024
5016662
dont support v18
tmrclark Mar 12, 2024
7fb5ef9
Set kysely-bun-worker as an optional peer dep
arempe93 Mar 17, 2024
e3676dc
chore: bump deps
RobinBlomberg Mar 17, 2024
f6a2c4e
Merge branch 'master' into elitan/master
RobinBlomberg Mar 17, 2024
d199d82
feat: adjust comment serialization
RobinBlomberg Mar 17, 2024
73d81a2
Merge branch 'master' into logan/runtime-enum-support
RobinBlomberg Mar 17, 2024
3a5fc56
refactor: adjust code for runtime enums
RobinBlomberg Mar 17, 2024
bd18848
chore: bump version
RobinBlomberg Mar 17, 2024
4411451
fix lowercase
brettbedarfmw Mar 17, 2024
9c13bac
lowercase setting ignores existing camel/pascal/mixed case identifiers
brettbedarfmw Mar 18, 2024
684d30a
fix: domain flag is respected
RobinClowers Mar 18, 2024
2faec07
chore: bump version
RobinBlomberg Mar 19, 2024
569096c
fix flags in readme
jrhizor Mar 27, 2024
be70e25
docs: add polar.sh funding information
RobinBlomberg Mar 31, 2024
8ff7048
fix(cli): make --print work again
RobinBlomberg Mar 31, 2024
e7f8d14
chore: bump dependencies
RobinBlomberg Mar 31, 2024
928c3cd
Fixing bit IdentifierNode to be boolean instead of buffer
Apr 2, 2024
a6a4889
chore: bump version
RobinBlomberg Apr 18, 2024
61592ae
.env.example
brettbedarfmw Jun 11, 2024
a457486
Merge remote-tracking branch 'upstream/master'
brettbedarfmw Jun 20, 2024
14982c3
Merge branch 'master' into qq-hacks
brettbedarfmw Jun 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DATABASE_URL="Server=10.49.100.31;Database=MWI;User Id=QQPROD;Password={PROD_PW}"
# MWISPR
# DATABASE_URL="Server=10.49.100.208;Database=MWISPR;User Id=QQPROD;Password={PROD_PW}"
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@
**/*.DS_Store
**/*.tsbuildinfo
**/.env
.vscode/settings.json
output/
gen/
.vscode/settings.json
gen/vis-full-db.d.ts
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>
35 changes: 20 additions & 15 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 @@ -36,7 +36,8 @@
"start": "node ./dist/cli/bin.js",
"test": "ts-node-dev ./src/index.test.ts",
"test:watch": "ts-node-dev --quiet --respawn ./src/index.test.ts",
"upgrade": "ncu -u"
"upgrade": "ncu -u",
"postinstall": "test -d node_modules/kysely/dist || (cd node_modules/kysely && pnpm run build)"
},
"dependencies": {
"chalk": "4.1.2",
Expand All @@ -49,30 +50,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 +100,7 @@
"optional": false
},
"kysely-bun-worker": {
"optional": false
"optional": true
},
"mysql2": {
"optional": true
Expand All @@ -114,12 +115,16 @@
"optional": true
}
},

"eslintConfig": {
"extends": [
"@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