You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* fix: incorrect types for inArray (#1774)
Co-authored-by: Andrii Sherman <andreysherman11@gmail.com>
* Pass row type parameter to @planetscale/database's execute (#1852)
* Update session.ts
No need to cast, you can just pass a type parameter
* Update package.json
---------
Co-authored-by: AndriiSherman <andreysherman11@gmail.com>
* Don't enforce type restrictions on mysqlEnum and pgEnum to be non-empty arrays (#2429)
* Removed type restriction on non-empty arrays for mysqEnum
* Removed type restriction on non-empty arrays for pgEnum
* check values argument is not an empty array for pgEnum
* fix: typings
* Add type tests
---------
Co-authored-by: AndriiSherman <andreysherman11@gmail.com>
* Export mapColumnToSchema function (#2495)
Co-authored-by: Andrii Sherman <andreysherman11@gmail.com>
* [Pg-kit] Fix malformed array literal error on indexes (#2884)
* Fix malformed array literal error on indexes
The main issue is the expression text to array conversion happening in the edited line.
Commas in an expression become delimiters and split the expression up prematurely.
Some special characters like double quotes can cause the malformed array literal errors.
The postgres function pg_get_indexdef does what the snippet above is trying to do, but safely.
* Add index introspect test
* Update pg.test.ts
Remove .only in basic index test
---------
Co-authored-by: Andrii Sherman <andreysherman11@gmail.com>
* add infer enum type (#2552)
* Update how enums work in pg and mysql
* Remove duplicated exports, add related test (#4413)
* Remove duplicated exports, add related test
Fixes#4079
* Fix test
* chore: updating esbuild version in drizzle-kit (#4046)
* chore: updating esbuild version in drizzle-kit
* Fix build errors
---------
Co-authored-by: AndriiSherman <andreysherman11@gmail.com>
* Drizzle-kit: fix recreate enums + altering data type to enums, from enums in pg (#4330)
Co-authored-by: AndriiSherman <andreysherman11@gmail.com>
* Skip test and try latest gel
* Add release notes
---------
Co-authored-by: James <5511220+Zamiell@users.noreply.github.com>
Co-authored-by: Ayrton <git@ayrton.be>
Co-authored-by: April Mintac Pineda <21032419+aprilmintacpineda@users.noreply.github.com>
Co-authored-by: Matthew Ary <157217+MatthewAry@users.noreply.github.com>
Co-authored-by: Kratious <Kratious@users.noreply.github.com>
Co-authored-by: Toti Muñoz <64804554+totigm@users.noreply.github.com>
Co-authored-by: Dan Kochetov <danil.kochetov@gmail.com>
Co-authored-by: Paul Marsicovetere <71470776+paulmarsicloud@users.noreply.github.com>
Co-authored-by: Aleksandr Sherman <102579553+AleksandrSherman@users.noreply.github.com>
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)
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.
const res =awaitdb.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)
0 commit comments