Skip to content

Commit 3572f21

Browse files
committed
Add release notes
1 parent 7cd9d79 commit 3572f21

File tree

4 files changed

+95
-2
lines changed

4 files changed

+95
-2
lines changed

changelogs/drizzle-kit/0.30.1.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# New Features
2+
3+
### `drizzle-kit export`
4+
5+
To make drizzle-kit integration with other migration tools, like Atlas much easier, we've prepared a new command called `export`. It will translate your drizzle schema in SQL representation(DDL) statements and outputs to the console
6+
7+
```ts
8+
// schema.ts
9+
import { pgTable, serial, text } from 'drizzle-orm/pg-core'
10+
11+
export const users = pgTable('users', {
12+
id: serial('id').primaryKey(),
13+
email: text('email').notNull(),
14+
name: text('name')
15+
});
16+
```
17+
Running
18+
```bash
19+
npx drizzle-kit export
20+
```
21+
22+
will output this string to console
23+
```bash
24+
CREATE TABLE "users" (
25+
"id" serial PRIMARY KEY NOT NULL,
26+
"email" text NOT NULL,
27+
"name" text
28+
);
29+
```
30+
31+
By default, the only option for now is `--sql`, so the output format will be SQL DDL statements. In the future, we will support additional output formats to accommodate more migration tools
32+
33+
```bash
34+
npx drizzle-kit export --sql
35+
```

changelogs/drizzle-orm/0.38.2.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# New features
2+
3+
## `USE INDEX`, `FORCE INDEX` and `IGNORE INDEX` for MySQL
4+
5+
In MySQL, the statements USE INDEX, FORCE INDEX, and IGNORE INDEX are hints used in SQL queries to influence how the query optimizer selects indexes. These hints provide fine-grained control over index usage, helping optimize performance when the default behavior of the optimizer is not ideal.
6+
7+
### Use Index
8+
9+
The `USE INDEX` hint suggests to the optimizer which indexes to consider when processing the query. The optimizer is not forced to use these indexes but will prioritize them if they are suitable.
10+
11+
```ts
12+
export const users = mysqlTable('users', {
13+
id: int('id').primaryKey(),
14+
name: varchar('name', { length: 100 }).notNull(),
15+
}, () => [usersTableNameIndex]);
16+
17+
const usersTableNameIndex = index('users_name_index').on(users.name);
18+
19+
await db.select()
20+
.from(users, { useIndex: usersTableNameIndex })
21+
.where(eq(users.name, 'David'));
22+
```
23+
24+
### Ignore Index
25+
26+
The `IGNORE INDEX` hint tells the optimizer to avoid using specific indexes for the query. MySQL will consider all other indexes (if any) or perform a full table scan if necessary.
27+
28+
```ts
29+
export const users = mysqlTable('users', {
30+
id: int('id').primaryKey(),
31+
name: varchar('name', { length: 100 }).notNull(),
32+
}, () => [usersTableNameIndex]);
33+
34+
const usersTableNameIndex = index('users_name_index').on(users.name);
35+
36+
await db.select()
37+
.from(users, { ignoreIndex: usersTableNameIndex })
38+
.where(eq(users.name, 'David'));
39+
```
40+
41+
### Force Index
42+
43+
The `FORCE INDEX` hint forces the optimizer to use the specified index(es) for the query. If the specified index cannot be used, MySQL will not fall back to other indexes; it might resort to a full table scan instead.
44+
45+
```ts copy
46+
export const users = mysqlTable('users', {
47+
id: int('id').primaryKey(),
48+
name: varchar('name', { length: 100 }).notNull(),
49+
}, () => [usersTableNameIndex]);
50+
51+
const usersTableNameIndex = index('users_name_index').on(users.name);
52+
53+
await db.select()
54+
.from(users, { forceIndex: usersTableNameIndex })
55+
.where(eq(users.name, 'David'));
56+
```
57+
58+
You can also combine those hints and use multiple indexes in a query if you need

drizzle-kit/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "drizzle-kit",
3-
"version": "0.30.0",
3+
"version": "0.30.1",
44
"homepage": "https://orm.drizzle.team",
55
"keywords": [
66
"drizzle",

drizzle-orm/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "drizzle-orm",
3-
"version": "0.38.1",
3+
"version": "0.38.2",
44
"description": "Drizzle ORM package for SQL databases",
55
"type": "module",
66
"scripts": {

0 commit comments

Comments
 (0)