Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supports user params for scripts execution #182

Open
killme2008 opened this issue Mar 21, 2023 · 1 comment
Open

Supports user params for scripts execution #182

killme2008 opened this issue Mar 21, 2023 · 1 comment
Assignees

Comments

@killme2008
Copy link

killme2008 commented Mar 21, 2023

Refer to https://docs.greptime.com/user-guide/python-coprocessor/io#input

For example, a script like:

@coprocessor(returns=['value'])
def add(**params) -> vector[i64]:
    a = params['a']
    b = params['b']
    return int(a) + int(b)

We can call this coprocessor with arguments a and b:

curl  -XPOST \
   "http://localhost:4000/v1/run-script?name=add&db=public&a=42&b=99"

The query parameters except db and name are collected into params for the coprocessor.

The dashboard can support these user input parameters for scripts.

@ZonaHex
Copy link
Collaborator

ZonaHex commented Apr 3, 2023

Haven't gotten to this yet. Will discuss the UI and implementation in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants