Replies: 10 comments 15 replies
-
Thank you for your thoughtful suggestions! I can see that you've given a lot of thought to possible enhancements and I appreciate your initiative. Your ideas around enhancing SQL with HTML rendering capabilities are intriguing. However, I'd like to point out that SQLPage is designed to be a SQL-only website builder. Our goal is to keep the tool simple, easy to learn, fast, and efficient while adhering strictly to SQL syntax and capabilities, taking advantage of its flexibility and wide user base. Many SQLPage users know SQL without even knowing the concepts of rendering or html, and maintain large SQLPage applications. If you haven't already, I'd strongly recommend you to try out SQLPage as it is currently designed. Try building a website using the existing functionality and you might be surprised at the flexibility and power that SQL alone can offer. Your suggestions are certainly innovative and could make for a great extension to a project that includes HTML handling directly in SQL. However, incorporating them into SQLPage might deviate it from its original purpose and design. Again, thank you for your suggestions. I encourage you to experiment with SQLPage and see how it works for you. Your feedback is always welcome. |
Beta Was this translation helpful? Give feedback.
-
Implementation wise, |
Beta Was this translation helpful? Give feedback.
-
Let's take time and compare sql with overloaded select, and extensions that can repeat select if needed, but call it something else. Let's compare readability. No rush. Let's take example https://github.com/lovasoa/SQLpage/tree/main/examples/splitwise
and with extension to SQL vocabulary:
What if we wanna page that has list refreshing via server events when some table gets updated? And there is no need to reload page.
Let's take on the second file of the example app in the following comment. |
Beta Was this translation helpful? Give feedback.
-
Original
is a little longer, but we've developed most things in the first example. So, with extension to SQL vocabulary it may read like
|
Beta Was this translation helpful? Give feedback.
-
For my taste, extended SQL captures data flow and thus core business logic, keeping it explicit. |
Beta Was this translation helpful? Give feedback.
-
Just looked in "Loops?" discussion: #306 (reply in thread) |
Beta Was this translation helpful? Give feedback.
-
Let's also observe that DO extended syntax may
|
Beta Was this translation helpful? Give feedback.
-
Cursory look into dialect-related file in https://github.com/sqlparser-rs/sqlparser-rs/tree/main/src/dialect Cursory look into https://github.com/sqlparser-rs/sqlparser-rs/blob/main/src/ast/mod.rs sqlparser is a very nicely structured library. |
Beta Was this translation helpful? Give feedback.
-
May I point attention to how users of SQLPage already do work around of "implicitly closing tags".
May be you should start to do the same in examples? But it has this nagging "why indentation after closing semicolumn ; ". |
Beta Was this translation helpful? Give feedback.
-
Rendering into list is a very common pattern, so, a little help can be extended from SQL extension to allow user first write data source select, concentrating on it, and tail it with rendering.
Commands follow data flows' patterns:
|
Beta Was this translation helpful? Give feedback.
-
Have you considered new statement, like all SQL dbs have: SHOW in pg and mysql, DO in pg, so on?
How about
or
Those optional tag names can be web component, or template component, both in standard library and user added, or something else. With own statements SQLpage may have a greater space for future development.
Postgres' DO hints that for rendering form it can be about what form does, while in general it can be a spot to invoke embedded runtime to run some small function on inputs from db data. It can be Deno and WASI for whatever lambda-style functions user may wish to have.
Of course, a more structured and a more readable SQL with extension may need cleaner separation: no render-related anything goes to db server, reading code gives clean separation of what processes go here. MVP is fine with sequence that looks like
some of which will mean rendering, others will be actual data selects from db, all sprinkled with implicit closures of initial display elements, like browser used to (and may be do now) close tags that one forgot to close -- very web-y, not sql-y, though. It is amazing for MVP, but will this support one, say in opening data in those no-longer supported on-premise Jira tables in Postgres databases?
SQL is incredibly structured to the point of being simple and fast to both generate and parse. Don't add complex things with formulas. If small parser can't read it, give it to db to process or finally choke. But readability for a non-programmer, non-debugger, will improve.
Beta Was this translation helpful? Give feedback.
All reactions