@xata.io/client 0.0.0-alpha.vf73045e → 0.0.0-alpha.vf79e7d8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/Usage.md +8 -6
- package/dist/index.cjs +334 -201
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +172 -97
- package/dist/index.mjs +328 -202
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,27 @@
|
|
1
1
|
# @xata.io/client
|
2
2
|
|
3
|
+
## 0.17.0
|
4
|
+
|
5
|
+
### Minor Changes
|
6
|
+
|
7
|
+
- [#563](https://github.com/xataio/client-ts/pull/563) [`26e91d1`](https://github.com/xataio/client-ts/commit/26e91d1d84df082dedd7159271fc7c27ec87fefe) Thanks [@SferaDev](https://github.com/SferaDev)! - Return nulls on operations that can fail
|
8
|
+
|
9
|
+
* [#563](https://github.com/xataio/client-ts/pull/563) [`3332d43`](https://github.com/xataio/client-ts/commit/3332d43121367f61c8d87dfb7da2af65bd1c278f) Thanks [@SferaDev](https://github.com/SferaDev)! - Return object on delete operation
|
10
|
+
|
11
|
+
## 0.16.2
|
12
|
+
|
13
|
+
### Patch Changes
|
14
|
+
|
15
|
+
- [#541](https://github.com/xataio/client-ts/pull/541) [`c74467c`](https://github.com/xataio/client-ts/commit/c74467caeff4e3d60d0981a173b462e970c6c1fc) Thanks [@SferaDev](https://github.com/SferaDev)! - Add tracing with open telemetry
|
16
|
+
|
17
|
+
* [#551](https://github.com/xataio/client-ts/pull/551) [`ee72bfe`](https://github.com/xataio/client-ts/commit/ee72bfef34765374ec66c7edaa6b5508c3f8e8dc) Thanks [@SferaDev](https://github.com/SferaDev)! - Fix filter operators and dates
|
18
|
+
|
19
|
+
- [#552](https://github.com/xataio/client-ts/pull/552) [`e88effa`](https://github.com/xataio/client-ts/commit/e88effa00f8c2c0e24ec8cd60fb21859ac236191) Thanks [@SferaDev](https://github.com/SferaDev)! - Update error message for required settings
|
20
|
+
|
21
|
+
* [#551](https://github.com/xataio/client-ts/pull/551) [`33293b3`](https://github.com/xataio/client-ts/commit/33293b3509d984bb9b1af457c96260d43f398efe) Thanks [@SferaDev](https://github.com/SferaDev)! - Add aliases for some operators
|
22
|
+
|
23
|
+
- [#534](https://github.com/xataio/client-ts/pull/534) [`efc09b4`](https://github.com/xataio/client-ts/commit/efc09b420a25253b428662c2eec40ff3bc36ce79) Thanks [@SferaDev](https://github.com/SferaDev)! - Make sort direction optional
|
24
|
+
|
3
25
|
## 0.16.1
|
4
26
|
|
5
27
|
### Patch Changes
|
package/Usage.md
CHANGED
@@ -45,21 +45,23 @@ All these methods allow customising its filters, column selection, column orderi
|
|
45
45
|
|
46
46
|
```ts
|
47
47
|
// First item sorting by name
|
48
|
-
const user = await xata.db.users.getFirst({ sort:
|
48
|
+
const user = await xata.db.users.getFirst({ sort: 'name' });
|
49
49
|
|
50
50
|
// Get first 50 items but ignore the first one
|
51
|
-
const users = await xata.db.users.getMany({ pagination: {
|
51
|
+
const users = await xata.db.users.getMany({ pagination: { size: 50, offset: 1 } });
|
52
52
|
|
53
53
|
// Get page of 100 items where name contains "foo"
|
54
|
-
const page = await xata.db.users.getPaginated({ filter: { name: { $contains:
|
54
|
+
const page = await xata.db.users.getPaginated({ filter: { name: { $contains: 'foo' } }, pagination: { size: 100 } });
|
55
55
|
|
56
56
|
// Get all admin users and cache the result for 5 minutes
|
57
|
-
const user = await xata.db.users.filter(
|
57
|
+
const user = await xata.db.users.filter('role', 'admin').getAll({ cache: 5 * 60 * 1000 });
|
58
58
|
|
59
59
|
// Overwrite values set in a query
|
60
|
-
const query = xata.db.users.filter(
|
60
|
+
const query = xata.db.users.filter('role', 'admin').select(['name']);
|
61
61
|
const adminUsers = await query.getAll();
|
62
|
-
const firstAdminUserWithEmail = await query.getFirst({ columns: [
|
62
|
+
const firstAdminUserWithEmail = await query.getFirst({ columns: ['name', 'email'] });
|
63
|
+
```
|
64
|
+
|
63
65
|
Since the [`Repository`](#repository) class implements the `Query` interface, you can use it to query and paginate the records in the table too.
|
64
66
|
|
65
67
|
```ts
|