From 19b3286d1db7df47c22c4d99857520a0324cb021 Mon Sep 17 00:00:00 2001 From: josh-wong Date: Tue, 4 Nov 2025 01:52:49 +0000 Subject: [PATCH 1/2] AUTO: Sync ScalarDL docs in English to docs site repo --- docs/scalardl-hashstore-command-reference.mdx | 315 ++++++++++++++++++ .../scalardl-tablestore-command-reference.mdx | 114 +++++++ 2 files changed, 429 insertions(+) create mode 100644 docs/scalardl-hashstore-command-reference.mdx create mode 100644 docs/scalardl-tablestore-command-reference.mdx diff --git a/docs/scalardl-hashstore-command-reference.mdx b/docs/scalardl-hashstore-command-reference.mdx new file mode 100644 index 00000000..dec7599d --- /dev/null +++ b/docs/scalardl-hashstore-command-reference.mdx @@ -0,0 +1,315 @@ +--- +tags: + - Community + - Enterprise +displayed_sidebar: docsEnglish +--- + +# ScalarDL HashStore Command Reference + +This page introduces `scalardl-hashstore`, which is a client command for interacting with ScalarDL HashStore. + +## Overview of commands + +- **Bootstrap HashStore** + - [`bootstrap`](#bootstrap): Bootstrap by registering identity and predefined contracts required to use HashStore. +- **Manage objects** + - [`get-object`](#get-object): Get an object from HashStore. + - [`put-object`](#put-object): Put an object to HashStore. + - [`compare-object-versions`](#compare-object-versions): Compare object versions. +- **Manage collections** + - [`create-collection`](#create-collection): Create a new collection. + - [`get-collection`](#get-collection): Get a collection from HashStore. + - [`add-to-collection`](#add-to-collection): Add objects to a collection. + - [`remove-from-collection`](#remove-from-collection): Remove objects from a collection. + - [`get-collection-history`](#get-collection-history): Get the history of a collection. +- **Validate the ledger** + - [`validate-ledger`](#validate-ledger): Validate a specified object or collection in HashStore. + +## `bootstrap` + +Bootstrap by registering identity and predefined contracts required to use HashStore. + +### Options + +| Option | Description | +|:---------------------------|:-------------------------------------------| +| `--config`, `--properties` | A configuration file in the .properties format. | + +[Common utility options](#common-utility-options) are also available. + +### Examples + +```console +scalardl-hashstore bootstrap --properties client.properties +``` + +## `get-object` + +Get an object from HashStore. + +### Options + +| Option | Description | +|:---------------------------|:-------------------------------------------| +| `--config`, `--properties` | A configuration file in the .properties format. | +| `--object-id` | The ID of the object to retrieve. | + +[Common utility options](#common-utility-options) are also available. + +### Examples + +```console +scalardl-hashstore get-object --properties client.properties --object-id foo +``` + +## `put-object` + +Put an object to HashStore. + +### Options + +| Option | Description | +|:---------------------------|:------------------------------------------------------------| +| `--config`, `--properties` | A configuration file in the .properties format. | +| `--object-id` | The ID of the object to store. | +| `--hash` | The hash value of the object. | +| `--metadata` | Optional metadata as a JSON string. | +| `--put-to-mutable` | Optional Put operation for a mutable database as a JSON string. | + +[Common utility options](#common-utility-options) are also available. + +### Examples + +Put an object with a hash value. + +```console +scalardl-hashstore put-object --properties client.properties --object-id foo --hash b97a42c87a46ffebe1439f8c1cd2f86e2f9b84dad89c8e9ebb257a19b6fdfe1c +``` + +Put an object with metadata. + +```console +scalardl-hashstore put-object --properties client.properties --object-id foo --hash b97a42c87a46ffebe1439f8c1cd2f86e2f9b84dad89c8e9ebb257a19b6fdfe1c --metadata '{"note": "updated"}' +``` + +## `compare-object-versions` + +Compare object versions. + +### Options + +| Option | Description | +|:---------------------------|:--------------------------------------------------------------| +| `--config`, `--properties` | A configuration file in the .properties format. | +| `--object-id` | The ID of the object to compare versions. | +| `--versions` | Object versions to compare as a JSON array. | +| `--all` | Compare all versions including stored versions in the ledger. | +| `--verbose` | Show detailed validation information. | + +[Common utility options](#common-utility-options) are also available. + +### Examples + +Compare the latest versions specified in the arguments. + +```console +scalardl-hashstore compare-object-versions --properties client.properties --object-id foo --versions '[{"version_id": "v1", "hash_value": "hash1"}, {"version_id": "v2", "hash_value": "hash2", "metadata": {"note": "updated"}}]' +``` + +Compare all versions stored in HashStore. + +```console +scalardl-hashstore compare-object-versions --properties client.properties --object-id foo --versions '[{"version_id": "v1", "hash_value": "hash1"}, {"version_id": "v2", "hash_value": "hash2", "metadata": {"note": "updated"}}]' --all +``` + +Compare with the verbose output. + +```console +scalardl-hashstore compare-object-versions --properties client.properties --object-id foo --versions '[{"version_id": "v1", "hash_value": "hash1"}]' --verbose +``` + +## `create-collection` + +Create a new collection. + +### Options + +| Option | Description | +|:---------------------------|:-------------------------------------------| +| `--config`, `--properties` | A configuration file in the .properties format. | +| `--collection-id` | The ID of the collection to create. | +| `--object-ids` | Object IDs to include in the collection. | + +[Common utility options](#common-utility-options) are also available. + +### Examples + +Create an empty collection. + +```console +scalardl-hashstore create-collection --properties client.properties --collection-id audit_set +``` + +Create a collection with initial objects. + +```console +scalardl-hashstore create-collection --properties client.properties --collection-id audit_set --object-ids object1 --object-ids object2 +``` + +## `get-collection` + +Get a collection from HashStore. + +### Options + +| Option | Description | +|:---------------------------|:-------------------------------------------| +| `--config`, `--properties` | A configuration file in the .properties format. | +| `--collection-id` | The ID of the collection to retrieve. | + +[Common utility options](#common-utility-options) are also available. + +### Examples + +```console +scalardl-hashstore get-collection --properties client.properties --collection-id audit_set +``` + +## `add-to-collection` + +Add objects to a collection. + +### Options + +| Option | Description | +|:---------------------------|:--------------------------------------------------------------------| +| `--config`, `--properties` | A configuration file in the .properties format. | +| `--collection-id` | The ID of the collection. | +| `--object-ids` | Object IDs to add to the collection. | +| `--force` | Skip validation for duplicate object IDs already in the collection. | + +[Common utility options](#common-utility-options) are also available. + +### Examples + +Add objects to a collection. + +```console +scalardl-hashstore add-to-collection --properties client.properties --collection-id audit_set --object-ids object3 --object-ids object4 +``` + +Add an object with the force flag. + +```console +scalardl-hashstore add-to-collection --properties client.properties --collection-id audit_set --object-ids object3 --force +``` + +## `remove-from-collection` + +Remove objects from a collection. + +### Options + +| Option | Description | +|:---------------------------|:---------------------------------------------------------------| +| `--config`, `--properties` | A configuration file in the .properties format. | +| `--collection-id` | The ID of the collection. | +| `--object-ids` | Object IDs to remove from the collection. | +| `--force` | Skip validation for object IDs that are not in the collection. | + +[Common utility options](#common-utility-options) are also available. + +### Examples + +Remove objects from a collection. + +```console +scalardl-hashstore remove-from-collection --properties client.properties --collection-id audit_set --object-ids object1 --object-ids object2 +``` + +Remove an object with the force flag. + +```console +scalardl-hashstore remove-from-collection --properties client.properties --collection-id audit_set --object-ids object1 --force +``` + +## `get-collection-history` + +Get the history of a collection. + +### Options + +| Option | Description | +|:---------------------------|:----------------------------------------------------| +| `--config`, `--properties` | A configuration file in the .properties format. | +| `--collection-id` | The ID of the collection. | +| `--limit` | Maximum number of recent history entries to return. | + +[Common utility options](#common-utility-options) are also available. + +### Examples + +Get all histories of a collection. + +```console +scalardl-hashstore get-collection-history --properties client.properties --collection-id audit_set +``` + +Get the limited history of a collection. + +```console +scalardl-hashstore get-collection-history --properties client.properties --collection-id audit_set --limit 10 +``` + +## `validate-ledger` + +Validate a specified object or collection in HashStore. + +### Options + +| Option | Description | +|:---------------------------|:-------------------------------------------| +| `--config`, `--properties` | A configuration file in the .properties format. | +| `--object-id` | The ID of the object to validate. | +| `--collection-id` | The ID of the collection to validate. | +| `--start-age` | The start age for validation range. | +| `--end-age` | The end age for validation range. | + +[Common utility options](#common-utility-options) are also available. + +### Examples + +Validate an object for all ages. + +```console +scalardl-hashstore validate-ledger --properties client.properties --object-id foo +``` + +Validate an object from age 0 to age 10 only. + +```console +scalardl-hashstore validate-ledger --properties client.properties --object-id foo --start-age 0 --end-age 10 +``` + +Validate a collection for all ages. + +```console +scalardl-hashstore validate-ledger --properties client.properties --collection-id audit_set +``` + +Validate a collection from age 0 to age 5 only. + +```console +scalardl-hashstore validate-ledger --properties client.properties --collection-id audit_set --start-age 0 --end-age 5 +``` + +## Common utility options + +You can use the following options in all the commands above. + +| Option | Description | +|:----------------------|:--------------------------------------------| +| `-g`, `--use-gateway` | A flag to use the gateway. | +| `-h`, `--help` | Display the help message of a command. | +| `--stacktrace` | Output the Java stack trace to the `stderr` stream. | \ No newline at end of file diff --git a/docs/scalardl-tablestore-command-reference.mdx b/docs/scalardl-tablestore-command-reference.mdx new file mode 100644 index 00000000..aef99fdc --- /dev/null +++ b/docs/scalardl-tablestore-command-reference.mdx @@ -0,0 +1,114 @@ +--- +tags: + - Community + - Enterprise +displayed_sidebar: docsEnglish +--- + +# ScalarDL TableStore Command Reference + +This page introduces `scalardl-tablestore`, which is a client command for interacting with ScalarDL TableStore. + +## Overview of commands + +- **Bootstrap TableStore** + - [`bootstrap`](#bootstrap): Bootstrap by registering identity and predefined contracts required to use TableStore. +- **Execute a statement** + - [`execute-statement`](#execute-statement): Execute a specified statement. +- **Validate the ledger** + - [`validate-ledger`](#validate-ledger): Validate a specified record, index record, or table schema in TableStore. + +## `bootstrap` + +Bootstrap by registering identity and predefined contracts required to use TableStore. + +### Options + +| Option | Description | +|:---------------------------|:-------------------------------------------| +| `--config`, `--properties` | A configuration file in the .properties format. | + +[Common utility options](#common-utility-options) are also available. + +### Examples + +```console +scalardl-tablestore bootstrap --properties client.properties +``` + +## `execute-statement` + +Execute a specified statement. + +### Options + +| Option | Description | +|:---------------------------|:-------------------------------------------| +| `--config`, `--properties` | A configuration file in the .properties format. | +| `--statement` | A statement to interact with TableStore. | + +[Common utility options](#common-utility-options) are also available. + +### Examples + +Execute a statement. + +```console +scalardl-tablestore execute-statement --properties client.properties --statement "SELECT * FROM employee WHERE id = '1001'" +``` + +For details about the grammar of SQL statements, see [ScalarDL TableStore SQL Grammar](sql-grammar.mdx). + +## `validate-ledger` + +Validate a specified record, index record or table schema in TableStore. + +### Options + +| Option | Description | +|:--------------------------------|:-----------------------------------------------------------------------| +| `--config`, `--properties` | A configuration file in the .properties format. | +| `--table-name` | The name of the table. | +| `--primary-key-column-name` | The primary key column name of the record. | +| `--index-key-column-name` | The index key column name of the record. | +| `--column-value` | The column value of the primary key or the index key as a JSON string. | +| `--start-age` | The start age for the validation range. | +| `--end-age` | The end age for the validation range. | + +[Common utility options](#common-utility-options) are also available. + +### Examples + +Validate a record with primary key for all ages. + +```console +scalardl-tablestore validate-ledger --properties client.properties --table-name employee --primary-key-column-name id --column-value '"1001"' +``` + +Validate a record with primary key from age 0 to age 10 only. + +```console +scalardl-tablestore validate-ledger --properties client.properties --table-name employee --primary-key-column-name id --column-value '"1001"' --start-age 0 --end-age 10 +``` + +Validate an index record. + +```console +scalardl-tablestore validate-ledger --properties client.properties --table-name employee --index-key-column-name department --column-value '"sales"' +``` + +Validate a table schema. + +```console +scalardl-tablestore validate-ledger --properties client.properties --table-name employee +``` + +## Common utility options + +You can use the following options in all the commands above. + +| Option | Description | +|:----------------------|:--------------------------------------------| +| `-g`, `--use-gateway` | A flag to use the gateway. | +| `-h`, `--help` | Display the help message of a command. | +| `--stacktrace` | Output the Java stack trace to the `stderr` stream. | \ No newline at end of file From bb3ade2882d03f4f18205599afdc08c7accc1c3d Mon Sep 17 00:00:00 2001 From: Josh Wong <23216828+josh-wong@users.noreply.github.com> Date: Tue, 4 Nov 2025 11:20:06 +0900 Subject: [PATCH 2/2] Add HashStore and TableStore command reference docs --- sidebars.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/sidebars.js b/sidebars.js index 7c71f652..03e27669 100644 --- a/sidebars.js +++ b/sidebars.js @@ -226,6 +226,16 @@ const sidebars = { id: 'scalardl-command-reference', label: 'Client Commands', }, + { + type: 'doc', + id: 'scalardl-hashstore-command-reference', + label: 'Hashstore Commands', + }, + { + type: 'doc', + id: 'scalardl-tablestore-command-reference', + label: 'TableStore Commands', + }, { type: 'doc', id: 'schema-loader', @@ -831,6 +841,16 @@ const sidebars = { id: 'scalardl-command-reference', label: 'クライアントコマンドリファレンス', }, + // { + // type: 'doc', + // id: 'scalardl-hashstore-command-reference', + // label: 'Hashstore コマンドリファレンス', + // }, + // { + // type: 'doc', + // id: 'scalardl-tablestore-command-reference', + // label: 'TableStore コマンドリファレンス', + // }, { type: 'doc', id: 'schema-loader',