Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: --experimental-use-server-side-upsert document #983

Merged
merged 8 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/cli/record/import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const builder = (args: yargs.Argv) =>
type: "string",
requiresArg: true,
})
.option("use-server-side-upsert", {
.option("experimental-use-server-side-upsert", {
describe:
"Use server-side upsert. This option is under early development.",
type: "boolean",
Expand All @@ -71,7 +71,7 @@ const handler = (args: Args) => {
filePath: args["file-path"],
updateKey: args["update-key"],
fields: args.fields?.split(","),
useServerSideUpsert: args["use-server-side-upsert"],
useServerSideUpsert: args["experimental-use-server-side-upsert"],
encoding: args.encoding,
pfxFilePath: args["pfx-file-path"],
pfxFilePassword: args["pfx-file-password"],
Expand Down
32 changes: 32 additions & 0 deletions website/blog/2025-01-16-cli-kintone-v1-13-0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
slug: cli-kintone-v1-13-0
title: cli-kintone v1.13.0
authors: [chihiro-adachi, extensions-platform-team]
tags: [release]
---

We are happy to announce the release of **cli-kintone v1.13.0** 🎉

## What's new?

### The `--experimental-use-server-side-upsert` option is now available with the record import command (Experimental)

We have implemented the `--experimental-use-server-side-upsert` option, which executes the record import command using [the upsert option of the bulk record update API](https://cybozu.dev/ja/kintone/docs/rest-api/records/update-records/)

Previously, cli-kintone has been running with its own upsert mode, but by using `--experimental-use-server-side-upsert`, there is a possibility that the performance of the record import command will improve.

Specify as follows.

```
$ cli-kintone record import --base-url http://localhost --app xxx \
--api-token xxx \
--file-path import.csv \
--update-key レコード番号 \
--experimental-use-server-side-upsert
```

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

安定性が確認できたらデフォルトオンにする予定というのも書いておいて良さそうです。

Copy link
Contributor Author

@chihiro-adachi chihiro-adachi Jan 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tasshi-me
ありがとうございますー
一文追加しました。
855f943

We plan to enable this option by default once we have confirmed its stability.

## Miscellaneous

See the [changelog](https://github.com/kintone/cli-kintone/blob/main/CHANGELOG.md#1130-2025-01-16) for an exhaustive list of changes.
29 changes: 21 additions & 8 deletions website/docs/guide/commands/record-import.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@ cli-kintone record import \

See [Options](/guide/options) page for common options.

| Option | Required | Description |
| ------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--app` | Yes | The ID of the app |
| `--attachments-dir` | | Attachment file directory |
| `--file-path` | Yes | The path to the source file.<br/>The file extension should be ".csv" |
| `--encoding ` | | Character encoding<br/>Default to `utf8`<br/>Encodings: `utf8` and `sjis` |
| `--update-key` | | The key to Bulk Update<br/>When this option is set, cli-kintone will be in the UPSERT mode.<br/>See [Upsert records](#upsert-records) section for more details. |
| `--fields ` | | The fields to be imported in comma-separated |
| Option | Required | Description |
| ----------------------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--app` | Yes | The ID of the app |
| `--attachments-dir` | | Attachment file directory |
| `--file-path` | Yes | The path to the source file.<br/>The file extension should be ".csv" |
| `--encoding ` | | Character encoding<br/>Default to `utf8`<br/>Encodings: `utf8` and `sjis` |
| `--update-key` | | The key to Bulk Update<br/>When this option is set, cli-kintone will be in the UPSERT mode.<br/>See [Upsert records](#upsert-records) section for more details. |
| `--fields ` | | The fields to be imported in comma-separated |
| `--experimental-use-server-side-upsert ` | | Execute upsert using the upsert option of the bulk record update API.<br/>See [Using server side upsert](#using-server-side-upsert) section for more details. |

:::note
A field within a Table cannot be specified to the `fields` option.
Expand Down Expand Up @@ -67,3 +68,15 @@ The field specified as "Key to Bulk Update" must meet one of the following requi
- Created datetime
- Updated by
- Updated datetime

### Using server side upsert

:::experimental

This feature is under early development.

:::

If you specify the `--experimental-use-server-side-upsert` option, upsert will be executed using [the upsert option of the bulk record update API](https://cybozu.dev/ja/kintone/docs/rest-api/records/update-records/).

Using this option may improve import performance.
Loading