SELECT
    'dynamic' AS component,
    sqlpage.read_file_as_text('../shared/shell.json') AS properties;

-- ╭─────────────────────────────────────────────────────────╮
-- │                          Form                           │
-- ╰─────────────────────────────────────────────────────────╯
SELECT
    'form' AS component,
    'sources/create.sql' AS ACTION,
    'Save' AS validate,
    'Sources' AS title;

SELECT
    'name' AS name,
    'Name' AS label,
    8 AS width,
    TRUE AS required;

SELECT
    'uid' AS name,
    'Identifier' AS label,
    4 AS width,
    5 AS maxlength,
    1 AS minlength,
    TRUE AS required;

SELECT
    'uri' AS name,
    'URI' AS label,
    TRUE AS required;

INSERT INTO
    public.sources(name, uid, uri)
VALUES
    (:name, :uid, :uri);

-- ╭─────────────────────────────────────────────────────────╮
-- │                       Table list                        │
-- ╰─────────────────────────────────────────────────────────╯
SELECT
    'table' AS component;

SELECT
    *
FROM
    public.sources;
