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

[feat] Foldable component - ability to embed other sql files #680

Open
accforgithubtest opened this issue Nov 8, 2024 · 4 comments
Open
Labels
enhancement New feature or request

Comments

@accforgithubtest
Copy link

accforgithubtest commented Nov 8, 2024

Requesting a feature for Foldable component to be able to embed other sql files.

I can think of many useful scenarios, where a "break-down" of data could be presented upon expansion in neat ways on the UI, while also conserving valuable screen real-estate.

Examples -

  1. Display a "Total = $12345" on the Foldable component title, and then display a breakdown (using big_number for example) uopn expansion. The big_number component could be in a separate sql file that can be then re-used in multiple places.

  2. Display a "X New Offers" as title and upon expansion display cards or columns components highlighting the offers / products with more details. The cards or column components are in a separate sql file, which can be re-used in multiple places like search products, carts, etc.

As you can see, this feature could help re-using the common sql files with components and help optimize screen real-estate in very useful ways.

Looking forward to hearing your thoughts. Cheers!

@accforgithubtest accforgithubtest added the enhancement New feature or request label Nov 8, 2024
@lovasoa
Copy link
Collaborator

lovasoa commented Nov 15, 2024

Hello ! This is indeed a very good idea, I can think of multiple scenarios where this would be useful. I will keep this in mind.

@ToniJ123
Copy link

Yeah this would be great to have ability to use other components and sql files embed in foldable! 👍

@mingfang
Copy link

I think this is the missing piece of sqlpage; the ability to compose pages from multiple sql files.

Looking at this issue #747, the embed feature is doing composition on the client side.
It would be great to be able to do it on the server side. e.g.

select 'my_component.sql' as embed;

@mingfang
Copy link

nvm, after posting my comment then I read this
#20

I think dynamic components with sqlpage.run_sql() looks like a good option.
https://sql-page.com/component.sql?component=dynamic#component

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

4 participants