Skip to content

Commit

Permalink
Release tracking (#1497)
Browse files Browse the repository at this point in the history
Signed-off-by: Alexis Rico <[email protected]>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Alexis Rico <[email protected]>
  • Loading branch information
3 people authored Jun 6, 2024
1 parent efaa4ce commit 419b2f8
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
5 changes: 0 additions & 5 deletions .changeset/metal-parents-serve.md

This file was deleted.

6 changes: 6 additions & 0 deletions packages/plugin-client-kysely/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @xata.io/kysely

## 0.1.22

### Patch Changes

- [#1491](https://github.com/xataio/client-ts/pull/1491) [`f4a5ee7`](https://github.com/xataio/client-ts/commit/f4a5ee707dd04280f59919c97ff9cc0b1e9b01e6) Thanks [@SferaDev](https://github.com/SferaDev)! - [Kysely] Add consistency to client initialization

## 0.1.21

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-client-kysely/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@xata.io/kysely",
"version": "0.1.21",
"version": "0.1.22",
"description": "",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
Expand Down
12 changes: 10 additions & 2 deletions packages/plugin-client-kysely/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { EditableData, SQLPlugin, XataPlugin, XataPluginOptions, XataRecord } from '@xata.io/client';
import { EditableData, Identifiable, SQLPlugin, XataPlugin, XataPluginOptions, XataRecord } from '@xata.io/client';
import { Kysely } from 'kysely';
import { XataDialect } from './driver';

Expand All @@ -14,8 +14,16 @@ export class KyselyPlugin<Schemas extends Record<string, XataRecord>> extends Xa
}
}

type ExcludeFromUnionIfNotOnlyType<Union, Type> = Exclude<Union, Type> extends never ? Union : Exclude<Union, Type>;

type RemoveIdentifiable<T extends Record<string, any>> = {
[K in keyof T]: T[K] extends any[] // if it's an array
? ExcludeFromUnionIfNotOnlyType<T[K][number], Identifiable>[]
: ExcludeFromUnionIfNotOnlyType<T[K], Identifiable>;
};

export type Model<Schemas extends Record<string, XataRecord>> = {
[Model in keyof Schemas]: EditableData<Schemas[Model]>;
[Model in keyof Schemas]: RemoveIdentifiable<EditableData<Schemas[Model]>>;
};

export * from './driver';

0 comments on commit 419b2f8

Please sign in to comment.