15 lines
450 B
Text
15 lines
450 B
Text
|
|
#!/usr/bin/env nu
|
||
|
|
# Derived variables for postgresql bundle rendering.
|
||
|
|
# Keys are lowercase — merged into the postgresql tera context.
|
||
|
|
|
||
|
|
def main [component_json: string]: nothing -> nothing {
|
||
|
|
let pg = ($component_json | from json)
|
||
|
|
let databases = ($pg | get -o databases | default [])
|
||
|
|
{
|
||
|
|
databases_space: ($databases | str join " "),
|
||
|
|
databases_json: ($databases | to json --raw),
|
||
|
|
}
|
||
|
|
| to json --raw
|
||
|
|
| print
|
||
|
|
}
|