diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index a9c1b31d6..f7dff5a93 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -1,9 +1,9 @@ -DiceDB welcomes your contributions! Whether you're fixing bugs, adding new features, or improving the documentation, your help is valuable. +DiceDB welcomes your contributions! Whether you're fixing bugs, adding new features, or improving the documentation, your help is valuable. To maintain the project's quality and consistency, please follow these guidelines: -- Keep the code consistent: Use the same coding style and conventions throughout the project. -- Keep the git repository consistent: Follow proper git practices to avoid conflicts and ensure a clean history. +- Keep the code consistent: Use the same coding style and conventions throughout the project. +- Keep the git repository consistent: Follow proper git practices to avoid conflicts and ensure a clean history. # Contribution Guidelines diff --git a/docs/astro.config.mjs b/docs/astro.config.mjs index 4862694d9..92f70c968 100644 --- a/docs/astro.config.mjs +++ b/docs/astro.config.mjs @@ -26,7 +26,7 @@ export default defineConfig({ // }, { label: "SDK", - autogenerate: { directory: "sdk" }, + autogenerate: { directory: "sdk" }, }, { label: "Connection Protocols", diff --git a/docs/command_docs_template.md b/docs/command_docs_template.md index d370ee71c..20a7ecf06 100644 --- a/docs/command_docs_template.md +++ b/docs/command_docs_template.md @@ -2,6 +2,7 @@ title: description: description here in 2 to 3 lines --- + @@ -15,58 +16,67 @@ description: description here in 2 to 3 lines ## Parameters - -| Parameter | Description | Type | Required | -|-----------|---------------------------------------------------------------------------|---------|----------| -| | | | | -| | | | | -| | | | | + +| Parameter | Description | Type | Required | +| --------- | ----------- | ---- | -------- | +| | | | | +| | | | | +| | | | | ## Return values + -| Condition | Return Value | -|------------------------------------------------|---------------------------------------------------| -| | | -| | | -| | | +| Condition | Return Value | +| --------- | ------------ | +| | | +| | | +| | | ## Behaviour + + - Bullet 1 - Bullet 2 - Bullet 3 ## Errors + + 1. `Wrong type of value or key`: - Error Message: `(error) WRONGTYPE Operation against a key holding the wrong kind of value` - Occurs when attempting to use the command on a key that contains a non-string value. - ## Example Usage + + ### Basic Usage + ```bash 127.0.0.1:7379> SET foo bar OK ``` + + ### Invalid usage ```bash @@ -81,20 +91,25 @@ OK + ## Best Practices + ## Alternatives -## Notes +## Notes + ## Subcommands + + - **subcommand**: Optional. Available subcommands include: - `subcommand1` : some description of the subcommand. diff --git a/docs/sample_command_docs.md b/docs/sample_command_docs.md index 3fc5d9ecc..bf0c692d9 100644 --- a/docs/sample_command_docs.md +++ b/docs/sample_command_docs.md @@ -2,7 +2,9 @@ title: SET description: The `SET` command in DiceDB is used to set the value of a key. If the key already holds a value, it is overwritten, regardless of its type. This is one of the most fundamental operations in DiceDB as it allows for both creating and updating key-value pairs. --- + + The `SET` command in DiceDB is used to set the value of a key. If the key already holds a value, it is overwritten, regardless of its type. This is one of the most fundamental operations in DiceDB as it allows for both creating and updating key-value pairs. ## Syntax @@ -10,13 +12,16 @@ The `SET` command in DiceDB is used to set the value of a key. If the key alread ```bash SET key value [EX seconds | PX milliseconds | EXAT unix-time-seconds | PXAT unix-time-milliseconds | KEEPTTL] [NX | XX] ``` + ## Parameters + + | Parameter | Description | Type | Required | -|-----------|---------------------------------------------------------------------------|---------|----------| +| --------- | ------------------------------------------------------------------------- | ------- | -------- | | `key` | The name of the key to be set. | String | Yes | | `value` | The value to be set for the key. | String | Yes | | `EX` | Set the specified expire time, in seconds. | Integer | No | @@ -28,18 +33,21 @@ SET key value [EX seconds | PX milliseconds | EXAT unix-time-seconds | PXAT unix | `KEEPTTL` | Retain the time-to-live associated with the key. | None | No | ## Return values + -| Condition | Return Value | -|------------------------------------------------|---------------------------------------------------| -| if key is set successfully | `OK` | -| If `NX` is used and key already exists | `nil` | -| If `XX` is used and key doesn't exist | `nil` | +| Condition | Return Value | +| -------------------------------------- | ------------ | +| if key is set successfully | `OK` | +| If `NX` is used and key already exists | `nil` | +| If `XX` is used and key doesn't exist | `nil` | ## Behaviour + + - If the specified key already exists, the `SET` command will overwrite the existing key-value pair with the new value unless the `NX` option is provided. - If the `NX` option is present, the command will set the key only if it does not already exist. If the key exists, no operation is performed and `nil` is returned. - If the `XX` option is present, the command will set the key only if it already exists. If the key does not exist, no operation is performed and `nil` is returned. @@ -47,8 +55,8 @@ SET key value [EX seconds | PX milliseconds | EXAT unix-time-seconds | PXAT unix - When provided, `EX` sets the expiry time in seconds and `PX` sets the expiry time in milliseconds. - The `KEEPTTL` option ensures that the key's existing TTL is retained. - ## Errors + @@ -71,6 +79,7 @@ SET key value [EX seconds | PX milliseconds | EXAT unix-time-seconds | PXAT unix ## Example Usage ### Basic Usage + Setting a key `foo` with the value `bar` @@ -79,7 +88,9 @@ Setting a key `foo` with the value `bar` 127.0.0.1:7379> SET foo bar OK ``` + + ### Using expiration time (in seconds) Setting a key `foo` with the value `bar` to expire in 10 seconds @@ -141,6 +152,7 @@ Trying to set key `foo` with both `EX` and `KEEPTTL` will result in an error 127.0.0.1:7379> SET foo bar EX 10 KEEPTTL (error) ERR syntax error ``` + @@ -148,29 +160,41 @@ Trying to set key `foo` with both `EX` and `KEEPTTL` will result in an error + ## Best Practices + + - `Avoid in Production`: Due to its potential to slow down the server, avoid using the `KEYS` command in a production environment. Instead, consider using the `SCAN` command, which is more efficient for large keyspaces. - `Use Specific Patterns`: When using the `KEYS` command, try to use the most specific pattern possible to minimize the number of keys returned and reduce the load on the server. + ## Alternatives + + - `SCAN`: The `SCAN` command is a cursor-based iterator that allows you to incrementally iterate over the keyspace without blocking the server. It is a more efficient alternative to `KEYS` for large datasets. + ## Notes + + - JSONPath expressions allow you to navigate and retrieve specific parts of a JSON document. Ensure that your JSONPath expressions are correctly formatted to avoid errors. By understanding the `JSON.GET` command, you can efficiently retrieve JSON data stored in your DiceDB database, enabling you to build powerful and flexible applications that leverage the capabilities of DiceDB. + ## Subcommands + + - **subcommand**: Optional. Available subcommands include: - `COUNT` : Returns the total number of commands in the DiceDB server. - `GETKEYS` : Returns the keys from the provided command and arguments. diff --git a/docs/src/components/Footer.astro b/docs/src/components/Footer.astro index d6d612aef..64e6565aa 100644 --- a/docs/src/components/Footer.astro +++ b/docs/src/components/Footer.astro @@ -50,10 +50,7 @@ import { Github } from "lucide-astro"; Commands

- + Examples

@@ -69,10 +66,7 @@ import { Github } from "lucide-astro"; Examples

- + Real-time Leaderboard

@@ -88,9 +82,7 @@ import { Github } from "lucide-astro"; About Us

-->

- - Contact Us + Contact Us


diff --git a/docs/src/components/Hero.astro b/docs/src/components/Hero.astro index de14d026e..5f12163bc 100644 --- a/docs/src/components/Hero.astro +++ b/docs/src/components/Hero.astro @@ -4,31 +4,25 @@ import Dice from "./Dice.astro"; import site from "../data/site.json"; --- -

-
-
-
- - We shipped DiceDB v0.0.4 - - -
- DiceDB Logo -
-
-

Build truly real-time applications

-

- DiceDB is an in-memory, real-time, and reactive database with Redis and SQL support optimized for modern hardware and building real-time applications. +

+
+
+
+

a super cache;

+

+ DiceDB is a redis-compliant, scalable, highly available, unified cache + optimized for modern hardware + *

-
- +

+ docker run -p 7379:7379 dicedb/dicedb +

+
-

- Want to evaluate and adopt DiceDB at your org? - block our calendar. +

+ * DiceDB is a work in progress; track + roadmap and follow along.

-
-
-
- -
diff --git a/docs/src/components/Nav.astro b/docs/src/components/Nav.astro index ade34a2f5..38f5a671e 100644 --- a/docs/src/components/Nav.astro +++ b/docs/src/components/Nav.astro @@ -36,19 +36,19 @@ import SocialHandlesIcons from "./SocialHandlesIcons.astro"; class={`navbar-item ${currentPage === "benchmarks" && "is-active"}`} href="/benchmarks" > - Benchmarks + Benchmarks - Docs + Docs - Blog + Blog