@xata.io/client 0.0.0-alpha.vf3111df → 0.0.0-alpha.vf331c3f
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/.eslintrc.cjs +3 -2
- package/.turbo/turbo-add-version.log +4 -0
- package/.turbo/turbo-build.log +13 -0
- package/CHANGELOG.md +223 -1
- package/README.md +30 -30
- package/Usage.md +13 -11
- package/dist/index.cjs +1910 -643
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +5055 -1602
- package/dist/index.mjs +1878 -624
- package/dist/index.mjs.map +1 -1
- package/package.json +8 -9
- package/rollup.config.mjs +44 -0
- package/rollup.config.js +0 -29
package/.eslintrc.cjs
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
module.exports = {
|
2
|
-
ignorePatterns: [
|
2
|
+
ignorePatterns: ['dist'],
|
3
3
|
parserOptions: {
|
4
4
|
ecmaVersion: 2020,
|
5
5
|
sourceType: 'module',
|
@@ -7,6 +7,7 @@ module.exports = {
|
|
7
7
|
},
|
8
8
|
rules: {
|
9
9
|
'@typescript-eslint/no-floating-promises': 'error',
|
10
|
-
|
10
|
+
'@typescript-eslint/strict-boolean-expressions': ['error', { allowNullableString: true, allowNullableObject: true }],
|
11
|
+
"@typescript-eslint/ban-types": "off",
|
11
12
|
}
|
12
13
|
};
|
@@ -0,0 +1,13 @@
|
|
1
|
+
|
2
|
+
> @xata.io/client@0.21.6 build /home/runner/work/client-ts/client-ts/packages/client
|
3
|
+
> rimraf dist && rollup -c
|
4
|
+
|
5
|
+
[36m
|
6
|
+
[1msrc/index.ts[22m → [1mdist/index.cjs[22m...[39m
|
7
|
+
[32mcreated [1mdist/index.cjs[22m in [1m1.2s[22m[39m
|
8
|
+
[36m
|
9
|
+
[1msrc/index.ts[22m → [1mdist/index.mjs[22m...[39m
|
10
|
+
[32mcreated [1mdist/index.mjs[22m in [1m1s[22m[39m
|
11
|
+
[36m
|
12
|
+
[1msrc/index.ts[22m → [1mdist/index.d.ts[22m...[39m
|
13
|
+
[32mcreated [1mdist/index.d.ts[22m in [1m7.5s[22m[39m
|
package/CHANGELOG.md
CHANGED
@@ -1,12 +1,234 @@
|
|
1
1
|
# @xata.io/client
|
2
2
|
|
3
|
+
## 0.0.0-alpha.vf331c3f
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- Force canary build
|
8
|
+
|
9
|
+
## 0.21.6
|
10
|
+
|
11
|
+
### Patch Changes
|
12
|
+
|
13
|
+
- [#828](https://github.com/xataio/client-ts/pull/828) [`039e35bf`](https://github.com/xataio/client-ts/commit/039e35bf9f01149f39bca39e1867908ca3468bb5) Thanks [@SferaDev](https://github.com/SferaDev)! - Fix enableBrowser with Deno
|
14
|
+
|
15
|
+
- [#828](https://github.com/xataio/client-ts/pull/828) [`039e35bf`](https://github.com/xataio/client-ts/commit/039e35bf9f01149f39bca39e1867908ca3468bb5) Thanks [@SferaDev](https://github.com/SferaDev)! - Add branded types to serializer
|
16
|
+
|
17
|
+
## 0.21.5
|
18
|
+
|
19
|
+
### Patch Changes
|
20
|
+
|
21
|
+
- [#825](https://github.com/xataio/client-ts/pull/825) [`41c4d29f`](https://github.com/xataio/client-ts/commit/41c4d29f9f9fc7ce87b755e447a2030fe8c10d70) Thanks [@SferaDev](https://github.com/SferaDev)! - Export fetcher error
|
22
|
+
|
23
|
+
## 0.21.4
|
24
|
+
|
25
|
+
### Patch Changes
|
26
|
+
|
27
|
+
- [#816](https://github.com/xataio/client-ts/pull/816) [`a0149435`](https://github.com/xataio/client-ts/commit/a01494358ae3a8dd9d7eba3a276fe6f8b7827a33) Thanks [@SferaDev](https://github.com/SferaDev)! - Improve types for datetime fields accepting strings
|
28
|
+
|
29
|
+
## 0.21.3
|
30
|
+
|
31
|
+
### Patch Changes
|
32
|
+
|
33
|
+
- [#792](https://github.com/xataio/client-ts/pull/792) [`6c96da45`](https://github.com/xataio/client-ts/commit/6c96da4533500ec236547f47310e99461d5457e8) Thanks [@SferaDev](https://github.com/SferaDev)! - Update workers return type helper
|
34
|
+
|
35
|
+
## 0.21.2
|
36
|
+
|
37
|
+
### Patch Changes
|
38
|
+
|
39
|
+
- [#787](https://github.com/xataio/client-ts/pull/787) [`93f5beed`](https://github.com/xataio/client-ts/commit/93f5beed77785b03409c614f5e2c3eca4c69c574) Thanks [@SferaDev](https://github.com/SferaDev)! - Expose consistency options
|
40
|
+
|
41
|
+
- [#784](https://github.com/xataio/client-ts/pull/784) [`cbe0609e`](https://github.com/xataio/client-ts/commit/cbe0609ec9d6650030efbda712a1eb243287525d) Thanks [@SferaDev](https://github.com/SferaDev)! - Update resolveBranch behaviour
|
42
|
+
|
43
|
+
## 0.21.1
|
44
|
+
|
45
|
+
### Patch Changes
|
46
|
+
|
47
|
+
- [#781](https://github.com/xataio/client-ts/pull/781) [`fdfa47de`](https://github.com/xataio/client-ts/commit/fdfa47de93ec772170ff00a4341fc14434347df5) Thanks [@SferaDev](https://github.com/SferaDev)! - Send header to disable encoding
|
48
|
+
|
49
|
+
## 0.21.0
|
50
|
+
|
51
|
+
### Minor Changes
|
52
|
+
|
53
|
+
- [#757](https://github.com/xataio/client-ts/pull/757) [`7da604d2`](https://github.com/xataio/client-ts/commit/7da604d27990e20ecadba6122434fca563e6a8c9) Thanks [@SferaDev](https://github.com/SferaDev)! - Add promise pool for retries
|
54
|
+
|
55
|
+
### Patch Changes
|
56
|
+
|
57
|
+
- [#764](https://github.com/xataio/client-ts/pull/764) [`b131040a`](https://github.com/xataio/client-ts/commit/b131040a2d142c4e71a2e586fbf05cd9295af9a1) Thanks [@SferaDev](https://github.com/SferaDev)! - Fix bun
|
58
|
+
|
59
|
+
- [#759](https://github.com/xataio/client-ts/pull/759) [`7ea810dc`](https://github.com/xataio/client-ts/commit/7ea810dc083ec284447e3bd27bd0465f887481e6) Thanks [@SferaDev](https://github.com/SferaDev)! - Expose new transaction API
|
60
|
+
|
61
|
+
- [#767](https://github.com/xataio/client-ts/pull/767) [`d124cbfb`](https://github.com/xataio/client-ts/commit/d124cbfb93d3d591e79bbe9e94c4b6304d825e71) Thanks [@SferaDev](https://github.com/SferaDev)! - Remove formatVersion from schema
|
62
|
+
|
63
|
+
- [#767](https://github.com/xataio/client-ts/pull/767) [`d124cbfb`](https://github.com/xataio/client-ts/commit/d124cbfb93d3d591e79bbe9e94c4b6304d825e71) Thanks [@SferaDev](https://github.com/SferaDev)! - Fix null value returning on date columns
|
64
|
+
|
65
|
+
- [#775](https://github.com/xataio/client-ts/pull/775) [`fb5ccdf9`](https://github.com/xataio/client-ts/commit/fb5ccdf9fa95c37d54fbc5d9c0bb45872c831609) Thanks [@SferaDev](https://github.com/SferaDev)! - Add missing target field to search
|
66
|
+
|
67
|
+
- [#760](https://github.com/xataio/client-ts/pull/760) [`4ae00036`](https://github.com/xataio/client-ts/commit/4ae00036b53c6c89e02a1fcfdd992f1a3c22892c) Thanks [@SferaDev](https://github.com/SferaDev)! - Add support for filters in boosters
|
68
|
+
|
69
|
+
- [#766](https://github.com/xataio/client-ts/pull/766) [`bdae6668`](https://github.com/xataio/client-ts/commit/bdae6668fb571d29f1b1068a54f6866a80d9b174) Thanks [@SferaDev](https://github.com/SferaDev)! - Remove beta for Workers
|
70
|
+
|
71
|
+
- [#771](https://github.com/xataio/client-ts/pull/771) [`9486bdcc`](https://github.com/xataio/client-ts/commit/9486bdccc0af567bc5f2e8f91592b0143c539c45) Thanks [@SferaDev](https://github.com/SferaDev)! - Add modifier for numeric booster
|
72
|
+
|
73
|
+
- [#771](https://github.com/xataio/client-ts/pull/771) [`9486bdcc`](https://github.com/xataio/client-ts/commit/9486bdccc0af567bc5f2e8f91592b0143c539c45) Thanks [@SferaDev](https://github.com/SferaDev)! - Add pagination to search
|
74
|
+
|
75
|
+
## 0.20.2
|
76
|
+
|
77
|
+
### Patch Changes
|
78
|
+
|
79
|
+
- [#756](https://github.com/xataio/client-ts/pull/756) [`27b73745`](https://github.com/xataio/client-ts/commit/27b737451227cf12774115ccb70649f6bbf76180) Thanks [@SferaDev](https://github.com/SferaDev)! - Fix update method with id in payload
|
80
|
+
|
81
|
+
- [#726](https://github.com/xataio/client-ts/pull/726) [`47a1f878`](https://github.com/xataio/client-ts/commit/47a1f87850a7178dad656a16d2584eee6ce68f29) Thanks [@SferaDev](https://github.com/SferaDev)! - Use transactions API internally for bulk operations
|
82
|
+
|
83
|
+
- [#726](https://github.com/xataio/client-ts/pull/726) [`adde9b10`](https://github.com/xataio/client-ts/commit/adde9b10708182295dee07c203c7bf737806e49e) Thanks [@SferaDev](https://github.com/SferaDev)! - Allow sending bulk operations of more than the limit
|
84
|
+
|
85
|
+
## 0.20.1
|
86
|
+
|
87
|
+
### Patch Changes
|
88
|
+
|
89
|
+
- [#744](https://github.com/xataio/client-ts/pull/744) [`98298ca`](https://github.com/xataio/client-ts/commit/98298ca1312a2256ee3e9d2700a9f3d3e316abe5) Thanks [@xata-bot](https://github.com/xata-bot)! - Add deno entry point
|
90
|
+
|
91
|
+
## 0.20.0
|
92
|
+
|
93
|
+
### Minor Changes
|
94
|
+
|
95
|
+
- [#737](https://github.com/xataio/client-ts/pull/737) [`6cbeaa0`](https://github.com/xataio/client-ts/commit/6cbeaa00050b5aa99ab7c98052a906487263e026) Thanks [@SferaDev](https://github.com/SferaDev)! - Rename first to start and last to end in pagination
|
96
|
+
|
97
|
+
### Patch Changes
|
98
|
+
|
99
|
+
- [#732](https://github.com/xataio/client-ts/pull/732) [`a5a9aa5`](https://github.com/xataio/client-ts/commit/a5a9aa59987faa1d3d701d7431b8a96031e01ac7) Thanks [@SferaDev](https://github.com/SferaDev)! - [Experimental] Allow passing fetch options in some queries
|
100
|
+
|
101
|
+
- [#735](https://github.com/xataio/client-ts/pull/735) [`c64b2eb`](https://github.com/xataio/client-ts/commit/c64b2eb9add70e75d419d418ab9608caac0dbfa1) Thanks [@SferaDev](https://github.com/SferaDev)! - Add support for default values
|
102
|
+
|
103
|
+
- [#730](https://github.com/xataio/client-ts/pull/730) [`485b217`](https://github.com/xataio/client-ts/commit/485b217079c4b2091d697e68622c48eddd130ceb) Thanks [@SferaDev](https://github.com/SferaDev)! - Add more summarize functions
|
104
|
+
|
105
|
+
- [#730](https://github.com/xataio/client-ts/pull/730) [`4d7499c`](https://github.com/xataio/client-ts/commit/4d7499ccbb135691350334fd8022f7a5da41c5f2) Thanks [@SferaDev](https://github.com/SferaDev)! - Add a check for browser execution
|
106
|
+
|
107
|
+
## 0.19.1
|
108
|
+
|
109
|
+
### Patch Changes
|
110
|
+
|
111
|
+
- [#723](https://github.com/xataio/client-ts/pull/723) [`ad5feeb`](https://github.com/xataio/client-ts/commit/ad5feebad5983f724ea4067b884bfae428447470) Thanks [@SferaDev](https://github.com/SferaDev)! - Fix replace operation not hidden
|
112
|
+
|
113
|
+
## 0.19.0
|
114
|
+
|
115
|
+
### Minor Changes
|
116
|
+
|
117
|
+
- [#692](https://github.com/xataio/client-ts/pull/692) [`c14f431`](https://github.com/xataio/client-ts/commit/c14f431db020036ab2b059bcc52a5d56b321c8e7) Thanks [@SferaDev](https://github.com/SferaDev)! - Add multi region endpoint support
|
118
|
+
|
119
|
+
- [#692](https://github.com/xataio/client-ts/pull/692) [`c8def01`](https://github.com/xataio/client-ts/commit/c8def013e9e2d5b634cdb2850f757a0b3e9e0a6d) Thanks [@SferaDev](https://github.com/SferaDev)! - Update OpenAPI spec methods
|
120
|
+
|
121
|
+
### Patch Changes
|
122
|
+
|
123
|
+
- [#667](https://github.com/xataio/client-ts/pull/667) [`f80f051`](https://github.com/xataio/client-ts/commit/f80f05118dd0588861b8229114a469f016ef77ac) Thanks [@SferaDev](https://github.com/SferaDev)! - Allow sending page size to summarize endpoint
|
124
|
+
|
125
|
+
- [#676](https://github.com/xataio/client-ts/pull/676) [`2e341e5`](https://github.com/xataio/client-ts/commit/2e341e5c6140f9c4ddd74e479049992c26c43ea2) Thanks [@SferaDev](https://github.com/SferaDev)! - Support TS 4.7+
|
126
|
+
|
127
|
+
- [#709](https://github.com/xataio/client-ts/pull/709) [`f2f749f`](https://github.com/xataio/client-ts/commit/f2f749f4c64246a303da8d4a617773fc55c1d021) Thanks [@SferaDev](https://github.com/SferaDev)! - Add ifVersion flag to insert/update/upsert operations
|
128
|
+
|
129
|
+
- [#709](https://github.com/xataio/client-ts/pull/709) [`f2f749f`](https://github.com/xataio/client-ts/commit/f2f749f4c64246a303da8d4a617773fc55c1d021) Thanks [@SferaDev](https://github.com/SferaDev)! - Add createOrReplace operation to repository
|
130
|
+
|
131
|
+
## 0.18.6
|
132
|
+
|
133
|
+
### Patch Changes
|
134
|
+
|
135
|
+
- [#662](https://github.com/xataio/client-ts/pull/662) [`4a41680`](https://github.com/xataio/client-ts/commit/4a416803761a1c944ef9a76b794020ead6c8f477) Thanks [@SferaDev](https://github.com/SferaDev)! - Remove wildcard columns from sorting and filtering
|
136
|
+
|
137
|
+
- [#303](https://github.com/xataio/client-ts/pull/303) [`ad0cccb`](https://github.com/xataio/client-ts/commit/ad0cccb11cd4f9bb4bd7e44672d3375821e700fe) Thanks [@gimenete](https://github.com/gimenete)! - Add profiles for host parsing
|
138
|
+
|
139
|
+
- [#662](https://github.com/xataio/client-ts/pull/662) [`e1d6add`](https://github.com/xataio/client-ts/commit/e1d6addf84c55648bc0d908887b6bd020b429801) Thanks [@SferaDev](https://github.com/SferaDev)! - Add aggregations support to the SDK
|
140
|
+
|
141
|
+
- [#662](https://github.com/xataio/client-ts/pull/662) [`4a41680`](https://github.com/xataio/client-ts/commit/4a416803761a1c944ef9a76b794020ead6c8f477) Thanks [@SferaDev](https://github.com/SferaDev)! - Add summarize endpoints to SDK
|
142
|
+
|
143
|
+
## 0.18.5
|
144
|
+
|
145
|
+
### Patch Changes
|
146
|
+
|
147
|
+
- [#656](https://github.com/xataio/client-ts/pull/656) [`2dc2f5a`](https://github.com/xataio/client-ts/commit/2dc2f5a45529b2ace9127d963fb30214298da2e0) Thanks [@SferaDev](https://github.com/SferaDev)! - Broaden type for AbortSignal
|
148
|
+
|
149
|
+
## 0.18.4
|
150
|
+
|
151
|
+
### Patch Changes
|
152
|
+
|
153
|
+
- [#650](https://github.com/xataio/client-ts/pull/650) [`b8d441f`](https://github.com/xataio/client-ts/commit/b8d441f80867322f41989d52c94bba230632782b) Thanks [@xata-bot](https://github.com/xata-bot)! - API: Rename listMigrationRequests to queryMigrationRequests
|
154
|
+
|
155
|
+
## 0.18.3
|
156
|
+
|
157
|
+
### Patch Changes
|
158
|
+
|
159
|
+
- [#639](https://github.com/xataio/client-ts/pull/639) [`50fb3c0`](https://github.com/xataio/client-ts/commit/50fb3c0a1cffd03a16cc8b1b21454ea816f2edbb) Thanks [@SferaDev](https://github.com/SferaDev)! - Do not return null for columns not selected
|
160
|
+
|
161
|
+
## 0.18.2
|
162
|
+
|
163
|
+
### Patch Changes
|
164
|
+
|
165
|
+
- [#635](https://github.com/xataio/client-ts/pull/635) [`713f9b2`](https://github.com/xataio/client-ts/commit/713f9b2773be99c17d3fcb663e24fe096fa3da48) Thanks [@SferaDev](https://github.com/SferaDev)! - [Search] Add target columns
|
166
|
+
|
167
|
+
## 0.18.1
|
168
|
+
|
169
|
+
### Patch Changes
|
170
|
+
|
171
|
+
- [#627](https://github.com/xataio/client-ts/pull/627) [`ad0a5b4`](https://github.com/xataio/client-ts/commit/ad0a5b4bc87b82fdc10008a8ea324a8ca783e678) Thanks [@SferaDev](https://github.com/SferaDev)! - Fix some cases where filters on link and multiple column types are not working
|
172
|
+
|
173
|
+
## 0.18.0
|
174
|
+
|
175
|
+
### Minor Changes
|
176
|
+
|
177
|
+
- [#562](https://github.com/xataio/client-ts/pull/562) [`699beb4`](https://github.com/xataio/client-ts/commit/699beb4bbf21cffa001d3f88a03246980e30250b) Thanks [@SferaDev](https://github.com/SferaDev)! - Return null on nullable columns
|
178
|
+
|
179
|
+
### Patch Changes
|
180
|
+
|
181
|
+
- [#583](https://github.com/xataio/client-ts/pull/583) [`330b076`](https://github.com/xataio/client-ts/commit/330b076a0781e3576c82afab76e3fb2a64f2e041) Thanks [@SferaDev](https://github.com/SferaDev)! - Add support for unique columns
|
182
|
+
|
183
|
+
- [#598](https://github.com/xataio/client-ts/pull/598) [`c3dfb4b`](https://github.com/xataio/client-ts/commit/c3dfb4babc990634b9e9747616ed93223178a2e7) Thanks [@SferaDev](https://github.com/SferaDev)! - API: Add patch database metadata endpoint
|
184
|
+
|
185
|
+
- [#602](https://github.com/xataio/client-ts/pull/602) [`74b17aa`](https://github.com/xataio/client-ts/commit/74b17aaedc0dbdd79bfdcb182b2e70b61f98f5a5) Thanks [@gimenete](https://github.com/gimenete)! - API: Make workspace slug optional on create
|
186
|
+
|
187
|
+
- [#615](https://github.com/xataio/client-ts/pull/615) [`83f20cd`](https://github.com/xataio/client-ts/commit/83f20cdbe53706c16016c4db3f318e679b24ec86) Thanks [@SferaDev](https://github.com/SferaDev)! - Make `getMany` return more items than max pagination size
|
188
|
+
|
189
|
+
- [#562](https://github.com/xataio/client-ts/pull/562) [`addfcc6`](https://github.com/xataio/client-ts/commit/addfcc67fca663defdd340111ea09c9188bad3ab) Thanks [@SferaDev](https://github.com/SferaDev)! - Add `orThrows` methods that instead of returning null, throw an exception.
|
190
|
+
|
191
|
+
- [#583](https://github.com/xataio/client-ts/pull/583) [`eb7ba59`](https://github.com/xataio/client-ts/commit/eb7ba594be2a1f0ab90956836bbeb912e188a46d) Thanks [@SferaDev](https://github.com/SferaDev)! - Add support for non nullable columns
|
192
|
+
|
193
|
+
- [#612](https://github.com/xataio/client-ts/pull/612) [`f1a0742`](https://github.com/xataio/client-ts/commit/f1a0742a04e1aefab14f46371a04a41069faec01) Thanks [@xata-bot](https://github.com/xata-bot)! - API: Add summarize table endpoint
|
194
|
+
|
195
|
+
## 0.17.1
|
196
|
+
|
197
|
+
### Patch Changes
|
198
|
+
|
199
|
+
- [#584](https://github.com/xataio/client-ts/pull/584) [`a305072`](https://github.com/xataio/client-ts/commit/a3050726517632b4975f2a2ed5f771dd247e51d5) Thanks [@SferaDev](https://github.com/SferaDev)! - Fix issues with multiple filters
|
200
|
+
|
201
|
+
* [#249](https://github.com/xataio/client-ts/pull/249) [`7812a41`](https://github.com/xataio/client-ts/commit/7812a414b7d99e9515c0ce48a61ad7a8b84d65d0) Thanks [@xata-bot](https://github.com/xata-bot)! - API: Add first endpoints for migration requests and schema compare
|
202
|
+
|
203
|
+
- [#585](https://github.com/xataio/client-ts/pull/585) [`d4a8ced`](https://github.com/xataio/client-ts/commit/d4a8ced9c257058ed7f660e01ee5fd1da154c391) Thanks [@SferaDev](https://github.com/SferaDev)! - Fix problem with some special characters not being URI encoded
|
204
|
+
|
205
|
+
* [#574](https://github.com/xataio/client-ts/pull/574) [`cf85b13`](https://github.com/xataio/client-ts/commit/cf85b13e1ca69e79100fd02f58d79d556012395d) Thanks [@SferaDev](https://github.com/SferaDev)! - Do not allow unknown tables on codegen output
|
206
|
+
|
207
|
+
- [#576](https://github.com/xataio/client-ts/pull/576) [`2350739`](https://github.com/xataio/client-ts/commit/2350739d3f0a176b0f1fc77b0f4f597321349726) Thanks [@SferaDev](https://github.com/SferaDev)! - Allow sending empty, undefined or conditional filters
|
208
|
+
|
209
|
+
* [#581](https://github.com/xataio/client-ts/pull/581) [`a336e61`](https://github.com/xataio/client-ts/commit/a336e6161be04a652e6f0f0a4c2edac10d50c99e) Thanks [@SferaDev](https://github.com/SferaDev)! - Update error codes in tracing
|
210
|
+
|
211
|
+
## 0.17.0
|
212
|
+
|
213
|
+
### Minor Changes
|
214
|
+
|
215
|
+
- [#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
|
216
|
+
|
217
|
+
* [#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
|
218
|
+
|
3
219
|
## 0.16.2
|
4
220
|
|
5
221
|
### Patch Changes
|
6
222
|
|
7
223
|
- [#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
|
8
224
|
|
9
|
-
* [#
|
225
|
+
* [#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
|
226
|
+
|
227
|
+
- [#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
|
228
|
+
|
229
|
+
* [#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
|
230
|
+
|
231
|
+
- [#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
|
10
232
|
|
11
233
|
## 0.16.1
|
12
234
|
|
package/README.md
CHANGED
@@ -12,11 +12,11 @@ This SDK has zero dependencies, so it can be used in many JavaScript runtimes in
|
|
12
12
|
- [Schema-generated Client](#schema-generated-client)
|
13
13
|
- [Schema-less Client](#schema-less-client)
|
14
14
|
- [API Design](#api-design)
|
15
|
-
- [Creating
|
16
|
-
- [Query a Single
|
17
|
-
- [Querying Multiple
|
18
|
-
- [Updating
|
19
|
-
- [Deleting
|
15
|
+
- [Creating Records](#creating-records)
|
16
|
+
- [Query a Single Record by its ID](#query-a-single-record-by-its-id)
|
17
|
+
- [Querying Multiple Records](#querying-multiple-records)
|
18
|
+
- [Updating Records](#updating-records)
|
19
|
+
- [Deleting Records](#deleting-records)
|
20
20
|
- [API Client](#api-client)
|
21
21
|
- [Deno support](#deno-support)
|
22
22
|
|
@@ -102,7 +102,7 @@ The Xata SDK to create/read/update/delete records follows the [repository patter
|
|
102
102
|
|
103
103
|
For example if you have a `users` table, there'll be a repository at `xata.db.users`. If you're using the schema-less client, you can also use the `xata.db.[table-name]` syntax to access the repository but without TypeScript auto-completion.
|
104
104
|
|
105
|
-
#### Creating
|
105
|
+
#### Creating Records
|
106
106
|
|
107
107
|
Invoke the `create()` method in the repository. Example:
|
108
108
|
|
@@ -112,33 +112,33 @@ const user = await xata.db.users.create({
|
|
112
112
|
});
|
113
113
|
```
|
114
114
|
|
115
|
-
If you want to create a record with a specific ID, you can
|
115
|
+
If you want to create a record with a specific ID, you can provide the id as parameter to the `create()` method.
|
116
116
|
|
117
117
|
```ts
|
118
|
-
const user = await xata.db.users.
|
118
|
+
const user = await xata.db.users.create('user_admin', {
|
119
119
|
fullName: 'John Smith'
|
120
120
|
});
|
121
121
|
```
|
122
122
|
|
123
|
-
And if you want to create or
|
123
|
+
And if you want to create or update a record with a specific ID, you can invoke `createOrUpdate()` with an id parameter.
|
124
124
|
|
125
125
|
```ts
|
126
|
-
const user = await
|
126
|
+
const user = await xata.db.users.createOrUpdate('user_admin', {
|
127
127
|
fullName: 'John Smith'
|
128
128
|
});
|
129
129
|
```
|
130
130
|
|
131
|
-
#### Query a Single
|
131
|
+
#### Query a Single Record by its ID
|
132
132
|
|
133
133
|
```ts
|
134
|
-
// `user` will be null if the
|
134
|
+
// `user` will be null if the record cannot be found
|
135
135
|
const user = await xata.db.users.read('rec_1234abcdef');
|
136
136
|
```
|
137
137
|
|
138
|
-
#### Querying Multiple
|
138
|
+
#### Querying Multiple Records
|
139
139
|
|
140
140
|
```ts
|
141
|
-
// Query
|
141
|
+
// Query records selecting all fields.
|
142
142
|
const page = await xata.db.users.select().getPaginated();
|
143
143
|
const user = await xata.db.users.select().getFirst();
|
144
144
|
|
@@ -146,7 +146,7 @@ const user = await xata.db.users.select().getFirst();
|
|
146
146
|
const page = await xata.db.users.getPaginated();
|
147
147
|
const user = await xata.db.users.getFirst();
|
148
148
|
|
149
|
-
// Query
|
149
|
+
// Query records selecting just one or more fields
|
150
150
|
const page = await xata.db.users.select('email', 'profile').getPaginated();
|
151
151
|
|
152
152
|
// Apply constraints
|
@@ -187,8 +187,8 @@ page.hasNextPage(); // Boolean
|
|
187
187
|
|
188
188
|
const nextPage = await page.nextPage(); // Page object
|
189
189
|
const previousPage = await page.previousPage(); // Page object
|
190
|
-
const
|
191
|
-
const
|
190
|
+
const startPage = await page.startPage(); // Page object
|
191
|
+
const endPage = await page.endPage(); // Page object
|
192
192
|
```
|
193
193
|
|
194
194
|
If you want to use an iterator, both the Repository and the Query classes implement an `AsyncIterable`. Alternatively you can use `getIterator()` and customize the batch size of the iterator:
|
@@ -207,9 +207,9 @@ for await (const records of xata.db.users.getIterator({ batchSize: 100 })) {
|
|
207
207
|
}
|
208
208
|
```
|
209
209
|
|
210
|
-
#### Updating
|
210
|
+
#### Updating Records
|
211
211
|
|
212
|
-
Updating
|
212
|
+
Updating a record leaves the existing object unchanged, but returns a new object with the updated values.
|
213
213
|
|
214
214
|
```ts
|
215
215
|
// Using an existing object
|
@@ -217,19 +217,19 @@ const updatedUser = await user.update({
|
|
217
217
|
fullName: 'John Smith Jr.'
|
218
218
|
});
|
219
219
|
|
220
|
-
// Using
|
220
|
+
// Using a record id
|
221
221
|
const updatedUser = await xata.db.users.update('rec_1234abcdef', {
|
222
222
|
fullName: 'John Smith Jr.'
|
223
223
|
});
|
224
224
|
```
|
225
225
|
|
226
|
-
#### Deleting
|
226
|
+
#### Deleting Records
|
227
227
|
|
228
228
|
```ts
|
229
229
|
// Using an existing object
|
230
230
|
await user.delete();
|
231
231
|
|
232
|
-
// Using
|
232
|
+
// Using a record id
|
233
233
|
await xata.db.users.delete('rec_1234abcdef');
|
234
234
|
```
|
235
235
|
|
@@ -246,22 +246,22 @@ const api = new XataApiClient({ apiKey: process.env.XATA_API_KEY });
|
|
246
246
|
Once you have initialized the API client, the operations are organized following the same hiearchy as in the [official documentation](https://docs.xata.io). You have different namespaces for each entity (ie. `workspaces`, `databases`, `tables`, `branches`, `users`, `records`...).
|
247
247
|
|
248
248
|
```ts
|
249
|
-
const { id: workspace } = await
|
250
|
-
const { databaseName } = await
|
249
|
+
const { id: workspace } = await api.workspaces.createWorkspace({ name: 'example' });
|
250
|
+
const { databaseName } = await api.database.createDatabase(workspace, 'database', { region: 'eu-west-1' });
|
251
251
|
|
252
|
-
await
|
253
|
-
await
|
254
|
-
await
|
252
|
+
await api.branches.createBranch(workspace, databaseName, 'branch');
|
253
|
+
await api.tables.createTable(workspace, databaseName, 'branch', 'table');
|
254
|
+
await api.tables.setTableSchema(workspace, databaseName, 'branch', 'table', {
|
255
255
|
columns: [{ name: 'email', type: 'string' }]
|
256
256
|
});
|
257
257
|
|
258
|
-
const { id: recordId } = await
|
258
|
+
const { id: recordId } = await api.records.insertRecord(workspace, databaseName, 'branch', 'table', {
|
259
259
|
email: 'example@foo.bar'
|
260
260
|
});
|
261
261
|
|
262
|
-
const record = await
|
262
|
+
const record = await api.records.getRecord(workspace, databaseName, 'branch', 'table', recordId);
|
263
263
|
|
264
|
-
await
|
264
|
+
await api.workspaces.deleteWorkspace(workspace);
|
265
265
|
```
|
266
266
|
|
267
267
|
## Deno support
|
package/Usage.md
CHANGED
@@ -41,25 +41,27 @@ To get a collection of records, you can use the `Query` object. It provides the
|
|
41
41
|
- `getAll()`: returns all the records in the query results by making multiple requests to iterate over all the pages which exist. If the query is not filtered and the table is a large dataset, this operation can affect the performance.
|
42
42
|
- `getMany()`: returns an array with a subset of the first results in the query. The default [pagination](#page) size (20) is used and can be customised by passing a different `{ pagination: { size: number } }` in its options. To learn more about default values, see [helper variables](#helper-variables).
|
43
43
|
|
44
|
+
Both the `getAll()` and `getMany()` will produce multiple requests to the server if the query should return more than the maximum page size. We perform the minimum number of requests to get the desired number of records.
|
45
|
+
|
44
46
|
All these methods allow customising its filters, column selection, column ordering, pagination or cache TTL. For example:
|
45
47
|
|
46
48
|
```ts
|
47
49
|
// First item sorting by name
|
48
|
-
const user = await xata.db.users.getFirst({ sort:
|
50
|
+
const user = await xata.db.users.getFirst({ sort: 'name' });
|
49
51
|
|
50
52
|
// Get first 50 items but ignore the first one
|
51
|
-
const users = await xata.db.users.getMany({ pagination: {
|
53
|
+
const users = await xata.db.users.getMany({ pagination: { size: 50, offset: 1 } });
|
52
54
|
|
53
55
|
// Get page of 100 items where name contains "foo"
|
54
|
-
const page = await xata.db.users.getPaginated({ filter: { name: { $contains:
|
56
|
+
const page = await xata.db.users.getPaginated({ filter: { name: { $contains: 'foo' } }, pagination: { size: 100 } });
|
55
57
|
|
56
58
|
// Get all admin users and cache the result for 5 minutes
|
57
|
-
const user = await xata.db.users.filter(
|
59
|
+
const user = await xata.db.users.filter('role', 'admin').getAll({ cache: 5 * 60 * 1000 });
|
58
60
|
|
59
61
|
// Overwrite values set in a query
|
60
|
-
const query = xata.db.users.filter(
|
62
|
+
const query = xata.db.users.filter('role', 'admin').select(['name']);
|
61
63
|
const adminUsers = await query.getAll();
|
62
|
-
const firstAdminUserWithEmail = await query.getFirst({ columns: [
|
64
|
+
const firstAdminUserWithEmail = await query.getFirst({ columns: ['name', 'email'] });
|
63
65
|
```
|
64
66
|
|
65
67
|
Since the [`Repository`](#repository) class implements the `Query` interface, you can use it to query and paginate the records in the table too.
|
@@ -327,8 +329,8 @@ It contains:
|
|
327
329
|
- `hasNextPage`: Function that returns a boolean indicating if there is a next page.
|
328
330
|
- `nextPage`: Async function that can be used to get the next page.
|
329
331
|
- `previousPage`: Async function that can be used to get the previous page.
|
330
|
-
- `
|
331
|
-
- `
|
332
|
+
- `startPage`: Async function that can be used to get the start page.
|
333
|
+
- `endPage`: Async function that can be used to get the end page.
|
332
334
|
- `meta`: Information about the current page and its cursor.
|
333
335
|
|
334
336
|
```ts
|
@@ -342,14 +344,14 @@ page2.records; // Array of `XataRecord` objects.
|
|
342
344
|
const page1 = await page2.previousPage();
|
343
345
|
page1.records; // Array of `XataRecord` objects.
|
344
346
|
|
345
|
-
const
|
346
|
-
|
347
|
+
const startPage = await page1.startPage();
|
348
|
+
startPage.records; // Array of `XataRecord` objects.
|
347
349
|
```
|
348
350
|
|
349
351
|
The `Repository` class implements the `Query` interface, so you can use it to paginate the records in the table too.
|
350
352
|
|
351
353
|
```ts
|
352
|
-
const page = await xata.db.users.
|
354
|
+
const page = await xata.db.users.startPage();
|
353
355
|
page.records; // Array of `XataRecord` objects.
|
354
356
|
```
|
355
357
|
|