Skip to content

Commit

Permalink
Fix changelogs for 0.29.0
Browse files Browse the repository at this point in the history
  • Loading branch information
AndriiSherman committed Nov 9, 2023
1 parent d3b1c58 commit 4227a46
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions changelogs/drizzle-orm/0.29.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ const table = mysqlTable('table', {
});
```

Read more in [docs](https://orm.drizzle.team/docs/column-types/mysql#bigint)

### 🎉 Improved query builder types

Starting from `0.29.0` by default, as all the query builders in Drizzle try to conform to SQL as much as possible, you can only invoke most of the methods once. For example, in a SELECT statement there might only be one WHERE clause, so you can only invoke .where() once:
Expand Down Expand Up @@ -55,6 +57,8 @@ let query = db.select().from(users).where(eq(users.id, 1)).$dynamic();
query = withFriends(query);
```

Read more in [docs](https://orm.drizzle.team/docs/dynamic-query-building)

### 🎉 Possibility to specify name for primary keys and foreign keys

There is an issue when constraint names exceed the 64-character limit of the database. This causes the database engine to truncate the name, potentially leading to issues. Starting from `0.29.0`, you have the option to specify custom names for both `primaryKey()` and `foreignKey()`. We have also deprecated the old `primaryKey()` syntax, which can still be used but will be removed in future releases
Expand All @@ -73,6 +77,8 @@ const table = pgTable('table', {
}));
```

Read more in [docs](https://orm.drizzle.team/docs/indexes-constraints#composite-primary-key)

### 🎉 Read Replicas Support

You can now use the Drizzle `withReplica` function to specify different database connections for read replicas and the main instance for write operations. By default, `withReplicas` will use a random read replica for read operations and the main instance for all other data modification operations. You can also specify custom logic for choosing which read replica connection to use. You have the freedom to make any weighted, custom decision for that. Here are some usage examples:
Expand Down Expand Up @@ -112,6 +118,8 @@ const db = withReplicas(primaryDb, [read1, read2], (replicas) => {

`withReplicas` function is available for all dialects in Drizzle ORM

Read more in [docs](https://orm.drizzle.team/docs/read-replicas)

### 🎉 Set operators support (UNION, UNION ALL, INTERSECT, INTERSECT ALL, EXCEPT, EXCEPT ALL)

Huge thanks to @Angelelz for the significant contribution he made, from API discussions to proper type checks and runtime logic, along with an extensive set of tests. This greatly assisted us in delivering this feature in this release
Expand All @@ -134,7 +142,7 @@ const result = await union(allUsersQuery, allCustomersQuery)
const result = await db.select().from(users).union(db.select().from(customers));
```

For more examples for all set operators, please check new section in Drizzle Docs: `Set Operators`
Read more in [docs](https://orm.drizzle.team/docs/set-operations)

### 🎉 New MySQL Proxy Driver

Expand Down Expand Up @@ -235,7 +243,7 @@ async function main() {
}
```

### 🎉 `D1` batch api support
### 🎉 `D1` Batch API support

Reference: https://developers.cloudflare.com/d1/platform/client-api/#dbbatch

Expand Down Expand Up @@ -310,4 +318,4 @@ More usage examples here: [integration-tests/tests/d1-batch.test.ts](https://git
6. Environment variables are now automatically fetched
7. Some bug fixes and improvements

You can read more about drizzle-kit updates here:
You can read more about drizzle-kit updates [here](https://github.com/drizzle-team/drizzle-kit-mirror/releases/tag/v0.20.0)

0 comments on commit 4227a46

Please sign in to comment.