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

Enums custom schema #2048

Merged
merged 42 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
197fe9f
Add optional dependency
SferaDev Feb 19, 2024
bbe5598
Add wire protocol driver
SferaDev Feb 19, 2024
166046f
Add http client
SferaDev Mar 7, 2024
0ea0a21
Merge branch 'main' into xata
SferaDev Mar 8, 2024
51916c2
Merge branch 'main' into xata
SferaDev Mar 11, 2024
ffe44a7
Merge branch 'main' into xata
SferaDev Mar 13, 2024
ab1cfdf
Merge pull request #2008 from drizzle-team/beta
AndriiSherman Mar 14, 2024
5eaac68
Merge branch 'beta' into xata
AndriiSherman Mar 14, 2024
0d856d8
Remove xata-pg
SferaDev Mar 15, 2024
e46c22c
Update dependency
SferaDev Mar 15, 2024
6ce62ea
Update migrator
SferaDev Mar 15, 2024
e3498d8
Add xata test setup
AndriiSherman Mar 15, 2024
29c3216
Merge branch 'xata' of github.com:SferaDev/drizzle-orm into xata
AndriiSherman Mar 15, 2024
e09845c
Fix a few tests for xata-http
AndriiSherman Mar 16, 2024
be1fd1a
Fix sqlite-proxy run behaviour
AndriiSherman Mar 16, 2024
e4bc89e
Fix Neon HTTP driver types, implement raw query support for batch, fi…
dankochetov Mar 18, 2024
beb9359
Fix JSON formatting config
dankochetov Mar 18, 2024
34d3108
Update dprint ignore
dankochetov Mar 18, 2024
bf39e45
Bump ORM version
dankochetov Mar 18, 2024
91968c5
Merge pull request #2033 from drizzle-team/fix-neon-http-types
dankochetov Mar 18, 2024
788f251
Fix typos in pipeline
dankochetov Mar 18, 2024
722a662
Merge branch 'main' into fix-neon-http-types
dankochetov Mar 18, 2024
6e8fe77
Bump actions versions
dankochetov Mar 18, 2024
96c8046
Fix flag
dankochetov Mar 18, 2024
6c3ff8e
Merge pull request #2036 from drizzle-team/pipeline-updates
dankochetov Mar 18, 2024
676d917
Merge branch 'main' into proxy-run
dankochetov Mar 18, 2024
3a26b09
Update changelog
dankochetov Mar 18, 2024
d09eaba
Merge pull request #2034 from drizzle-team/fix-neon-http-types
dankochetov Mar 18, 2024
52a2278
Merge pull request #2038 from drizzle-team/proxy-run
dankochetov Mar 18, 2024
995ecca
Bump action versions
dankochetov Mar 18, 2024
f2ec232
Merge pull request #2039 from drizzle-team/fix-neon-http-types
dankochetov Mar 18, 2024
d96f264
Add Xata http client
SferaDev Mar 7, 2024
04e4880
Merge branch 'xata' of github.com:SferaDev/drizzle-orm into xata
AndriiSherman Mar 19, 2024
9ea7d5f
Move tests to vitest
AndriiSherman Mar 19, 2024
d693765
Add release notes and bump version
AndriiSherman Mar 19, 2024
b905e92
Remove xata-http from ava tests
AndriiSherman Mar 19, 2024
85f6d5e
-
AndriiSherman Mar 19, 2024
c9a0caa
Merge pull request #1902 from SferaDev/xata
AndriiSherman Mar 19, 2024
9448a16
Fix pipeline xata tests
AndriiSherman Mar 19, 2024
3216719
Fix reject test for xata-http
AndriiSherman Mar 19, 2024
c24e818
Add custom schema support to Postgres enums
dankochetov Mar 20, 2024
9e6a6ee
Add Xata credentials to branch pipeline
dankochetov Mar 20, 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
8 changes: 4 additions & 4 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -47,7 +47,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
Expand All @@ -60,6 +60,6 @@ jobs:
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
16 changes: 9 additions & 7 deletions .github/workflows/release-feature-branch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ jobs:
ports:
- 3306:3306
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

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

- uses: pnpm/action-setup@v2
- uses: pnpm/action-setup@v3
name: Install pnpm
id: pnpm-install
with:
Expand All @@ -67,9 +67,9 @@ jobs:
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT

- uses: actions/cache@v3
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
Expand All @@ -92,8 +92,8 @@ jobs:
is_version_published="$(npm view ${{ matrix.package }} versions --json | jq -r '.[] | select(. == "'$version'") | . == "'$version'"')"

if [[ "$is_version_published" == "true" ]]; then
echo "\`${{ matrix.package }}@ $version\` already published, adding tag \`$tag\`" >> $GITHUB_STEP_SUMMARY
npm dist-tag add ${{ matrix.package }}@ $version $tag
echo "\`${{ matrix.package }}$version\` already published, adding tag \`$tag\`" >> $GITHUB_STEP_SUMMARY
npm dist-tag add ${{ matrix.package }}@$version $tag
else
{
echo "version=$version"
Expand All @@ -114,6 +114,8 @@ jobs:
MYSQL_CONNECTION_STRING: mysql://root:root@localhost:3306/drizzle
PLANETSCALE_CONNECTION_STRING: ${{ secrets.PLANETSCALE_CONNECTION_STRING }}
NEON_CONNECTION_STRING: ${{ secrets.NEON_CONNECTION_STRING }}
XATA_API_KEY: ${{ secrets.XATA_API_KEY }}
XATA_BRANCH: ${{ secrets.XATA_BRANCH }}
LIBSQL_URL: file:local.db
run: |
if [[ ${{ github.event_name }} != "push" && "${{ github.event.pull_request.head.repo.full_name }}" != "${{ github.repository }}" ]]; then
Expand Down
16 changes: 9 additions & 7 deletions .github/workflows/release-latest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ jobs:
ports:
- 3306:3306
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

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

- uses: pnpm/action-setup@v2
- uses: pnpm/action-setup@v3
name: Install pnpm
id: pnpm-install
with:
Expand All @@ -60,9 +60,9 @@ jobs:
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT

- uses: actions/cache@v3
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
Expand All @@ -83,8 +83,8 @@ jobs:
is_version_published="$(npm view ${{ matrix.package }} versions --json | jq -r '.[] | select(. == "'$version'") | . == "'$version'"')"

if [[ "$is_version_published" == "true" ]]; then
echo "\`${{ matrix.package }}@ $version\` already published, adding tag \`latest\`" >> $GITHUB_STEP_SUMMARY
npm dist-tag add ${{ matrix.package }}@ $version latest
echo "\`${{ matrix.package }}@$version\` already published, adding tag \`latest\`" >> $GITHUB_STEP_SUMMARY
npm dist-tag add ${{ matrix.package }}@$version latest
elif [[ "$latest" != "$version" ]]; then
echo "Latest: $latest"
echo "Current: $version"
Expand Down Expand Up @@ -117,6 +117,8 @@ jobs:
MYSQL_CONNECTION_STRING: mysql://root:root@localhost:3306/drizzle
PLANETSCALE_CONNECTION_STRING: ${{ secrets.PLANETSCALE_CONNECTION_STRING }}
NEON_CONNECTION_STRING: ${{ secrets.NEON_CONNECTION_STRING }}
XATA_API_KEY: ${{ secrets.XATA_API_KEY }}
XATA_BRANCH: ${{ secrets.XATA_BRANCH }}
LIBSQL_URL: file:local.db
run: |
if [[ "${{ matrix.package }}" == "drizzle-orm" ]]; then
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/unpublish-release-feature-branch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ jobs:
- eslint-plugin-drizzle
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
Expand Down
3 changes: 3 additions & 0 deletions changelogs/drizzle-orm/0.30.3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- 🎉 Added raw query support (`db.execute(...)`) to batch API in Neon HTTP driver
- 🐛 Fixed `@neondatabase/serverless` HTTP driver types issue (#1945, neondatabase/serverless#66)
- 🐛 Fixed sqlite-proxy driver `.run()` result
25 changes: 25 additions & 0 deletions changelogs/drizzle-orm/0.30.4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
## New Features

### 🎉 xata-http driver support

According their **[official website](https://xata.io)**, Xata is a Postgres data platform with a focus on reliability, scalability, and developer experience. The Xata Postgres service is currently in beta, please see the [Xata docs](https://xata.io/docs/postgres) on how to enable it in your account.

Drizzle ORM natively supports both the `xata` driver with `drizzle-orm/xata` package and the **[`postgres`](#postgresjs)** or **[`pg`](#node-postgres)** drivers for accessing a Xata Postgres database.

The following example use the Xata generated client, which you obtain by running the [xata init](https://xata.io/docs/getting-started/installation) CLI command.

```bash
pnpm add drizzle-orm @xata.io/client
```

```ts
import { drizzle } from 'drizzle-orm/xata-http';
import { getXataClient } from './xata'; // Generated client

const xata = getXataClient();
const db = drizzle(xata);

const result = await db.select().from(...);
```

You can also connect to Xata using `pg` or `postgres.js` drivers
8 changes: 8 additions & 0 deletions changelogs/drizzle-orm/0.30.5.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- 🎉 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']);
```
20 changes: 16 additions & 4 deletions dprint.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,25 @@
"arrowFunction.useParentheses": "force",
"jsx.quoteStyle": "preferSingle"
},
"json": {},
"json": {
"useTabs": true
},
"markdown": {},
"includes": ["**/*.{ts,tsx,js,jsx,cjs,mjs,json,md}"],
"excludes": ["**/node_modules", "**/*-lock.json"],
"includes": ["**/*.{ts,tsx,js,jsx,cjs,mjs,json}"],
"excludes": [
"**/node_modules",
"dist",
"dist-dts",
"dist.new",
"**/drizzle/**/meta",
"**/drizzle2/**/meta",
"**/*snapshot.json",
"**/_journal.json",
"**/tsup.config*.mjs"
],
"plugins": [
"https://plugins.dprint.dev/typescript-0.83.0.wasm",
"https://plugins.dprint.dev/json-0.17.0.wasm",
"https://plugins.dprint.dev/json-0.19.2.wasm",
"https://plugins.dprint.dev/markdown-0.15.2.wasm"
]
}
Loading