Skip to content

Commit 6cb2ff0

Browse files
committed
Add release notes
1 parent 1b5eddb commit 6cb2ff0

File tree

6 files changed

+87
-3
lines changed

6 files changed

+87
-3
lines changed

Diff for: changelogs/drizzle-kit/0.31.0.md

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
## Features and improvements
2+
3+
### Enum DDL improvements
4+
5+
For situations where you drop an `enum` value or reorder values in an `enum`, there is no native way to do this in PostgreSQL. To handle these cases, `drizzle-kit` used to:
6+
7+
- Change the column data types from the enum to text
8+
- Drop the old enum
9+
- Add the new enum
10+
- Change the column data types back to the new enum
11+
12+
However, there were a few scenarios that weren’t covered: `PostgreSQL` wasn’t updating default expressions for columns when their data types changed
13+
14+
Therefore, for cases where you either change a column’s data type from an `enum` to some other type, drop an `enum` value, or reorder `enum` values, we now do the following:
15+
16+
- Change the column data types from the enum to text
17+
- Set the default using the ::text expression
18+
- Drop the old enum
19+
- Add the new enum
20+
- Change the column data types back to the new enum
21+
- Set the default using the ::<new_enum> expression
22+
23+
### `esbuild` version upgrade
24+
25+
For `drizzle-kit` we upgraded the version to latest (`0.25.2`), thanks @paulmarsicloud
26+
27+
## Bug fixes
28+
29+
- [[BUG]: Error on Malformed Array Literal](https://github.com/drizzle-team/drizzle-orm/issues/2715) - thanks @Kratious
30+
- [[BUG]: Postgres drizzle-kit: Error while pulling indexes from a table with json/jsonb deep field index](https://github.com/drizzle-team/drizzle-orm/issues/2744) - thanks @Kratious
31+
- [goog-vulnz flags CVE-2024-24790 in esbuild 0.19.7](https://github.com/drizzle-team/drizzle-orm/issues/4045)

Diff for: changelogs/drizzle-orm/0.42.0.md

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
## Features
2+
3+
### Duplicate imports removal
4+
5+
When importing from `drizzle-orm` using custom loaders, you may encounter issues such as: `SyntaxError: The requested module 'drizzle-orm' does not provide an export named 'eq'`
6+
7+
This issue arose because there were duplicated exports in `drizzle-orm`. To address this, we added a set of tests that checks every file in `drizzle-orm` to ensure all exports are valid. These tests will fail if any new duplicated exports appear.
8+
9+
In this release, we’ve removed all duplicated exports, so you should no longer encounter this issue.
10+
11+
### `pgEnum` and `mysqlEnum` now can accept both strings and TS enums
12+
13+
If you provide a TypeScript enum, all your types will be inferred as that enum - so you can insert and retrieve enum values directly. If you provide a string union, it will work as before.
14+
15+
```ts
16+
enum Test {
17+
a = 'a',
18+
b = 'b',
19+
c = 'c',
20+
}
21+
22+
const tableWithTsEnums = mysqlTable('enums_test_case', {
23+
id: serial().primaryKey(),
24+
enum1: mysqlEnum(Test).notNull(),
25+
enum2: mysqlEnum(Test).default(Test.a),
26+
});
27+
28+
await db.insert(tableWithTsEnums).values([
29+
{ id: 1, enum1: Test.a, enum2: Test.b, enum3: Test.c },
30+
{ id: 2, enum1: Test.a, enum3: Test.c },
31+
{ id: 3, enum1: Test.a },
32+
]);
33+
34+
const res = await db.select().from(tableWithTsEnums);
35+
36+
expect(res).toEqual([
37+
{ id: 1, enum1: 'a', enum2: 'b', enum3: 'c' },
38+
{ id: 2, enum1: 'a', enum2: 'a', enum3: 'c' },
39+
{ id: 3, enum1: 'a', enum2: 'a', enum3: 'b' },
40+
]);
41+
```
42+
43+
## Improvements
44+
- Make `inArray` accept `ReadonlyArray` as a value - thanks @Zamiell
45+
- Pass row type parameter to `@planetscale/database`'s execute - thanks @ayrton
46+
- New `InferEnum` type - thanks @totigm
47+
48+
## Issues closed
49+
50+
- [Add first-class support for TS native enums](https://github.com/drizzle-team/drizzle-orm/issues/332)
51+
- [[FEATURE]: support const enums](https://github.com/drizzle-team/drizzle-orm/issues/2798)
52+
- [[BUG]: SyntaxError: The requested module 'drizzle-orm' does not provide an export named 'lte'](https://github.com/drizzle-team/drizzle-orm/issues/4079)

Diff for: changelogs/drizzle-typebox/0.3.2.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Functions `getColumns`, `handleColumns` and `handleEnum` were exported from `drizzle-typebox`

Diff for: drizzle-kit/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "drizzle-kit",
3-
"version": "0.30.6",
3+
"version": "0.31.0",
44
"homepage": "https://orm.drizzle.team",
55
"keywords": [
66
"drizzle",

Diff for: drizzle-orm/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "drizzle-orm",
3-
"version": "0.41.0",
3+
"version": "0.42.0",
44
"description": "Drizzle ORM package for SQL databases",
55
"type": "module",
66
"scripts": {

Diff for: drizzle-typebox/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "drizzle-typebox",
3-
"version": "0.3.1",
3+
"version": "0.3.2",
44
"description": "Generate Typebox schemas from Drizzle ORM schemas",
55
"type": "module",
66
"scripts": {

0 commit comments

Comments
 (0)