@xata.io/client 0.18.6 → 0.19.0

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 CHANGED
@@ -1,5 +1,23 @@
1
1
  # @xata.io/client
2
2
 
3
+ ## 0.19.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#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
8
+
9
+ - [#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
10
+
11
+ ### Patch Changes
12
+
13
+ - [#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
14
+
15
+ - [#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+
16
+
17
+ - [#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
18
+
19
+ - [#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
20
+
3
21
  ## 0.18.6
4
22
 
5
23
  ### Patch Changes
package/README.md CHANGED
@@ -112,18 +112,18 @@ 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 invoke `insert()`.
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.insert('user_admin', {
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 insert a record with a specific ID, you can invoke `updateOrInsert()`.
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 xata.db.users.updateOrInsert('user_admin', {
126
+ const user = await xata.db.users.createOrUpdate('user_admin', {
127
127
  fullName: 'John Smith'
128
128
  });
129
129
  ```
@@ -247,7 +247,7 @@ Once you have initialized the API client, the operations are organized following
247
247
 
248
248
  ```ts
249
249
  const { id: workspace } = await api.workspaces.createWorkspace({ name: 'example' });
250
- const { databaseName } = await api.databases.createDatabase(workspace, 'database');
250
+ const { databaseName } = await api.database.createDatabase(workspace, 'database', { region: 'eu-west-1' });
251
251
 
252
252
  await api.branches.createBranch(workspace, databaseName, 'branch');
253
253
  await api.tables.createTable(workspace, databaseName, 'branch', 'table');