Skip to content

Commit 9b475d6

Browse files
committed
AUTO: Sync ScalarDB docs in Japanese to docs site repo
1 parent 98b4004 commit 9b475d6

File tree

2 files changed

+90
-0
lines changed

2 files changed

+90
-0
lines changed

i18n/versioned_docs/ja-jp/docusaurus-plugin-content-docs/current/api-guide.mdx

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,6 +1171,84 @@ Scan scanUsingSpecifiedNamespace =
11711171
.build();
11721172
```
11731173

1174+
##### オペレーション属性
1175+
1176+
オペレーション属性は、オペレーションに関する追加情報を保持するためのキーと値のペアです。以下のように、オペレーションビルダーの`attribute()`メソッドや`attributes()`メソッドを使って設定できます。
1177+
1178+
```java
1179+
// Set operation attributes in the `Get` operation.
1180+
Get get = Get.newBuilder()
1181+
.namespace("ns")
1182+
.table("tbl")
1183+
.partitionKey(partitionKey)
1184+
.clusteringKey(clusteringKey)
1185+
.attribute("attribute1", "value1")
1186+
.attributes(ImmutableMap.of("attribute2", "value2", "attribute3", "value3"))
1187+
.build();
1188+
1189+
// Set operation attributes in the `Scan` operation.
1190+
Scan scan = Scan.newBuilder()
1191+
.namespace("ns")
1192+
.table("tbl")
1193+
.partitionKey(partitionKey)
1194+
.projections("c1", "c2", "c3", "c4")
1195+
.attribute("attribute1", "value1")
1196+
.attributes(ImmutableMap.of("attribute2", "value2", "attribute3", "value3"))
1197+
.build();
1198+
1199+
// Set operation attributes in the `Insert` operation.
1200+
Insert insert = Insert.newBuilder()
1201+
.namespace("ns")
1202+
.table("tbl")
1203+
.partitionKey(partitionKey)
1204+
.clusteringKey(clusteringKey)
1205+
.floatValue("c4", 1.23F)
1206+
.doubleValue("c5", 4.56)
1207+
.attribute("attribute1", "value1")
1208+
.attributes(ImmutableMap.of("attribute2", "value2", "attribute3", "value3"))
1209+
.build();
1210+
1211+
// Set operation attributes in the `Upsert` operation.
1212+
Upsert upsert = Upsert.newBuilder()
1213+
.namespace("ns")
1214+
.table("tbl")
1215+
.partitionKey(partitionKey)
1216+
.clusteringKey(clusteringKey)
1217+
.floatValue("c4", 1.23F)
1218+
.doubleValue("c5", 4.56)
1219+
.attribute("attribute1", "value1")
1220+
.attributes(ImmutableMap.of("attribute2", "value2", "attribute3", "value3"))
1221+
.build();
1222+
1223+
// Set operation attributes in the `Update` operation.
1224+
Update update = Update.newBuilder()
1225+
.namespace("ns")
1226+
.table("tbl")
1227+
.partitionKey(partitionKey)
1228+
.clusteringKey(clusteringKey)
1229+
.floatValue("c4", 1.23F)
1230+
.doubleValue("c5", 4.56)
1231+
.attribute("attribute1", "value1")
1232+
.attributes(ImmutableMap.of("attribute2", "value2", "attribute3", "value3"))
1233+
.build();
1234+
1235+
// Set operation attributes in the `Delete` operation.
1236+
Delete delete = Delete.newBuilder()
1237+
.namespace("ns")
1238+
.table("tbl")
1239+
.partitionKey(partitionKey)
1240+
.clusteringKey(clusteringKey)
1241+
.attribute("attribute1", "value1")
1242+
.attributes(ImmutableMap.of("attribute2", "value2", "attribute3", "value3"))
1243+
.build();
1244+
```
1245+
1246+
:::note
1247+
1248+
ScalarDB では現在、利用可能なオペレーション属性はありません。
1249+
1250+
:::
1251+
11741252
#### トランザクションをコミットする
11751253

11761254
CRUD 操作を実行した後、トランザクションをコミットして終了する必要があります。

i18n/versioned_docs/ja-jp/docusaurus-plugin-content-docs/current/scalardb-sql/grammar.mdx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -606,6 +606,7 @@ SELECT projection [, projection] ...
606606
[WHERE and_predicates [OR and_predicates ...] | or_predicates [AND or_predicates ...]]
607607
[ORDER BY identifier [order] [, identifier [order]] ...]
608608
[LIMIT <limit>]
609+
[WITH operation_attributes]
609610

610611
projection: * | identifier [AS <alias>]
611612
join_specification: [INNER] JOIN [<namespace name>.]<table name> [AS <alias>] ON join_predicate [AND join_predicate] ... | {LEFT|RIGHT} [OUTER] JOIN [<namespace name>.]<table name> [AS <alias>] ON join_predicate [AND join_predicate] ...
@@ -616,6 +617,7 @@ predicate: identifier operator <literal> | identifier BETWEEN <literal> AND <lit
616617
identifier: [[<namespace name>.]<table name>.]<column name> | [alias.]<column name>
617618
operator: = | <> | != | > | >= | < | <=
618619
order: ASC | DESC
620+
operation_attributes: <operation attribute name>=<operation attribute value> [AND <operation attribute name>=<operation attribute value>] ...
619621
```
620622

621623
##### 注記
@@ -1087,6 +1089,9 @@ SelectStatement statement13 =
10871089
```sql
10881090
INSERT INTO [<namespace name>.]<table name> [(<column name> [, <column name>] ...)]
10891091
VALUES (<literal> [, <literal>] ...) [, (<literal> [, <literal>] ...)] ...
1092+
[WITH operation_attributes]
1093+
1094+
operation_attributes: <operation attribute name>=<operation attribute value> [AND <operation attribute name>=<operation attribute value>] ...
10901095
```
10911096

10921097
- `INSERT` では完全な主キーを指定する必要があります。
@@ -1157,6 +1162,9 @@ InsertStatement statement4 = StatementBuilder.insertInto("ns", "tbl")
11571162
```sql
11581163
UPSERT INTO [<namespace name>.]<table name> [(<column name> [, <column name>] ...)]
11591164
VALUES (<literal> [, <literal>] ...) [, (<literal> [, <literal>] ...)] ...
1165+
[WITH operation_attributes]
1166+
1167+
operation_attributes: <operation attribute name>=<operation attribute value> [AND <operation attribute name>=<operation attribute value>] ...
11601168
```
11611169

11621170
- `INSERT` では完全な主キーを指定する必要があります。
@@ -1236,12 +1244,14 @@ UpsertStatement statement4 = StatementBuilder.upsertInto("ns", "tbl")
12361244
UPDATE [<namespace name>.]<table name> [AS <alias>]
12371245
SET <column identifier> = <literal> [, <column identifier> = <literal>] ...
12381246
[WHERE and_predicates [OR and_predicates ...] | or_predicates [AND or_predicates ...]]
1247+
[WITH operation_attributes]
12391248

12401249
identifier: [[<namespace name>.]<table name>.]<column name> | [alias.]<column name>
12411250
and_predicates: predicate | (predicate [AND predicate ...])
12421251
or_predicates: predicate | (predicate [OR predicate ...])
12431252
predicate: <identifier> operator <literal> | <identifier> BETWEEN <literal> AND <literal> | <identifier> [NOT] LIKE <pattern> [ESCAPE <escape character>] | <identifier> IS [NOT] NULL
12441253
operator: = | <> | != | > | >= | < | <=
1254+
operation_attributes: <operation attribute name>=<operation attribute value> [AND <operation attribute name>=<operation attribute value>] ...
12451255
```
12461256

12471257
##### 注記
@@ -1463,12 +1473,14 @@ UpdateStatement statement9 =
14631473
```sql
14641474
DELETE FROM [<namespace name>.]<table name> [AS <alias>]
14651475
[WHERE and_predicates [OR and_predicates ...] | or_predicates [AND or_predicates ...]]
1476+
[WITH operation_attributes]
14661477

14671478
identifier: [[<namespace name>.]<table name>.]<column name> | [alias.]<column name>
14681479
and_predicates: predicate | (predicate [AND predicate ...])
14691480
or_predicates: predicate | (predicate [OR predicate ...])
14701481
predicate: <identifier> operator <literal> | <identifier> BETWEEN <literal> AND <literal> | <identifier> [NOT] LIKE <pattern> [ESCAPE <escape character>] | <identifier> IS [NOT] NULL
14711482
operator: = | <> | != | > | >= | < | <=
1483+
operation_attributes: <operation attribute name>=<operation attribute value> [AND <operation attribute name>=<operation attribute value>] ...
14721484
```
14731485

14741486
##### 注記

0 commit comments

Comments
 (0)