mirror of
https://github.com/jwetzell/showbridge-go.git
synced 2026-08-11 01:13:38 +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"
|
||||
"text/template"
|
||||
|
||||
"github.com/google/jsonschema-go/jsonschema"
|
||||
"github.com/jwetzell/showbridge-go/internal/common"
|
||||
"github.com/jwetzell/showbridge-go/internal/config"
|
||||
)
|
||||
@@ -116,6 +117,23 @@ func init() {
|
||||
RegisterProcessor(ProcessorRegistration{
|
||||
Type: "db.query",
|
||||
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) {
|
||||
|
||||
params := config.Params
|
||||
|
||||
Reference in New Issue
Block a user