Skip to content

Commit

Permalink
Add changelog for 0.28.6
Browse files Browse the repository at this point in the history
  • Loading branch information
AndriiSherman committed Sep 5, 2023
1 parent a613c36 commit efba903
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 1 deletion.
66 changes: 66 additions & 0 deletions changelogs/drizzle-orm/0.28.6.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
## New Features

### Add json mode for text in SQLite

Example

```ts
const test = sqliteTable('test', {
dataTyped: text('data_typed', { mode: 'json' }).$type<{ a: 1 }>().notNull(),
});
```

### Add `.toSQL()` to Relational Query API calls

Example

```ts
const query = db.query.usersTable.findFirst().toSQL();
```

### Added new PostgreSQL operators for Arrays - thanks @L-Mario564

List of operators and usage examples
`arrayContains`, `arrayContained`, `arrayOverlaps`

```ts
const contains = await db.select({ id: posts.id }).from(posts)
.where(arrayContains(posts.tags, ['Typescript', 'ORM']));

const contained = await db.select({ id: posts.id }).from(posts)
.where(arrayContained(posts.tags, ['Typescript', 'ORM']));

const overlaps = await db.select({ id: posts.id }).from(posts)
.where(arrayOverlaps(posts.tags, ['Typescript', 'ORM']));

const withSubQuery = await db.select({ id: posts.id }).from(posts)
.where(arrayContains(
posts.tags,
db.select({ tags: posts.tags }).from(posts).where(eq(posts.id, 1)),
));
```

### Add more SQL operators for where filter function in Relational Queries - thanks @cayter!
**Before**
```ts
import { inArray } from "drizzle-orm/pg-core";

await db.users.findFirst({
where: (table, _) => inArray(table.id, [ ... ])
})
```

**After**
```ts
await db.users.findFirst({
where: (table, { inArray }) => inArray(table.id, [ ... ])
})
```

## Bug Fixes

- πŸ› [Correct where in on conflict in sqlite](https://github.com/drizzle-team/drizzle-orm/pull/1076) - Thanks @hanssonduck!
- πŸ› [Fix libsql/client type import](https://github.com/drizzle-team/drizzle-orm/pull/1122) - Thanks @luisfvieirasilva!
- πŸ› [Fix: raw sql query not being mapped properly on RDS](https://github.com/drizzle-team/drizzle-orm/pull/1071) - Thanks @boian-ivanov
- πŸ› [Fix Datetime mapping for MySQL](https://github.com/drizzle-team/drizzle-orm/pull/1082) - thanks @Angelelz
- πŸ› [Fix smallserial generating as serial](https://github.com/drizzle-team/drizzle-orm/pull/1127) - thanks @L-Mario564
2 changes: 1 addition & 1 deletion drizzle-orm/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "drizzle-orm",
"version": "0.28.5",
"version": "0.28.6",
"description": "Drizzle ORM package for SQL databases",
"type": "module",
"scripts": {
Expand Down

0 comments on commit efba903

Please sign in to comment.