@xata.io/client
Advanced tools
Comparing version 0.0.0-alpha.v82d5185 to 0.0.0-alpha.v82e685d8f1d2c614ba800e811457f0a41fc0d4aa
336
CHANGELOG.md
# @xata.io/client | ||
## 0.0.0-alpha.v82d5185 | ||
## 0.0.0-alpha.v82e685d8f1d2c614ba800e811457f0a41fc0d4aa | ||
### Patch Changes | ||
- Force canary build | ||
## 0.30.0 | ||
### Minor Changes | ||
- [#1494](https://github.com/xataio/client-ts/pull/1494) [`cc673c9`](https://github.com/xataio/client-ts/commit/cc673c9a7885351082020e360630eab5db78c652) Thanks [@eemmiillyy](https://github.com/eemmiillyy)! - [Breaking] Update `XataApiClient` to use unified parameters | ||
## 0.29.5 | ||
### Patch Changes | ||
- [#1487](https://github.com/xataio/client-ts/pull/1487) [`6b754d2`](https://github.com/xataio/client-ts/commit/6b754d2f6a1f7b9378a96fe27502ff6c29ff5ed8) Thanks [@SferaDev](https://github.com/SferaDev)! - Add batch SQL support | ||
## 0.29.4 | ||
### Patch Changes | ||
- [#1429](https://github.com/xataio/client-ts/pull/1429) [`2140a24`](https://github.com/xataio/client-ts/commit/2140a24f32a94f36bab8c8268033c7dcf235dddc) Thanks [@SferaDev](https://github.com/SferaDev)! - Add more postgres types to inference | ||
- [#1428](https://github.com/xataio/client-ts/pull/1428) [`d8032f2`](https://github.com/xataio/client-ts/commit/d8032f2e07bdcc653db1606796d27f08d397cdbe) Thanks [@SferaDev](https://github.com/SferaDev)! - Remove errors of Buffer in cloudflare | ||
## 0.29.3 | ||
### Patch Changes | ||
- [#1399](https://github.com/xataio/client-ts/pull/1399) [`02053fb`](https://github.com/xataio/client-ts/commit/02053fbb10479b8e9453691f957d3235762555aa) Thanks [@SferaDev](https://github.com/SferaDev)! - Expose `xata.sql.connectionString` helper | ||
- [#1398](https://github.com/xataio/client-ts/pull/1398) [`e27cb74`](https://github.com/xataio/client-ts/commit/e27cb74143aa9b6c654713878e5d3776858e5290) Thanks [@SferaDev](https://github.com/SferaDev)! - Add support for array response type | ||
## 0.29.2 | ||
### Patch Changes | ||
- [#1380](https://github.com/xataio/client-ts/pull/1380) [`e8db1cd`](https://github.com/xataio/client-ts/commit/e8db1cd394ccbed32403548bf9d09a5c3973d850) Thanks [@richardgill](https://github.com/richardgill)! - Link to our docs to explain how to resolve the 'api key in browser' error message | ||
## 0.29.1 | ||
### Patch Changes | ||
- [#1364](https://github.com/xataio/client-ts/pull/1364) [`d0f5d12`](https://github.com/xataio/client-ts/commit/d0f5d125e6c2f4c82f8a0a6b4a30d255c58e8326) Thanks [@SferaDev](https://github.com/SferaDev)! - Show search properties in xata metadata object | ||
- [#1263](https://github.com/xataio/client-ts/pull/1263) [`212b53d`](https://github.com/xataio/client-ts/commit/212b53d07498def0d2ed8942691eff982e448969) Thanks [@SferaDev](https://github.com/SferaDev)! - Don't attempt to retrieve tables on runtime | ||
- [#1339](https://github.com/xataio/client-ts/pull/1339) [`9fd8c42`](https://github.com/xataio/client-ts/commit/9fd8c428d71b476f1951123c6cba5e803b983e54) Thanks [@SferaDev](https://github.com/SferaDev)! - Allow using normal commands with pgroll enabled branches | ||
- [#1361](https://github.com/xataio/client-ts/pull/1361) [`368d4aa`](https://github.com/xataio/client-ts/commit/368d4aa16cd1cc1da93a142406c5d41bbc15b082) Thanks [@SferaDev](https://github.com/SferaDev)! - Add `toSerializable` to `getAll` | ||
## 0.29.0 | ||
### Minor Changes | ||
- [#1329](https://github.com/xataio/client-ts/pull/1329) [`0ec026a`](https://github.com/xataio/client-ts/commit/0ec026a92bdb1a405cb9d90cb1d506ff159f98e8) Thanks [@eemmiillyy](https://github.com/eemmiillyy)! - Remove object column type | ||
### Patch Changes | ||
- [#1334](https://github.com/xataio/client-ts/pull/1334) [`6414bd3`](https://github.com/xataio/client-ts/commit/6414bd3d8bdb84961e68968df4b0b025503f0d72) Thanks [@SferaDev](https://github.com/SferaDev)! - Expose columns in SQL query | ||
- [#1328](https://github.com/xataio/client-ts/pull/1328) [`27773df`](https://github.com/xataio/client-ts/commit/27773df5addf0013d1a7238ac490904e7aad2334) Thanks [@SferaDev](https://github.com/SferaDev)! - Fix untagged scenario for SQL function | ||
## 0.28.4 | ||
### Patch Changes | ||
- [#1309](https://github.com/xataio/client-ts/pull/1309) [`adc961b`](https://github.com/xataio/client-ts/commit/adc961b886b789010e6512c17cb2377eceab665a) Thanks [@andrew-farries](https://github.com/andrew-farries)! - Add CLI support for running against local development environments | ||
- [#1312](https://github.com/xataio/client-ts/pull/1312) [`6031a9d`](https://github.com/xataio/client-ts/commit/6031a9de63c264b7db5b031bb1795258c2bf8150) Thanks [@SferaDev](https://github.com/SferaDev)! - Add get to transactions | ||
## 0.28.3 | ||
### Patch Changes | ||
- [#1304](https://github.com/xataio/client-ts/pull/1304) [`b7f3ec9`](https://github.com/xataio/client-ts/commit/b7f3ec9eabe3642929131e244bd774f4d3134482) Thanks [@SferaDev](https://github.com/SferaDev)! - Rewrite upload url path | ||
## 0.28.2 | ||
### Patch Changes | ||
- [#1288](https://github.com/xataio/client-ts/pull/1288) [`c9178e1`](https://github.com/xataio/client-ts/commit/c9178e1e3f2268513e78dcfce396a99a8fca5dfb) Thanks [@SferaDev](https://github.com/SferaDev)! - Update read to use `ReadonlyArray<Identifier>` | ||
## 0.28.1 | ||
### Patch Changes | ||
- [#1281](https://github.com/xataio/client-ts/pull/1281) [`9a7e3f5`](https://github.com/xataio/client-ts/commit/9a7e3f5029e53efc6750e9c86bab936427788209) Thanks [@SferaDev](https://github.com/SferaDev)! - Fix issue with default public access | ||
## 0.28.0 | ||
### Minor Changes | ||
- [#1251](https://github.com/xataio/client-ts/pull/1251) [`e97d1999`](https://github.com/xataio/client-ts/commit/e97d1999f3c25f149213ceca81958e1674624e05) Thanks [@SferaDev](https://github.com/SferaDev)! - Remove Xata Workers support | ||
## 0.27.0 | ||
### Minor Changes | ||
- [#1232](https://github.com/xataio/client-ts/pull/1232) [`d282d18f`](https://github.com/xataio/client-ts/commit/d282d18f025094e0729ade6009b34fc0d34ebbba) Thanks [@eemmiillyy](https://github.com/eemmiillyy)! - Add support for totalCount on search responses | ||
### Patch Changes | ||
- [#1235](https://github.com/xataio/client-ts/pull/1235) [`19c5dd47`](https://github.com/xataio/client-ts/commit/19c5dd47e3a032fcb19d990527b8faaa9326d97d) Thanks [@eemmiillyy](https://github.com/eemmiillyy)! - Fix excessive depth on summarize | ||
## 0.26.9 | ||
### Patch Changes | ||
- [#1224](https://github.com/xataio/client-ts/pull/1224) [`302798e8`](https://github.com/xataio/client-ts/commit/302798e8d210c89f420a5c927e0f836a27dbaed9) Thanks [@SferaDev](https://github.com/SferaDev)! - Export transaction types | ||
## 0.26.8 | ||
### Patch Changes | ||
- [#1222](https://github.com/xataio/client-ts/pull/1222) [`fa2883b0`](https://github.com/xataio/client-ts/commit/fa2883b0639e48d68097401bf515c8cb95df5b4b) Thanks [@SferaDev](https://github.com/SferaDev)! - Increase recursion for circular references to 3 | ||
- [#1216](https://github.com/xataio/client-ts/pull/1216) [`c04faece`](https://github.com/xataio/client-ts/commit/c04faece8830699d978e03c89f29e383e479e824) Thanks [@SferaDev](https://github.com/SferaDev)! - Support binary upload of XataFile | ||
- [#1217](https://github.com/xataio/client-ts/pull/1217) [`cb45cc9f`](https://github.com/xataio/client-ts/commit/cb45cc9f6829e1b555762e656cc1b0b2e977aaf9) Thanks [@eemmiillyy](https://github.com/eemmiillyy)! - JSON responses for JSON fields in summarize API | ||
## 0.26.7 | ||
### Patch Changes | ||
- [#1205](https://github.com/xataio/client-ts/pull/1205) [`0e1c50de`](https://github.com/xataio/client-ts/commit/0e1c50de5850db2dfbbdfff9d66eda3bf1322836) Thanks [@eemmiillyy](https://github.com/eemmiillyy)! - Add optional mediaType override to binary file API | ||
- [#1203](https://github.com/xataio/client-ts/pull/1203) [`d093d363`](https://github.com/xataio/client-ts/commit/d093d363a51fc23c8513d51600bb3b31bbc45334) Thanks [@SferaDev](https://github.com/SferaDev)! - [Attachments] Fix column selection | ||
## 0.26.6 | ||
### Patch Changes | ||
- [#1180](https://github.com/xataio/client-ts/pull/1180) [`3330c9cf`](https://github.com/xataio/client-ts/commit/3330c9cf8d8db18b8e355a576e4afd589b6152bf) Thanks [@SferaDev](https://github.com/SferaDev)! - Support expanded links in `toSerialized` | ||
- [#1191](https://github.com/xataio/client-ts/pull/1191) [`a738816d`](https://github.com/xataio/client-ts/commit/a738816d355f4415b0622bb5a23b4154f9855177) Thanks [@SferaDev](https://github.com/SferaDev)! - Add support for `percentiles` aggregation | ||
## 0.26.5 | ||
### Patch Changes | ||
- [#1166](https://github.com/xataio/client-ts/pull/1166) [`b9b9058f`](https://github.com/xataio/client-ts/commit/b9b9058f0bc81b660da45318c27191a62f041f21) Thanks [@SferaDev](https://github.com/SferaDev)! - Fix error with Node 16 | ||
## 0.26.4 | ||
### Patch Changes | ||
- [#1160](https://github.com/xataio/client-ts/pull/1160) [`7166797c`](https://github.com/xataio/client-ts/commit/7166797c28839198d20a9115d0414cebc2fed39b) Thanks [@SferaDev](https://github.com/SferaDev)! - [Files] Return file id on array | ||
- [#1156](https://github.com/xataio/client-ts/pull/1156) [`b85df75f`](https://github.com/xataio/client-ts/commit/b85df75f2f466762a8b3d9824c9292c7e3db03fd) Thanks [@SferaDev](https://github.com/SferaDev)! - [Files] Add download transformation | ||
## 0.26.3 | ||
### Patch Changes | ||
- [#1144](https://github.com/xataio/client-ts/pull/1144) [`4910dce2`](https://github.com/xataio/client-ts/commit/4910dce29d3cc17d13aadf32e4eb476ffb571fad) Thanks [@SferaDev](https://github.com/SferaDev)! - Support for JSON and Revlinks | ||
## 0.26.2 | ||
### Patch Changes | ||
- [#1147](https://github.com/xataio/client-ts/pull/1147) [`22fccb51`](https://github.com/xataio/client-ts/commit/22fccb51709749c319897702c15749b74ce4b820) Thanks [@SferaDev](https://github.com/SferaDev)! - Expose metadataSignedUrl | ||
## 0.26.1 | ||
### Patch Changes | ||
- [#1139](https://github.com/xataio/client-ts/pull/1139) [`922e6e54`](https://github.com/xataio/client-ts/commit/922e6e54e8b31641770a36b6b4ff8f4fa65d304d) Thanks [@SferaDev](https://github.com/SferaDev)! - Fix scenario with merging existing transformations | ||
- [#1140](https://github.com/xataio/client-ts/pull/1140) [`13f6f3e4`](https://github.com/xataio/client-ts/commit/13f6f3e4b1a2f925d50a5380b62ef1057f5c3893) Thanks [@SferaDev](https://github.com/SferaDev)! - Add metadata url for transformations | ||
- [#1136](https://github.com/xataio/client-ts/pull/1136) [`f02fc165`](https://github.com/xataio/client-ts/commit/f02fc165bf6558e4377eb9f8e1d0f4222f004c70) Thanks [@SferaDev](https://github.com/SferaDev)! - Fixes for Blob files in binary APIs | ||
## 0.26.0 | ||
### Minor Changes | ||
- [#893](https://github.com/xataio/client-ts/pull/893) [`6ec862f8`](https://github.com/xataio/client-ts/commit/6ec862f8f799eb692f62be79dd0b613b83a34780) Thanks [@SferaDev](https://github.com/SferaDev)! - Add SQL plugin | ||
### Patch Changes | ||
- [#1134](https://github.com/xataio/client-ts/pull/1134) [`0c0149ad`](https://github.com/xataio/client-ts/commit/0c0149ad1ee3f7c0fe9d31030552b022c907edb0) Thanks [@SferaDev](https://github.com/SferaDev)! - Make transformImage accept object-shaped parameters | ||
## 0.25.3 | ||
### Patch Changes | ||
- [#1131](https://github.com/xataio/client-ts/pull/1131) [`3b9e1984`](https://github.com/xataio/client-ts/commit/3b9e1984329cd0e9f885f6af4155cc85ab61ba41) Thanks [@xata-bot](https://github.com/xata-bot)! - Add json type for columns | ||
## 0.25.2 | ||
### Patch Changes | ||
- [#1111](https://github.com/xataio/client-ts/pull/1111) [`9d1ace5f`](https://github.com/xataio/client-ts/commit/9d1ace5f12788755f3150449120b27cd030af3a9) Thanks [@SferaDev](https://github.com/SferaDev)! - Export file helpers | ||
- [#1114](https://github.com/xataio/client-ts/pull/1114) [`f6665593`](https://github.com/xataio/client-ts/commit/f6665593c301dc9400834cbd68ae32b92bbdea5d) Thanks [@SferaDev](https://github.com/SferaDev)! - Fix warning with default env branch | ||
## 0.25.1 | ||
### Patch Changes | ||
- [#1101](https://github.com/xataio/client-ts/pull/1101) [`321c33ff`](https://github.com/xataio/client-ts/commit/321c33ff684c416a6cc813be2a970fd8f826b885) Thanks [@SferaDev](https://github.com/SferaDev)! - Fix bug with cancellable timeouts | ||
## 0.25.0 | ||
### Minor Changes | ||
- [#1041](https://github.com/xataio/client-ts/pull/1041) [`ac3b968f`](https://github.com/xataio/client-ts/commit/ac3b968f7ca476f2c82b1b2719d020fbd7164f38) Thanks [@SferaDev](https://github.com/SferaDev)! - Add support for files and attachments | ||
### Patch Changes | ||
- [#1024](https://github.com/xataio/client-ts/pull/1024) [`aef9c834`](https://github.com/xataio/client-ts/commit/aef9c834a850494020e7585cb4ce67b446f9ccfc) Thanks [@SferaDev](https://github.com/SferaDev)! - Fix type inconsistency with `xata` internal property | ||
- [#1085](https://github.com/xataio/client-ts/pull/1085) [`bcce0d3b`](https://github.com/xataio/client-ts/commit/bcce0d3b0b53468937accd4fee3b5485c35f69ad) Thanks [@SferaDev](https://github.com/SferaDev)! - Add support for sessions in ask endpoint | ||
- [#1067](https://github.com/xataio/client-ts/pull/1067) [`c1f2d264`](https://github.com/xataio/client-ts/commit/c1f2d2649e077cdffae97c90b9d2b1c75d6858fb) Thanks [@SferaDev](https://github.com/SferaDev)! - Fix error 400 with partial filters | ||
- [#1071](https://github.com/xataio/client-ts/pull/1071) [`6c2c2630`](https://github.com/xataio/client-ts/commit/6c2c26308d4cbd25e7a9677c7d25c836396d4965) Thanks [@SferaDev](https://github.com/SferaDev)! - Add request timeout | ||
## 0.24.3 | ||
### Patch Changes | ||
- [#1033](https://github.com/xataio/client-ts/pull/1033) [`f01d1580`](https://github.com/xataio/client-ts/commit/f01d1580fc450cbf06eb8af85d68cf052fbe83a1) Thanks [@xata-bot](https://github.com/xata-bot)! - [OpenAPI] Spec updates for column selection | ||
- [#1044](https://github.com/xataio/client-ts/pull/1044) [`52290feb`](https://github.com/xataio/client-ts/commit/52290feb5bba57384cdc14e7722fb5d9883dc581) Thanks [@SferaDev](https://github.com/SferaDev)! - Allow undefined with createOrUpdate/createOrReplace | ||
## 0.24.2 | ||
### Patch Changes | ||
- [#1038](https://github.com/xataio/client-ts/pull/1038) [`51561b52`](https://github.com/xataio/client-ts/commit/51561b52b56ad5ed9101d8faf12929891419cb2c) Thanks [@SferaDev](https://github.com/SferaDev)! - Show internal columns in filters | ||
## 0.24.1 | ||
### Patch Changes | ||
- [#1030](https://github.com/xataio/client-ts/pull/1030) [`eaa774f5`](https://github.com/xataio/client-ts/commit/eaa774f542185ef92448155bcdff331686c4da9f) Thanks [@SferaDev](https://github.com/SferaDev)! - Make `xata` property enumerable | ||
## 0.24.0 | ||
### Minor Changes | ||
- [#1009](https://github.com/xataio/client-ts/pull/1009) [`45aa2207`](https://github.com/xataio/client-ts/commit/45aa220728e98dd716a55a9a307474732a9b2bc1) Thanks [@SferaDev](https://github.com/SferaDev)! - Add `createdAt` and `updatedAt` properties | ||
### Patch Changes | ||
- [#1008](https://github.com/xataio/client-ts/pull/1008) [`f28080f0`](https://github.com/xataio/client-ts/commit/f28080f034f02704fe00d64b8f42e1127bde30c7) Thanks [@SferaDev](https://github.com/SferaDev)! - Add `failIfMissing` to delete transactions | ||
- [#994](https://github.com/xataio/client-ts/pull/994) [`ac9c0604`](https://github.com/xataio/client-ts/commit/ac9c06042bb85105d9a38624676ce6ea5a27d488) Thanks [@xata-bot](https://github.com/xata-bot)! - Update internal endpoints | ||
- [#1015](https://github.com/xataio/client-ts/pull/1015) [`c163b365`](https://github.com/xataio/client-ts/commit/c163b3658f23fb2eaad6243ebebc92624754099a) Thanks [@SferaDev](https://github.com/SferaDev)! - Add `factor` to date boosters | ||
## 0.23.5 | ||
### Patch Changes | ||
- [#970](https://github.com/xataio/client-ts/pull/970) [`20cc8c43`](https://github.com/xataio/client-ts/commit/20cc8c43e1659bf112ae2642948c84bfcf46a6ba) Thanks [@xata-bot](https://github.com/xata-bot)! - Add delete file endpoint | ||
- [#976](https://github.com/xataio/client-ts/pull/976) [`5099cbbd`](https://github.com/xataio/client-ts/commit/5099cbbd3065a60dcee2f1699afa1ee8ed5edb1c) Thanks [@SferaDev](https://github.com/SferaDev)! - Re-export JSONData helper type | ||
- [#972](https://github.com/xataio/client-ts/pull/972) [`89375e76`](https://github.com/xataio/client-ts/commit/89375e76b790fed7e6a26bf3ac4ea9eaed1aecae) Thanks [@SferaDev](https://github.com/SferaDev)! - Add types to exports | ||
- [#979](https://github.com/xataio/client-ts/pull/979) [`5eaee932`](https://github.com/xataio/client-ts/commit/5eaee932b828907ae352d7c0d0584e860845434b) Thanks [@SferaDev](https://github.com/SferaDev)! - Add `size` to pagination meta | ||
- [#974](https://github.com/xataio/client-ts/pull/974) [`109b8790`](https://github.com/xataio/client-ts/commit/109b8790849532d9c442e7c03c67792aeafebd88) Thanks [@xata-bot](https://github.com/xata-bot)! - Make checksum mandatory | ||
## 0.23.4 | ||
### Patch Changes | ||
- [#951](https://github.com/xataio/client-ts/pull/951) [`470cc71f`](https://github.com/xataio/client-ts/commit/470cc71f7c5c8b9fd50f789e157d2b2eecd0b3e8) Thanks [@SferaDev](https://github.com/SferaDev)! - Add random sorting | ||
## 0.23.3 | ||
### Patch Changes | ||
- [#947](https://github.com/xataio/client-ts/pull/947) [`344b0d68`](https://github.com/xataio/client-ts/commit/344b0d687962d569872d1e90d59818d28df7579c) Thanks [@SferaDev](https://github.com/SferaDev)! - Add numeric operators | ||
## 0.23.2 | ||
### Patch Changes | ||
- [#939](https://github.com/xataio/client-ts/pull/939) [`c477c177`](https://github.com/xataio/client-ts/commit/c477c17795c01cbf945be413217944a5a38655a5) Thanks [@SferaDev](https://github.com/SferaDev)! - Add deploy preview branch env variable loading | ||
- [#945](https://github.com/xataio/client-ts/pull/945) [`ecdc6553`](https://github.com/xataio/client-ts/commit/ecdc6553d4628289e88953ab6296b80f60e8f757) Thanks [@xata-bot](https://github.com/xata-bot)! - Add new types | ||
## 0.23.1 | ||
### Patch Changes | ||
- [#941](https://github.com/xataio/client-ts/pull/941) [`3026d708`](https://github.com/xataio/client-ts/commit/3026d70847830fd0f2024413d823380ff323806c) Thanks [@SferaDev](https://github.com/SferaDev)! - Expose records in ask SSE | ||
## 0.23.0 | ||
### Minor Changes | ||
- [#867](https://github.com/xataio/client-ts/pull/867) [`5838113f`](https://github.com/xataio/client-ts/commit/5838113fca042163b44d7cc7cc1686d5ef89b302) Thanks [@SferaDev](https://github.com/SferaDev)! - [Workflow] Remove fallback branch | ||
## 0.22.4 | ||
### Patch Changes | ||
- [#927](https://github.com/xataio/client-ts/pull/927) [`22e7dd29`](https://github.com/xataio/client-ts/commit/22e7dd29f7a51dccc087d5fd7fff32084c7733af) Thanks [@SferaDev](https://github.com/SferaDev)! - Expose `ask` endpoint in the SDK | ||
- [#921](https://github.com/xataio/client-ts/pull/921) [`07fc879d`](https://github.com/xataio/client-ts/commit/07fc879d3f778536e39588e66d7a18b5a9d52ebe) Thanks [@SferaDev](https://github.com/SferaDev)! - Remove git branch resolution | ||
- [#925](https://github.com/xataio/client-ts/pull/925) [`58a1c24e`](https://github.com/xataio/client-ts/commit/58a1c24e5d30025dce243eecce44f09d4f65ed66) Thanks [@xata-bot](https://github.com/xata-bot)! - Add new methods to API client | ||
- [#932](https://github.com/xataio/client-ts/pull/932) [`c2c6e244`](https://github.com/xataio/client-ts/commit/c2c6e24459b1acc07f0414066258071fbcf7dde9) Thanks [@xata-bot](https://github.com/xata-bot)! - Add new experimental copy branch endpoint | ||
## 0.22.3 | ||
### Patch Changes | ||
- [#917](https://github.com/xataio/client-ts/pull/917) [`4210b8c3`](https://github.com/xataio/client-ts/commit/4210b8c3c4169ba781a56deed7ba09c99788db1f) Thanks [@xata-bot](https://github.com/xata-bot)! - [OpenAPI] Spec updates to add better types to Record input | ||
## 0.22.2 | ||
### Patch Changes | ||
- [#898](https://github.com/xataio/client-ts/pull/898) [`72e13bf9`](https://github.com/xataio/client-ts/commit/72e13bf99d0ebefef91c984a995a28b0e8ca2a8f) Thanks [@SferaDev](https://github.com/SferaDev)! - Add methods for vector type | ||
## 0.22.1 | ||
### Patch Changes | ||
- [#885](https://github.com/xataio/client-ts/pull/885) [`4cafde72`](https://github.com/xataio/client-ts/commit/4cafde728e4e9e5e83812d475d9980397ae78362) Thanks [@SferaDev](https://github.com/SferaDev)! - Update body of compareBranchSchemas | ||
- [#890](https://github.com/xataio/client-ts/pull/890) [`639710a5`](https://github.com/xataio/client-ts/commit/639710a52132f260bf3a26560a21ae2193abb71d) Thanks [@SferaDev](https://github.com/SferaDev)! - Expose consistency settings in summarize | ||
## 0.22.0 | ||
### Minor Changes | ||
- [#852](https://github.com/xataio/client-ts/pull/852) [`b2a4def4`](https://github.com/xataio/client-ts/commit/b2a4def4baf3eb18cd323895635e0bccb7f876f4) Thanks [@SferaDev](https://github.com/SferaDev)! - [BREAKING CHANGE] Reduce column selection depth | ||
@@ -11,4 +343,2 @@ | ||
- Force canary build | ||
- [#835](https://github.com/xataio/client-ts/pull/835) [`379e6144`](https://github.com/xataio/client-ts/commit/379e61446b21e7cbadd7fc59267736c6845ec566) Thanks [@SferaDev](https://github.com/SferaDev)! - Add helper methods `toSerializable` and `toString` | ||
@@ -15,0 +345,0 @@ |
{ | ||
"name": "@xata.io/client", | ||
"version": "0.0.0-alpha.v82d5185", | ||
"version": "0.0.0-alpha.v82e685d8f1d2c614ba800e811457f0a41fc0d4aa", | ||
"description": "Xata.io SDK for TypeScript and JavaScript", | ||
@@ -9,4 +9,7 @@ "main": "./dist/index.cjs", | ||
"exports": { | ||
"import": "./dist/index.mjs", | ||
"require": "./dist/index.cjs" | ||
".": { | ||
"import": "./dist/index.mjs", | ||
"require": "./dist/index.cjs", | ||
"types": "./dist/index.d.ts" | ||
} | ||
}, | ||
@@ -13,0 +16,0 @@ "browser": { |
275
README.md
@@ -7,275 +7,2 @@ # Xata SDK for TypeScript and JavaScript | ||
## Installation | ||
See our [docs](https://xata.io/docs/sdk/typescript#installation) to get started using the Xata SDK. | ||
## Table of Contents | ||
<!-- START doctoc generated TOC please keep comment here to allow auto update --> | ||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> | ||
- [Installation](#installation) | ||
- [Usage](#usage) | ||
- [Schema-generated Client](#schema-generated-client) | ||
- [Schema-less Client](#schema-less-client) | ||
- [API Design](#api-design) | ||
- [Creating Records](#creating-records) | ||
- [Query a Single Record by its ID](#query-a-single-record-by-its-id) | ||
- [Querying Multiple Records](#querying-multiple-records) | ||
- [Updating Records](#updating-records) | ||
- [Deleting Records](#deleting-records) | ||
- [API Client](#api-client) | ||
- [Deno support](#deno-support) | ||
<!-- END doctoc generated TOC please keep comment here to allow auto update --> | ||
## Manual Installation | ||
```bash | ||
npm install @xata.io/client | ||
``` | ||
## Usage | ||
There are three ways to use the SDK: | ||
- **Schema-generated Client**: SDK to create/read/update/delete records in a given database following a schema file (with type-safety). | ||
- **Schema-less Client**: SDK to create/read/update/delete records in any database without schema validation (with partial type-safety). | ||
- **API Client**: SDK to interact with the whole Xata API and all its endpoints. | ||
### Schema-generated Client | ||
To use the schema-generated client, you need to run the code generator utility that comes with [our CLI](https://docs.xata.io/cli/getting-started). | ||
To run it (and assuming you have configured the project with `xata init`): | ||
```bash | ||
xata codegen | ||
``` | ||
In a TypeScript file, start using the generated code like this: | ||
```ts | ||
import { XataClient } from './xata'; // or wherever you chose to generate the client | ||
const xata = new XataClient(); | ||
``` | ||
The import above will differ if you chose to generate the code in a different location. | ||
The `XataClient` constructor accepts an object with configuration options, like the `fetch` parameter, which is required only if your runtime doesn't provide a global `fetch` function. There's also a `databaseURL` argument that by default will contain a URL pointing to your database (e.g. `https://myworkspace-123abc.xata.sh/db/databasename`). It can be specified in the constructor to overwrite that value if for whatever reason you need to connect to a different workspace or database. | ||
The code generator will create two TypeScript types for each schema entity. The base one will be an `Identifiable` entity with the internal properties your entity has and the `Record` one will extend it with a set of operations (update, delete, etc...) and some schema metadata (xata version). | ||
```ts | ||
interface User extends Identifiable { | ||
email?: string | null; | ||
} | ||
type UserRecord = User & XataRecord; | ||
async function initializeDatabase(admin: User): Promise<UserRecord> { | ||
return xata.db.users.create(admin); | ||
} | ||
const admin = await initializeDatabase({ email: 'admin@example.com' }); | ||
await admin.update({ email: 'admin@foo.bar' }); | ||
await admin.delete(); | ||
``` | ||
You will learn more about the available operations below, under the [`API Design`](#api-design) section. | ||
### Schema-less Client | ||
If you don't have a schema file, or you are building a generic way to interact with Xata, you can use the `BaseClient` class without schema validation. | ||
```ts | ||
import { BaseClient } from '@xata.io/client'; | ||
const xata = new BaseClient({ | ||
branch: 'branchname', | ||
apiKey: 'xau_1234abcdef', | ||
fetch: fetchImplementation // Required if your runtime doesn't provide a global `fetch` function. | ||
}); | ||
``` | ||
It works the same way as the code-generated `XataClient` but doesn't provide type-safety for your model. | ||
You can read more on the methods available below, in the next section. | ||
### API Design | ||
The Xata SDK to create/read/update/delete records follows the [repository pattern](https://lyz-code.github.io/blue-book/architecture/repository_pattern/). Each table will have a repository object available at `xata.db.[table-name]`. | ||
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. | ||
#### Creating Records | ||
Invoke the `create()` method in the repository. Example: | ||
```ts | ||
const user = await xata.db.users.create({ | ||
fullName: 'John Smith' | ||
}); | ||
``` | ||
If you want to create a record with a specific ID, you can provide the id as parameter to the `create()` method. | ||
```ts | ||
const user = await xata.db.users.create('user_admin', { | ||
fullName: 'John Smith' | ||
}); | ||
``` | ||
And if you want to create or update a record with a specific ID, you can invoke `createOrUpdate()` with an id parameter. | ||
```ts | ||
const user = await xata.db.users.createOrUpdate('user_admin', { | ||
fullName: 'John Smith' | ||
}); | ||
``` | ||
#### Query a Single Record by its ID | ||
```ts | ||
// `user` will be null if the record cannot be found | ||
const user = await xata.db.users.read('rec_1234abcdef'); | ||
``` | ||
#### Querying Multiple Records | ||
```ts | ||
// Query records selecting all fields. | ||
const page = await xata.db.users.select().getPaginated(); | ||
const user = await xata.db.users.select().getFirst(); | ||
// You can also use `xata.db.users` directly, since it's an immutable Query too! | ||
const page = await xata.db.users.getPaginated(); | ||
const user = await xata.db.users.getFirst(); | ||
// Query records selecting just one or more fields | ||
const page = await xata.db.users.select('email', 'profile').getPaginated(); | ||
// Apply constraints | ||
const page = await xata.db.users.filter('email', 'foo@example.com').getPaginated(); | ||
// Sorting | ||
const page = await xata.db.users.sort('full_name', 'asc').getPaginated(); | ||
``` | ||
Query operations (`select()`, `filter()`, `sort()`) return a `Query` object. These objects are immutable. You can add additional constraints, `sort`, etc. by calling their methods, and a new query will be returned. In order to finally make a query to the database you'll invoke `getPaginated()`, `getMany()`, `getAll()`, or `getFirst()`. | ||
To learn the differences between these methods, see the [reference](https://docs.xata.io/sdk/reference#query). | ||
```ts | ||
// Operators that combine multiple conditions can be deconstructed | ||
const { filter, any, all, not, sort } = xata.db.users; | ||
const query = filter('email', 'foo@example.com'); | ||
// Single-column operators are imported directly from the package | ||
import { gt, includes, startsWith } from '@xata.io/client'; | ||
filter('email', startsWith('username')).not(filter('created_at', gt(somePastDate))); | ||
// Queries are immutable objects. This is useful to derive queries from other queries | ||
const admins = filter('admin', true); | ||
const spaniardsAdmins = admins.filter('country', 'Spain'); | ||
await admins.getAll(); // still returns all admins | ||
// Finally fetch the results of the query | ||
const users = await query.getAll(); | ||
const firstUser = await query.getFirst(); | ||
``` | ||
The `getPaginated()` method will return a `Page` object. It's a wrapper that internally uses cursor based pagination. | ||
```ts | ||
page.records; // Array of records | ||
page.hasNextPage(); // Boolean | ||
const nextPage = await page.nextPage(); // Page object | ||
const previousPage = await page.previousPage(); // Page object | ||
const startPage = await page.startPage(); // Page object | ||
const endPage = await page.endPage(); // Page object | ||
``` | ||
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: | ||
```ts | ||
for await (const record of xata.db.users) { | ||
console.log(record); | ||
} | ||
for await (const record of xata.db.users.filter('team.id', teamId)) { | ||
console.log(record); | ||
} | ||
for await (const records of xata.db.users.getIterator({ batchSize: 100 })) { | ||
console.log(records); | ||
} | ||
``` | ||
#### Updating Records | ||
Updating a record leaves the existing object unchanged, but returns a new object with the updated values. | ||
```ts | ||
// Using an existing object | ||
const updatedUser = await user.update({ | ||
fullName: 'John Smith Jr.' | ||
}); | ||
// Using a record id | ||
const updatedUser = await xata.db.users.update('rec_1234abcdef', { | ||
fullName: 'John Smith Jr.' | ||
}); | ||
``` | ||
#### Deleting Records | ||
```ts | ||
// Using an existing object | ||
await user.delete(); | ||
// Using a record id | ||
await xata.db.users.delete('rec_1234abcdef'); | ||
``` | ||
### API Client | ||
One of the main features of the SDK is the ability to interact with the whole Xata API and perform administrative operations such as creating/reading/updating/deleting [workspaces](https://docs.xata.io/concepts/workspaces), databases, tables, branches... | ||
To communicate with the SDK we provide a constructor called `XataApiClient` that accepts an API token and an optional fetch implementation method. | ||
```ts | ||
const api = new XataApiClient({ apiKey: process.env.XATA_API_KEY }); | ||
``` | ||
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`...). | ||
```ts | ||
const { id: workspace } = await api.workspaces.createWorkspace({ name: 'example' }); | ||
const { databaseName } = await api.database.createDatabase(workspace, 'database', { region: 'eu-west-1' }); | ||
await api.branches.createBranch(workspace, databaseName, 'branch'); | ||
await api.tables.createTable(workspace, databaseName, 'branch', 'table'); | ||
await api.tables.setTableSchema(workspace, databaseName, 'branch', 'table', { | ||
columns: [{ name: 'email', type: 'string' }] | ||
}); | ||
const { id: recordId } = await api.records.insertRecord(workspace, databaseName, 'branch', 'table', { | ||
email: 'example@foo.bar' | ||
}); | ||
const record = await api.records.getRecord(workspace, databaseName, 'branch', 'table', recordId); | ||
await api.workspaces.deleteWorkspace(workspace); | ||
``` | ||
## Deno support | ||
We publish the client on [deno.land](https://deno.land/x/xata). You can use it by changing the import in the auto-generated `xata.ts` file: | ||
```ts | ||
import { buildClient, BaseClientOptions, XataRecord } from 'https://deno.land/x/xata/mod.ts'; | ||
``` | ||
You can find the SDK documentation [here](https://xata.io/docs/typescript-client/overview). |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2257788
22892
11
8