mirror of
https://github.com/jwetzell/showbridge-go.git
synced 2026-08-22 22:38:58 +00:00
Merge pull request #157 from jwetzell/fix/db-query-params-schema
add missing params schema to db.query processor
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
|||||||
"log/slog"
|
"log/slog"
|
||||||
"text/template"
|
"text/template"
|
||||||
|
|
||||||
|
"github.com/google/jsonschema-go/jsonschema"
|
||||||
"github.com/jwetzell/showbridge-go/internal/common"
|
"github.com/jwetzell/showbridge-go/internal/common"
|
||||||
"github.com/jwetzell/showbridge-go/internal/config"
|
"github.com/jwetzell/showbridge-go/internal/config"
|
||||||
)
|
)
|
||||||
@@ -116,6 +117,23 @@ func init() {
|
|||||||
RegisterProcessor(ProcessorRegistration{
|
RegisterProcessor(ProcessorRegistration{
|
||||||
Type: "db.query",
|
Type: "db.query",
|
||||||
Title: "Query Database",
|
Title: "Query Database",
|
||||||
|
ParamsSchema: &jsonschema.Schema{
|
||||||
|
Type: "object",
|
||||||
|
Properties: map[string]*jsonschema.Schema{
|
||||||
|
"module": {
|
||||||
|
Title: "Module ID",
|
||||||
|
Type: "string",
|
||||||
|
Description: "ID of the database module to query",
|
||||||
|
},
|
||||||
|
"query": {
|
||||||
|
Title: "Query",
|
||||||
|
Type: "string",
|
||||||
|
Description: "SQL query to execute",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Required: []string{"module", "query"},
|
||||||
|
AdditionalProperties: &jsonschema.Schema{Not: &jsonschema.Schema{}},
|
||||||
|
},
|
||||||
New: func(config config.ProcessorConfig) (Processor, error) {
|
New: func(config config.ProcessorConfig) (Processor, error) {
|
||||||
|
|
||||||
params := config.Params
|
params := config.Params
|
||||||
|
|||||||
Reference in New Issue
Block a user