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

Render Composite Types in Tables #376

Open
guspower opened this issue Jun 5, 2024 · 1 comment
Open

Render Composite Types in Tables #376

guspower opened this issue Jun 5, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@guspower
Copy link

guspower commented Jun 5, 2024

What are you building with SQLPage ?

A system for capturing technical requirements and examples.

What is your problem ? A description of the problem, not the solution you are proposing.

I have a number of postgreSQL composite types in my schema. When I list these fields in a table component nothing is rendered. It would be great if SQLPage could render something in that area rather than having to explicitly list out each subfield using (column).attribute syntax.

What are you currently doing ? Since your solution is not implemented in SQLPage currently, what are you doing instead ?

I am listing out each subfield using (column).attribute syntax.

Describe the solution you'd like

SQLPage "magically" figures out how to render the composite type somehow. I have no idea how it might do this. I could imagine it adding columns based on the union of the column name and composite type field name e.g. column_field.

Describe alternatives you've considered

Just select the column values explicitly.

Additional context

I use composite types to make it easier to deal with data from a number of APIs that have embedded values like money (combination of currency and amount). An example of a composite type in postgreSQL might be:

CREATE TYPE monetary_value AS (
    amount real,
    currency character varying
);

CREATE TABLE balance (
    yesterday monetary_value NOT NULL,
    today monetary_value NOT NULL
);

SELECT (yesterday).amount, (today).amount FROM balance;
@guspower guspower added the enhancement New feature or request label Jun 5, 2024
@lovasoa
Copy link
Owner

lovasoa commented Jun 7, 2024

Hello ! That's interesting. I'll keep that in mind and try to implement it later.

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

No branches or pull requests

2 participants