Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
AndriiSherman authored Jul 19, 2024
2 parents 392d4e9 + 15ff6b4 commit 240dd1c
Show file tree
Hide file tree
Showing 270 changed files with 36,426 additions and 51,432 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ examples
**/*.mjs
**/*.cjs
**/playground
integration-tests/tests/prisma/*/client
integration-tests/tests/prisma/*/drizzle
18 changes: 16 additions & 2 deletions .eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,17 @@ plugins:
- import
- unused-imports
- no-instanceof
- drizzle
- drizzle-internal
overrides:
- files:
- '**/tests/**/*.ts'
- '**/type-tests/**/*.ts'
rules:
import/extensions: 'off'
no-instanceof: 'off'
- files: 'eslint-plugin-drizzle/**/*'
rules:
import/extensions: 'off'
rules:
'@typescript-eslint/consistent-type-imports':
- error
Expand All @@ -24,6 +34,10 @@ rules:
import/no-useless-path-segments: error
import/newline-after-import: error
import/no-duplicates: error
import/extensions:
- error
- always
- ignorePackages: true
'@typescript-eslint/no-explicit-any': 'off'
'@typescript-eslint/no-non-null-assertion': 'off'
'@typescript-eslint/no-namespace': 'off'
Expand Down Expand Up @@ -61,7 +75,7 @@ rules:
'unicorn/relative-url-style': 'off'
'eqeqeq': 'error'
'no-instanceof/no-instanceof': 'error'
'drizzle/require-entity-kind': 'error'
'drizzle-internal/require-entity-kind': 'error'
'unicorn/prefer-string-replace-all': 'off'
'unicorn/no-process-exit': 'off'
'@typescript-eslint/ban-ts-comment': 'off'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
permissions:
actions: read
contents: read
Expand Down
49 changes: 44 additions & 5 deletions .github/workflows/release-feature-branch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,32 @@ jobs:
contents: read
id-token: write
services:
postgres-postgis:
image: postgis/postgis:16-3.4
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: drizzle
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 54322:5432
postgres-vector:
image: pgvector/pgvector:pg16
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: drizzle
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 54321:5432
postgres:
image: postgres:14
env:
Expand All @@ -35,7 +61,7 @@ jobs:
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
- 55432:5432
mysql:
image: mysql:8
env:
Expand All @@ -47,13 +73,13 @@ jobs:
--health-timeout 5s
--health-retries 5
ports:
- 3306:3306
- 33306:3306
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 18
node-version: '18.18'
registry-url: 'https://registry.npmjs.org'

- uses: pnpm/action-setup@v3
Expand Down Expand Up @@ -105,15 +131,28 @@ jobs:
- name: Build
if: steps.checks.outputs.has_new_release == 'true'
run: |
(
cd drizzle-orm
pnpm prisma generate --schema src/prisma/schema.prisma
)
(
cd integration-tests
pnpm prisma generate --schema tests/prisma/pg/schema.prisma
pnpm prisma generate --schema tests/prisma/mysql/schema.prisma
pnpm prisma generate --schema tests/prisma/sqlite/schema.prisma
)
pnpm build
- name: Run tests
if: steps.checks.outputs.has_new_release == 'true'
env:
PG_CONNECTION_STRING: postgres://postgres:postgres@localhost:5432/drizzle
MYSQL_CONNECTION_STRING: mysql://root:root@localhost:3306/drizzle
PG_CONNECTION_STRING: postgres://postgres:postgres@localhost:55432/drizzle
PG_VECTOR_CONNECTION_STRING: postgres://postgres:postgres@localhost:54321/drizzle
PG_POSTGIS_CONNECTION_STRING: postgres://postgres:postgres@localhost:54322/drizzle
MYSQL_CONNECTION_STRING: mysql://root:root@localhost:33306/drizzle
PLANETSCALE_CONNECTION_STRING: ${{ secrets.PLANETSCALE_CONNECTION_STRING }}
NEON_CONNECTION_STRING: ${{ secrets.NEON_CONNECTION_STRING }}
TIDB_CONNECTION_STRING: ${{ secrets.TIDB_CONNECTION_STRING }}
XATA_API_KEY: ${{ secrets.XATA_API_KEY }}
XATA_BRANCH: ${{ secrets.XATA_BRANCH }}
LIBSQL_URL: file:local.db
Expand Down
49 changes: 44 additions & 5 deletions .github/workflows/release-latest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,32 @@ jobs:
- eslint-plugin-drizzle
runs-on: ubuntu-20.04
services:
postgres-postgis:
image: postgis/postgis:16-3.4
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: drizzle
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 54322:5432
postgres-vector:
image: pgvector/pgvector:pg16
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: drizzle
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 54321:5432
postgres:
image: postgres:14
env:
Expand All @@ -28,7 +54,7 @@ jobs:
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
- 55432:5432
mysql:
image: mysql:8
env:
Expand All @@ -40,13 +66,13 @@ jobs:
--health-timeout 5s
--health-retries 5
ports:
- 3306:3306
- 33306:3306
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 18
node-version: '18.18'
registry-url: 'https://registry.npmjs.org'

- uses: pnpm/action-setup@v3
Expand Down Expand Up @@ -108,15 +134,28 @@ jobs:
- name: Build
if: steps.checks.outputs.has_new_release == 'true'
run: |
(
cd drizzle-orm
pnpm prisma generate --schema src/prisma/schema.prisma
)
(
cd integration-tests
pnpm prisma generate --schema tests/prisma/pg/schema.prisma
pnpm prisma generate --schema tests/prisma/mysql/schema.prisma
pnpm prisma generate --schema tests/prisma/sqlite/schema.prisma
)
pnpm build
- name: Run tests
if: steps.checks.outputs.has_new_release == 'true'
env:
PG_CONNECTION_STRING: postgres://postgres:postgres@localhost:5432/drizzle
MYSQL_CONNECTION_STRING: mysql://root:root@localhost:3306/drizzle
PG_CONNECTION_STRING: postgres://postgres:postgres@localhost:55432/drizzle
PG_VECTOR_CONNECTION_STRING: postgres://postgres:postgres@localhost:54321/drizzle
PG_POSTGIS_CONNECTION_STRING: postgres://postgres:postgres@localhost:54322/drizzle
MYSQL_CONNECTION_STRING: mysql://root:root@localhost:33306/drizzle
PLANETSCALE_CONNECTION_STRING: ${{ secrets.PLANETSCALE_CONNECTION_STRING }}
NEON_CONNECTION_STRING: ${{ secrets.NEON_CONNECTION_STRING }}
TIDB_CONNECTION_STRING: ${{ secrets.TIDB_CONNECTION_STRING }}
XATA_API_KEY: ${{ secrets.XATA_API_KEY }}
XATA_BRANCH: ${{ secrets.XATA_BRANCH }}
LIBSQL_URL: file:local.db
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unpublish-release-feature-branch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

- uses: actions/setup-node@v4
with:
node-version: 18
node-version: '18.18'
registry-url: 'https://registry.npmjs.org'

- name: Unpublish
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ dist.new
.rollup.cache
dist-dts
rollup.config-*.mjs
*.log
.DS_Store
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18
18.18
2 changes: 1 addition & 1 deletion changelogs/drizzle-orm/0.30.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ const usersOnUpdate = pgTable('users_on_update', {

- [BUG]: insertions on columns with the smallserial datatype are not optional - #1848

Thanks @Angelelz and @gabrielDonnantuoni!
Thanks @Angelelz and @gabrielDonnantuoni!
10 changes: 10 additions & 0 deletions changelogs/drizzle-orm/0.30.7-preview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
- 🎉 Added custom schema support to enums in Postgres:
```ts
import { pgSchema } from 'drizzle-orm/pg-core';

const mySchema = pgSchema('mySchema');
const colors = mySchema.enum('colors', ['red', 'green', 'blue']);
```

- 🐛 Split `where` clause in Postgres `.onConflictDoUpdate` method into `setWhere` and `targetWhere` clauses, to support both `where` cases in `on conflict ...` clause (#1628, #1302)
- 🐛 Fix query generation for `where` clause in Postgres `.onConflictDoNothing` method, as it was placed in a wrong spot (#1628)
Loading

0 comments on commit 240dd1c

Please sign in to comment.