add docs for db and redis

This commit is contained in:
Joel Wetzell
2026-03-21 11:12:06 -05:00
parent 23aa7d81e0
commit 24f2b45e07
8 changed files with 126 additions and 2 deletions
+20
View File
@@ -35,6 +35,11 @@ export default defineConfig({
collapsed: true, collapsed: true,
autogenerate: { directory: 'modules/time' } autogenerate: { directory: 'modules/time' }
}, },
{
label: "Database",
collapsed: true,
autogenerate: { directory: 'modules/db' }
},
{ {
label: "Network", label: "Network",
collapsed: true, collapsed: true,
@@ -60,6 +65,11 @@ export default defineConfig({
collapsed: true, collapsed: true,
autogenerate: { directory: 'modules/mqtt' } autogenerate: { directory: 'modules/mqtt' }
}, },
{
label: "Redis",
collapsed: true,
autogenerate: { directory: 'modules/redis' }
},
] ]
}, },
{ {
@@ -70,6 +80,11 @@ export default defineConfig({
collapsed: true, collapsed: true,
autogenerate: { directory: 'processors/router' } autogenerate: { directory: 'processors/router' }
}, },
{
label: "Database",
collapsed: true,
autogenerate: { directory: 'processors/db' }
},
{ {
label: "Filter", label: "Filter",
collapsed: true, collapsed: true,
@@ -111,6 +126,11 @@ export default defineConfig({
collapsed: true, collapsed: true,
autogenerate: { directory: 'processors/time' } autogenerate: { directory: 'processors/time' }
}, },
{
label: "Key/Value",
collapsed: true,
autogenerate: { directory: 'processors/kv' }
}
] ]
}, },
{ {
+21
View File
@@ -0,0 +1,21 @@
---
title: SQLite
sidebar:
order: 1
---
The `db.sqlite` module can open/create SQLite databases
- **type**: `db.sqlite`
- **params**:
- **dsn**: the data source name, this can be a file path or the special `:memory:` name for an in-memory DB
## Cap
### Example snippet
Opens an in-memory SQLite database
```
- id: db
type: db.sqlite
params:
dsn: ":memory:"
```
+1 -1
View File
@@ -9,7 +9,7 @@ import { Aside } from '@astrojs/starlight/components';
This module is not currently included in the pre-compiled binaries for [showbridge](https://github.com/jwetzell/showbridge-go/releases/latest) This module is not currently included in the pre-compiled binaries for [showbridge](https://github.com/jwetzell/showbridge-go/releases/latest)
</Aside> </Aside>
The `midi.output` module connects to a midi device (or virtual device) and allows sending MIDI messages out to that device. This module does not receive any message and so using it as an `input` to a [route](/concepts/routes) would be pointless. The `midi.output` module connects to a midi device (or virtual device) and allows sending MIDI messages out to that device. This module does not produce any messages and so using it as an `input` to a [route](/concepts/routes) would be pointless.
- **type**: `midi.output` - **type**: `midi.output`
- **params**: - **params**:
@@ -3,7 +3,7 @@ title: UDP Client
sidebar: sidebar:
order: 3 order: 3
--- ---
The `net.udp.client` module sends messages to a the configured `host` and `port`. This module does not receive any message and so using it as an `input` to a [route](/concepts/routes) would be pointless. The `net.udp.client` module sends messages to a the configured `host` and `port`. This module does not produce any messages and so using it as an `input` to a [route](/concepts/routes) would be pointless.
- **type**: `net.udp.client` - **type**: `net.udp.client`
- **params**: - **params**:
+22
View File
@@ -0,0 +1,22 @@
---
title: Redis Client
sidebar:
order: 1
---
The `redis.client` module connects to a Redis server. This module does not produce any messages and so using it as an `input` to a [route](/concepts/routes) would be pointless.
- **type**: `redis.client`
- **params**:
- **host**: the Redis server host
- **port**: the Redis server port
### Example
Connect to a Redis server running on `localhost` at port `6379`.
```
- id: redisClient
type: redis.client
params:
host: "localhost"
port: 6379
```
+19
View File
@@ -0,0 +1,19 @@
---
title: Query
sidebar:
order: 1
---
The `db.query` processor will issue a query to the specified module and return the result to the next processor in line.
- **type**: `db.query`
- **params**:
- **module**: the id of the [module](/concepts/modules) to issue query to.
- **query**: the query to execute.
### Example
Issue a `SELECT` statement to a module with id `sqlite`.
```
- type: db.query
params:
module: sqlite
query: "SELECT * from users;"
```
+20
View File
@@ -0,0 +1,20 @@
---
title: Get
sidebar:
order: 1
---
The `kv.get` processor gets the value associated with a key from a compatible module. The output payload is the value if the key is found.
- **type**: `kv.get`
- **params**:
- **module**: id of the module
- **key**: the key to look up
### Example
This will attempt to get the value for the `counter` key from the module with an id of `redis`
```
- type: kv.get
params:
module: redis
key: counter
```
+22
View File
@@ -0,0 +1,22 @@
---
title: Set
sidebar:
order: 2
---
The `kv.set` processor sets the value associated with a key from a compatible module. The payload is unchanged so whatever is received by this payload is output unless any errors are encountered.
- **type**: `kv.set`
- **params**:
- **module**: id of the module
- **key**: the key to look up
- **value**: the value to set
### Example
This will attempt to set the key `hello` to `world` using the module with an id of `redis`
```
- type: kv.set
params:
module: redis
key: hello
value: world
```