diff --git a/examples/official-site/content/blog/3-solutions-to-the-3-layer-problem.md b/examples/official-site/content/blog/3-solutions-to-the-3-layer-problem.md new file mode 100644 index 000000000..348921268 --- /dev/null +++ b/examples/official-site/content/blog/3-solutions-to-the-3-layer-problem.md @@ -0,0 +1,82 @@ +--- +title: 3 solutions to the 3 layer problem +date: '2023-08-10' +icon: adjustments-question +summary: What is the 3 layer problem, and how SQLPage solves it? +--- + +# 3 solutions to the 3 layer problem + +> Some interesting questions emerged from the article [Repeating yourself thrice doesn't turn you into a 3X developer](https://yrashk.medium.com/repeating-yourself-thrice-doesnt-turn-you-into-a-3x-developer-a778495229c0). +> This short follow-up article aims to answer them and clarify some points. + +Hello all, + +I am Ophir Lojkine, the main contributor of the open-source application server **SQLPage**. + +The previous article focused on the conventional model of splitting applications into three distinct tiers: + +1. a graphical interface (_front-end_), +2. an application server (_back-end_), +3. and a database. + +In many projects, this results in three distinct implementations of the application’s data model: + +1. First, in SQL, in the form of tables, views, and relationships in the database, +2. Then, in _server side_ languages such as Java, Python, or PHP, to create an API managing access to the data, and to implement the business logic of the application, +3. Finally, in JavaScript or TypeScript to implement data manipulation in the user interface. + +![Traditional tiers model](blog/three-layers.svg) + +--- + +The topic of interest here is the duplication of the data model between the different layers, +and the communication overhead between them. +We are not talking about how the code is structured within each layer. +It can follow a Model-View-Controller pattern or not, it doesn't matter. + +This three-layer model has several advantages: +specialization of the programmers, +parallelization of work, +scalability, +separation of concerns, +and an optimal exploitation of the capacities of the infrastructure on which each layer is deployed: +web browser, server application and database. + +Nevertheless, in large-scale projects, +there is often a certain redundancy of the code between the different layers, +as well as a non-negligible share of code dedicated to communication between them. +For small teams and solo developers, this becomes a major drawback. + +## 3 solutions + +Fortunately, there are several approaches to solving this problem: + +1. For **UI-centric applications** without complicated data processing needs, +you can almost completely abandon server-side development and **directly expose the data to the frontend**. +Open-source tools available in this space include Supabase, PocketBase or Hasura. +2. For **applications with a predominant business logic**, traditional _web frameworks_ +solve this problem by centralizing frontend and database control in the backend code. +A common solution involves using an ORM and templating system instead of a dedicated javascript application. +Popular solutions include Django, Ruby on Rails, or Symphony. +3. For simpler applications, it is possible to **avoid both backend and frontend development** +by adopting a _database-first_ approach. +This alternative, although less widespread, allows taking advantage of under-exploited modern capacities of relational databases. +The purpose of the original article was to introduce this lesser known approach. + * **SQLPage** is representative of this last category, + which allows designing a complete web application _in SQL_. + This leads to a loss of control over the precise visual appearance of the application, + which will get a “standardized” look and feel. + On the other hand, this translates into significant gains in terms of development speed, + simplicity and performance. + This solution is not intended to compete with traditional _frameworks_, + but rather integrate earlier in the life cycle of a project. + It thus makes it possible to quickly develop a data structure adapted to the application, + and to iterate over it while benefiting from continuous visual feedback on the final result. + Then, when the application grows, it’s easy to add a classic frontend and backend on top of the existing database, + without having to start from scratch. + +Whichever approach is chosen in the end, +a solid understanding of the conventional three-tier architecture, +as well as a clear perspective on the challenges it creates and the possible solutions, +facilitates decision-making and the evolution of the project with the best suited technologies. diff --git a/examples/official-site/sqlpage/migrations/14_sorry_i_forked.sql b/examples/official-site/content/blog/im-sorry-i-forked-you.md similarity index 94% rename from examples/official-site/sqlpage/migrations/14_sorry_i_forked.sql rename to examples/official-site/content/blog/im-sorry-i-forked-you.md index a21276b27..43bd7614f 100644 --- a/examples/official-site/sqlpage/migrations/14_sorry_i_forked.sql +++ b/examples/official-site/content/blog/im-sorry-i-forked-you.md @@ -1,10 +1,10 @@ -INSERT INTO blog_posts (title, description, icon, created_at, content) -VALUES ( - 'I’m sorry I forked you', - 'SQLPage forked the sqlx database drivers library. Here is why.', - 'git-fork', - '2023-08-13', - ' +--- +title: I’m sorry I forked you +date: '2023-08-13' +icon: git-fork +summary: SQLPage forked the sqlx database drivers library. Here is why. +--- + # I’m sorry I forked you I’ve been immersed in open source coding since my teenage years, and now, I can’t fathom a world without it. @@ -13,7 +13,7 @@ Each company adds its proprietary touch to this vast open source landscape, but they are ultimately just forming a unique blend atop a colossal iceberg of shared resources. In the software world, open source truly is the driving force behind innovation. -## Unconventional Financial Currents in Software +## Unconventional Financial Currents in Software The software industry operates on a financial current that defies conventional norms. Unlike other sectors where key players like oil companies rake in the riches by supplying essentials to other businesses, @@ -45,7 +45,7 @@ and the introduction of a new API, making it non trivial to migrate from the pre ## SQLPage As the principal caretaker of the [SQLPage web application server](/), which relies on sqlx, -I faced a pivotal juncture. The path ahead diverged into two distinct trails: +I faced a pivotal juncture. The path ahead diverged into two distinct trails: 1. a challenging migration to sqlx v0.7, making a cross on MSSQL support; 2. persisting with v0.6, a realm housing outdated and potentially vulnerable dependencies. @@ -94,4 +94,3 @@ The main contributor to sqlx reacted to this post, and they wanted to clarify tw (unlike SQLPage, which is free to use even in conjunction with proprietary software, under the *MIT* license). Companies that want to use these future sqlx drivers in proprietary software will have to pay for a commercial license. That change in the decision has been announced in 2022, and I should have been aware of it when I wrote this post. My bad. -'); \ No newline at end of file diff --git a/examples/official-site/sqlpage/migrations/42_blog_video.sql b/examples/official-site/content/blog/introduction-video.md similarity index 70% rename from examples/official-site/sqlpage/migrations/42_blog_video.sql rename to examples/official-site/content/blog/introduction-video.md index 4cd0a09d4..78ce294b4 100644 --- a/examples/official-site/sqlpage/migrations/42_blog_video.sql +++ b/examples/official-site/content/blog/introduction-video.md @@ -1,12 +1,10 @@ +--- +title: Introduction video +date: '2024-05-14' +icon: brand-youtube +summary: A 30-minute live presentation of SQLPage, its raison d'être, and how to use it. +--- -INSERT INTO blog_posts (title, description, icon, created_at, content) -VALUES - ( - 'Introduction video', - 'A 30-minute live presentation of SQLPage, its raison d''être, and how to use it.', - 'brand-youtube', - '2024-05-14', - ' # Introduction video ## Canadians love SQLPage @@ -16,7 +14,7 @@ by Anton Avramov, an avid SQLPage user and community member, who gave a live dem ## The video -The user group kindly invited me (Ophir, the initial creator and main contributor to SQLPage) +The user group kindly invited me (Ophir, the initial creator and main contributor to SQLPage) to record a video introduction to SQLPage, which I did. The video is a 5 minute introduction to the philosophy behind SQLPage, @@ -24,7 +22,6 @@ followed by a 25 minute live demonstration of how to create [this todo list application](https://github.com/sqlpage/SQLPage/tree/main/examples/todo%20application) from scratch. -Watch it on youtube: +Watch it on youtube: [![video cover](https://i.ytimg.com/vi/9NJgH_-zXjY/maxresdefault.jpg)](https://www.youtube.com/watch?v=9NJgH_-zXjY) -'); \ No newline at end of file diff --git a/examples/official-site/sqlpage/migrations/33_blog_v018.sql b/examples/official-site/content/blog/new-sqlpage-and-a-talk-at-pgconf-eu.md similarity index 81% rename from examples/official-site/sqlpage/migrations/33_blog_v018.sql rename to examples/official-site/content/blog/new-sqlpage-and-a-talk-at-pgconf-eu.md index 627b6d971..141987463 100644 --- a/examples/official-site/sqlpage/migrations/33_blog_v018.sql +++ b/examples/official-site/content/blog/new-sqlpage-and-a-talk-at-pgconf-eu.md @@ -1,33 +1,31 @@ +--- +title: New SQLPage, and a talk at PGConf.eu +date: '2024-01-29' +icon: brand-youtube +summary: SQLPage v0.18.0 is out, and there is detailed introduction to SQLPage on youtube +--- -INSERT INTO blog_posts (title, description, icon, created_at, content) -VALUES - ( - 'New SQLPage, and a talk at PGConf.eu', - 'SQLPage v0.18.0 is out, and there is detailed introduction to SQLPage on youtube', - 'brand-youtube', - '2024-01-29', - ' -[SQLPage](https://sql-page.com) is a small web server that renders your SQL queries as beautiful interactive websites. This release has seen significant new features and fixes from new contributors, which is great and show the health of the project ! If you feel something is missing or isn''t working quite right, all your contributions are always welcome. +[SQLPage](https://sql-page.com) is a small web server that renders your SQL queries as beautiful interactive websites. This release has seen significant new features and fixes from new contributors, which is great and show the health of the project ! If you feel something is missing or isn't working quite right, all your contributions are always welcome. On a side note, I [gave a talk about SQLPage last December at PGConf.eu](https://www.youtube.com/watch?v=mXdgmSdaXkg). It is a great detailed introduction to SQLPage, and I recommend it if you want to learn more about the project. -1. **New `tracking` component for beautiful and compact status reports:** This feature adds a new way to display status reports, making them more visually appealing and concise. +1. **New `tracking` component for beautiful and compact status reports:** This feature adds a new way to display status reports, making them more visually appealing and concise. 1. ![screenshot](https://github.com/sqlpage/SQLPage/assets/552629/3e792953-3870-469d-a01d-898316b2ab32) 3. **New `divider` component to add a horizontal line between other components:** This simple yet useful addition allows for better separation of elements on your pages. 1. ![image](https://github.com/sqlpage/SQLPage/assets/552629/09a2cc77-3b37-401f-ab3e-441637a2c022) -5. **New `breadcrumb` component to display a breadcrumb navigation bar:** This component helps users navigate through your website''s hierarchical structure, providing a clear path back to the homepage. +5. **New `breadcrumb` component to display a breadcrumb navigation bar:** This component helps users navigate through your website's hierarchical structure, providing a clear path back to the homepage. 1. ![image](https://github.com/sqlpage/SQLPage/assets/552629/cbf2174a-1d75-499e-9d6b-e111136dbbbc) 8. **Multi-column layouts with `embed` attribute in `card` component:** This feature enables you to create more complex and dynamic layouts within cards. 1. ![image](https://github.com/sqlpage/SQLPage/assets/552629/3f4435f0-d89b-424e-8b8a-39385a61d5ad) -6. **Customizable y-axis step size in `chart` component with `ystep` attribute:** This feature gives you more control over the chart''s appearance, especially for situations with multiple series. - +6. **Customizable y-axis step size in `chart` component with `ystep` attribute:** This feature gives you more control over the chart's appearance, especially for situations with multiple series. + 7. **Updated default graph colors for better distinction:** This enhancement ensures clarity and easy identification of different data series. 10. **ID and class attributes for all components for easier styling and referencing:** This improvement simplifies custom CSS customization and inter-page element linking. @@ -39,6 +37,3 @@ It is a great detailed introduction to SQLPage, and I recommend it if you want t 13. **Unicode support for built-in SQLite database:** This enables case-insensitive string comparisons and lower/upper case transformations. 5. **Improved `card` component with smaller margin below footer text:** This fix ensures consistent and visually balanced card layouts. - - ' - ); \ No newline at end of file diff --git a/examples/official-site/content/blog/repeating-yourself-thrice-won-t-make-you-a-3x-developer.md b/examples/official-site/content/blog/repeating-yourself-thrice-won-t-make-you-a-3x-developer.md new file mode 100644 index 000000000..06c635513 --- /dev/null +++ b/examples/official-site/content/blog/repeating-yourself-thrice-won-t-make-you-a-3x-developer.md @@ -0,0 +1,8 @@ +--- +title: Repeating yourself thrice won't make you a 3X developer +date: '2023-08-01' +icon: box-multiple-3 +summary: A dive into the traditional 3-tier architecture and the DRY principle, and how tools like SQLPage + helps you avoid repeating yourself. +external_url: https://yrashk.medium.com/repeating-yourself-thrice-doesnt-turn-you-into-a-3x-developer-a778495229c0 +--- diff --git a/examples/official-site/sqlpage/migrations/26_v0.17_release.sql b/examples/official-site/content/blog/sqlpage-v0-17.md similarity index 78% rename from examples/official-site/sqlpage/migrations/26_v0.17_release.sql rename to examples/official-site/content/blog/sqlpage-v0-17.md index 60bff5990..e435dee90 100644 --- a/examples/official-site/sqlpage/migrations/26_v0.17_release.sql +++ b/examples/official-site/content/blog/sqlpage-v0-17.md @@ -1,14 +1,14 @@ -INSERT INTO blog_posts (title, description, icon, created_at, content) -VALUES ( - 'SQLPage v0.17', - 'SQLPage v0.17 introduces file uploads, HTTPS, and more.', - 'git-fork', - '2023-11-28', - ' +--- +title: SQLPage v0.17 +date: '2023-11-28' +icon: git-fork +summary: SQLPage v0.17 introduces file uploads, HTTPS, and more. +--- + # SQLPage v0.17 is out ! [SQLPage](/) is a web application server that lets you build entire web applications with just SQL queries. -v0.17 was just released, and it''s worth a blog post to highlight some of the coolest new features. +v0.17 was just released, and it's worth a blog post to highlight some of the coolest new features. Mostly, this release makes it a matter of minutes to build a data import pipeline for your website, and a matter of seconds to deploy your SQLPage website securely with automatic HTTPS certificates. @@ -19,11 +19,11 @@ This release is all about a long awaited feature: **file uploads**. Your SQLPage website can now accept file uploads from users, store them either in a directory or directly in a database table. -You can add a file upload button to a form with a simple +You can add a file upload button to a form with a simple ```sql -select ''form'' as component; -select ''profile_picture'' as name, ''file'' as type; +select 'form' as component; +select 'profile_picture' as name, 'file' as type; ``` when received by the server, the file will be saved in a temporary directory @@ -35,8 +35,8 @@ You can then persist the upload as a permanent file on the server with the [`sqlpage.exec`](https://sql-page.com/functions.sql?function=exec#function) function: ```sql -set file_path = sqlpage.uploaded_file_path(''profile_picture''); -select sqlpage.exec(''mv'', $file_path, ''/path/to/my/file''); +set file_path = sqlpage.uploaded_file_path('profile_picture'); +select sqlpage.exec('mv', $file_path, '/path/to/my/file'); ``` or you can store it directly in a database table with the new @@ -44,8 +44,8 @@ or you can store it directly in a database table with the new [`sqlpage.read_file_as_text`](https://sql-page.com/functions.sql?function=read_file_as_text#function) functions: ```sql -insert into files (url) values (sqlpage.read_file_as_data_url(sqlpage.uploaded_file_path(''profile_picture''))) -returning ''text'' as component, ''Uploaded new file with id: '' || id as contents; +insert into files (url) values (sqlpage.read_file_as_data_url(sqlpage.uploaded_file_path('profile_picture'))) +returning 'text' as component, 'Uploaded new file with id: ' || id as contents; ``` The maximum size of uploaded files is configurable with the [`max_uploaded_file_size`](https://github.com/sqlpage/SQLPage/blob/main/configuration.md) @@ -54,7 +54,7 @@ configuration parameter. By default, it is set to 5 MiB. ### Parsing CSV files SQLPage can also parse uploaded [CSV](https://en.wikipedia.org/wiki/Comma-separated_values) files and insert them directly into a database table. -SQLPage re-uses PostgreSQL''s [`COPY` syntax](https://www.postgresql.org/docs/current/sql-copy.html) +SQLPage re-uses PostgreSQL's [`COPY` syntax](https://www.postgresql.org/docs/current/sql-copy.html) to import the CSV file into the database. When connected to a PostgreSQL database, SQLPage will use the native `COPY` statement, for super fast and efficient on-database CSV parsing. @@ -63,8 +63,8 @@ parsing the CSV locally and emulating the same behavior with simple `INSERT` sta #### `user_file_upload.sql` ```sql -select ''form'' as component, ''bulk_user_import.sql'' as action; -select ''user_csv_file'' as name, ''file'' as type, ''text/csv'' as accept; +select 'form' as component, 'bulk_user_import.sql' as action; +select 'user_csv_file' as name, 'file' as type, 'text/csv' as accept; ``` #### `bulk_user_import.sql` @@ -72,18 +72,18 @@ select ''user_csv_file'' as name, ''file'' as type, ''text/csv'' as accept; -- create a temporary table to preprocess the data create temporary table if not exists csv_import(name text, age text); delete from csv_import; -- empty the table --- If you don''t have any preprocessing to do, you can skip the temporary table and use the target table directly +-- If you don't have any preprocessing to do, you can skip the temporary table and use the target table directly -copy csv_import(name, age) from ''user_csv_file'' -with (header true, delimiter '','', quote ''"'', null ''NaN''); -- all the options are optional +copy csv_import(name, age) from 'user_csv_file' +with (header true, delimiter ',', quote '"', null 'NaN'); -- all the options are optional -- since header is true, the first line of the file will be used to find the "name" and "age" columns --- if you don''t have a header line, the first column in the CSV will be interpreted as the first column of the table, etc +-- if you don't have a header line, the first column in the CSV will be interpreted as the first column of the table, etc -- run any preprocessing you want on the data here -- insert the data into the users table insert into users (name, birth_date) -select upper(name), date_part(''year'', CURRENT_DATE) - cast(age as int) from csv_import; +select upper(name), date_part('year', CURRENT_DATE) - cast(age as int) from csv_import; ``` ### New functions @@ -116,7 +116,7 @@ that would compromise your security if you get it wrong. With SQLPage v0.17, you just give your domain name, and it takes care of everything. -And while we''re at it, SQLPage also supports HTTP/2, for even faster page loads. +And while we're at it, SQLPage also supports HTTP/2, for even faster page loads. To enable HTTPS, you need to buy a [domain name](https://en.wikipedia.org/wiki/Domain_name) and make it point to the server where SQLPage is running. @@ -128,9 +128,9 @@ Then set the `https_domain` configuration parameter to `yourdomain.com` in your } ``` -That''s it. No external tool to install, no certificate to generate, no configuration to tweak. +That's it. No external tool to install, no certificate to generate, no configuration to tweak. No need to restart SQLPage regularly either, or to worry about renewing your certificate when it expires. -SQLPage will automatically request a certificate from [Let''s Encrypt](https://letsencrypt.org/) by default, +SQLPage will automatically request a certificate from [Let's Encrypt](https://letsencrypt.org/) by default, and does not even need to listen on port 80 to do so. ## SQL parser improvements @@ -139,7 +139,7 @@ SQLPage needs to parse SQL queries to be able to bind the right parameters to th and to inject the results of built-in sqlpage functions in them. The parser we use is very powerful and supports most SQL features, but there are some edge cases where it fails to parse a query. -That''s why we contribute to it a lot, and bring the latest version of the parser to SQLPage as soon as it is released. +That's why we contribute to it a lot, and bring the latest version of the parser to SQLPage as soon as it is released. ### JSON functions in MS SQL Server @@ -163,8 +163,7 @@ and to create JSON APIs. - The `cookie` component now supports setting an explicit expiration date for cookies. - The `cookie` component now supports setting the `SameSite` attribute of cookies, and defaults to `SameSite=Strict` for all cookies. What this means in practice is that cookies set by SQLPage will not be sent to your website if the user is coming from another website. This prevents someone from tricking your users into executing SQLPage queries on your website by sending them a malicious link. - Bugfix: setting `min` or `max` to `0` in a number field in the `form` component now works as expected. - - Added support for `.env` files to set SQLPage''s [environment variables](./configuration.md#environment-variables). + - Added support for `.env` files to set SQLPage's [environment variables](./configuration.md#environment-variables). - Better responsive design in the card component. Up to 5 cards per line on large screens. The number of cards per line is still customizable with the `columns` attribute. - - [New icons](https://tabler-icons.io/changelog): + - [New icons](https://tabler-icons.io/changelog): - ![new icons in tabler 42](https://github.com/tabler/tabler-icons/assets/1282324/00856af9-841d-4aa9-995d-121c7ddcc005) -'); \ No newline at end of file diff --git a/examples/official-site/content/blog/sqlpage-versus-no-code-tools.md b/examples/official-site/content/blog/sqlpage-versus-no-code-tools.md new file mode 100644 index 000000000..396480cdd --- /dev/null +++ b/examples/official-site/content/blog/sqlpage-versus-no-code-tools.md @@ -0,0 +1,80 @@ +--- +title: SQLPage versus No-Code tools +date: '2023-08-03' +icon: code-minus +summary: What are the advantages and disadvantages of SQLPage compared to No-Code tools? +--- + +# Choosing Your Path: No-Code, Low-Code, or SQL-Based Development + +The platform you select shapes the entire trajectory of your application. +Each approach offers distinct advantages, yet demands different compromises - a choice that warrants careful consideration. + +## No-Code Platforms: Speed with Limitations + +No-Code platforms present a visual canvas for building applications without traditional programming. Whilst brilliant for rapid prototypes and straightforward departmental tools, they falter when confronted with complexity and scale. + +**Best suited to**: Quick internal tools and simple workflows + +### **Notable examples** + + - [NocoBase](https://www.nocobase.com/) + - [NocoDB](https://www.nocodb.com/) + - [Saltcorn](https://github.com/saltcorn/saltcorn) + + +## Low-Code Platforms: The Flexible Middle Ground + +These platforms artfully combine visual development with traditional coding. They maintain the power of custom code whilst accelerating development through carefully designed components. + +**Best suited to**: Complex applications requiring both speed and customisation + +### **Notable examples** + + - [Budibase](https://budibase.com/) + - [Directus](https://github.com/directus/directus) + - [Rowy](https://github.com/rowyio/rowy) + +## SQL-Based Development: Elegant Simplicity + +SQLPage offers a refreshingly direct approach: pure SQL-driven web applications. + +For those versed in SQL, it enables sophisticated data-driven applications without the overhead of additional frameworks. + +**Best suited to**: Data-centric applications and dashboards + +**Details**: [SQLPage on GitHub](https://github.com/sqlpage/SQLPage) + +## The AI Revolution in Development + +The emergence of Large Language Models (LLMs) has fundamentally shifted the landscape of application development. Tools that once demanded extensive coding expertise have become remarkably more accessible. AI assistants like ChatGPT excel particularly at generating SQL queries and database operations, making SQL-based platforms surprisingly approachable even for those with limited database experience. These AI companions serve as expert pair programmers, offering suggestions, debugging assistance, and ready-to-use code snippets. + +This transformation especially benefits platforms like SQLPage, where the AI's prowess in SQL generation can bridge the traditional expertise gap. Even complex queries and database operations can be created through natural language conversations with AI assistants, democratising access to sophisticated data manipulation capabilities. + +## Making an Informed Choice + +Selecting the right development approach requires weighing multiple factors against your project's specific needs. + +Consider these key decision points to guide your platform selection: + +### **Time Constraints** + - Immediate delivery required → No-Code + - Several days available → SQLPage or Low-Code + +### **Data Complexity** + - Structured data manipulation → SQLPage + - Complex workflows → Low-Code + +### **Team Expertise** + - SQL skills → SQLPage + - Limited technical expertise → No-Code + - Varied technical capabilities → Low-Code + +### **Control Requirements** + - Precise data layer control → SQLPage + - Visual design flexibility → Low-Code + - Speed over customisation → No-Code + +## Further Investigation + +For a thorough demonstration of SQLPage's capabilities: [Building a Full Web Application with SQLPage](https://www.youtube.com/watch?v=mXdgmSdaXkg) diff --git a/examples/official-site/sqlpage/migrations/41_blog_performance.sql b/examples/official-site/content/blog/sqlpage-website-update.md similarity index 86% rename from examples/official-site/sqlpage/migrations/41_blog_performance.sql rename to examples/official-site/content/blog/sqlpage-website-update.md index 684640d3a..fd583218e 100644 --- a/examples/official-site/sqlpage/migrations/41_blog_performance.sql +++ b/examples/official-site/content/blog/sqlpage-website-update.md @@ -1,12 +1,10 @@ +--- +title: SQLPage website update +date: '2024-05-01' +icon: browser +summary: Performance, security, and new features +--- -INSERT INTO blog_posts (title, description, icon, created_at, content) -VALUES - ( - 'SQLPage website update', - 'Performance, security, and new features', - 'browser', - '2024-05-01', - ' Today is may day, and we are happy to announce that the SQLPage website has been updated with new contents. ## Homepage @@ -33,5 +31,3 @@ or an academic institution using [CAS](https://apereo.github.io/cas/). The README of the SQLPage repository now includes a [clear yet detailed architecture diagram](https://github.com/sqlpage/SQLPage?tab=readme-ov-file#how-it-works). -' - ); \ No newline at end of file diff --git a/examples/official-site/sqlpage/migrations/12_blog.sql b/examples/official-site/sqlpage/migrations/12_blog.sql index 773e29ecb..e5a13a442 100644 --- a/examples/official-site/sqlpage/migrations/12_blog.sql +++ b/examples/official-site/sqlpage/migrations/12_blog.sql @@ -6,180 +6,3 @@ CREATE TABLE blog_posts ( content TEXT, created_at TIMESTAMP NOT NULL ); - -INSERT INTO blog_posts (title, description, icon, created_at, content) -VALUES - ( - 'SQLPage versus No-Code tools', - 'What are the advantages and disadvantages of SQLPage compared to No-Code tools?', - 'code-minus', - '2023-08-03', - ' -# Choosing Your Path: No-Code, Low-Code, or SQL-Based Development - -The platform you select shapes the entire trajectory of your application. -Each approach offers distinct advantages, yet demands different compromises - a choice that warrants careful consideration. - -## No-Code Platforms: Speed with Limitations - -No-Code platforms present a visual canvas for building applications without traditional programming. Whilst brilliant for rapid prototypes and straightforward departmental tools, they falter when confronted with complexity and scale. - -**Best suited to**: Quick internal tools and simple workflows - -### **Notable examples** - - - [NocoBase](https://www.nocobase.com/) - - [NocoDB](https://www.nocodb.com/) - - [Saltcorn](https://github.com/saltcorn/saltcorn) - - -## Low-Code Platforms: The Flexible Middle Ground - -These platforms artfully combine visual development with traditional coding. They maintain the power of custom code whilst accelerating development through carefully designed components. - -**Best suited to**: Complex applications requiring both speed and customisation - -### **Notable examples** - - - [Budibase](https://budibase.com/) - - [Directus](https://github.com/directus/directus) - - [Rowy](https://github.com/rowyio/rowy) - -## SQL-Based Development: Elegant Simplicity - -SQLPage offers a refreshingly direct approach: pure SQL-driven web applications. - -For those versed in SQL, it enables sophisticated data-driven applications without the overhead of additional frameworks. - -**Best suited to**: Data-centric applications and dashboards - -**Details**: [SQLPage on GitHub](https://github.com/sqlpage/SQLPage) - -## The AI Revolution in Development - -The emergence of Large Language Models (LLMs) has fundamentally shifted the landscape of application development. Tools that once demanded extensive coding expertise have become remarkably more accessible. AI assistants like ChatGPT excel particularly at generating SQL queries and database operations, making SQL-based platforms surprisingly approachable even for those with limited database experience. These AI companions serve as expert pair programmers, offering suggestions, debugging assistance, and ready-to-use code snippets. - -This transformation especially benefits platforms like SQLPage, where the AI''s prowess in SQL generation can bridge the traditional expertise gap. Even complex queries and database operations can be created through natural language conversations with AI assistants, democratising access to sophisticated data manipulation capabilities. - -## Making an Informed Choice - -Selecting the right development approach requires weighing multiple factors against your project''s specific needs. - -Consider these key decision points to guide your platform selection: - -### **Time Constraints** - - Immediate delivery required → No-Code - - Several days available → SQLPage or Low-Code - -### **Data Complexity** - - Structured data manipulation → SQLPage - - Complex workflows → Low-Code - -### **Team Expertise** - - SQL skills → SQLPage - - Limited technical expertise → No-Code - - Varied technical capabilities → Low-Code - -### **Control Requirements** - - Precise data layer control → SQLPage - - Visual design flexibility → Low-Code - - Speed over customisation → No-Code - -## Further Investigation - -For a thorough demonstration of SQLPage''s capabilities: [Building a Full Web Application with SQLPage](https://www.youtube.com/watch?v=mXdgmSdaXkg) -'); - -INSERT INTO blog_posts (title, description, icon, created_at, external_url) -VALUES ( - 'Repeating yourself thrice won''t make you a 3X developer', - 'A dive into the traditional 3-tier architecture and the DRY principle, and how tools like SQLPage helps you avoid repeating yourself.', - 'box-multiple-3', - '2023-08-01', - 'https://yrashk.medium.com/repeating-yourself-thrice-doesnt-turn-you-into-a-3x-developer-a778495229c0' -); - -INSERT INTO blog_posts (title, description, icon, created_at, content) -VALUES ( - '3 solutions to the 3 layer problem', - 'What is the 3 layer problem, and how SQLPage solves it?', - 'adjustments-question', - '2023-08-10', - ' -# 3 solutions to the 3 layer problem - -> Some interesting questions emerged from the article [Repeating yourself thrice doesn''t turn you into a 3X developer](https://yrashk.medium.com/repeating-yourself-thrice-doesnt-turn-you-into-a-3x-developer-a778495229c0). -> This short follow-up article aims to answer them and clarify some points. - -Hello all, - -I am Ophir Lojkine, the main contributor of the open-source application server **SQLPage**. - -The previous article focused on the conventional model of splitting applications into three distinct tiers: - -1. a graphical interface (_front-end_), -2. an application server (_back-end_), -3. and a database. - -In many projects, this results in three distinct implementations of the application’s data model: - -1. First, in SQL, in the form of tables, views, and relationships in the database, -2. Then, in _server side_ languages such as Java, Python, or PHP, to create an API managing access to the data, and to implement the business logic of the application, -3. Finally, in JavaScript or TypeScript to implement data manipulation in the user interface. - -![Traditional tiers model](blog/three-layers.svg) - ---- - -The topic of interest here is the duplication of the data model between the different layers, -and the communication overhead between them. -We are not talking about how the code is structured within each layer. -It can follow a Model-View-Controller pattern or not, it doesn''t matter. - -This three-layer model has several advantages: -specialization of the programmers, -parallelization of work, -scalability, -separation of concerns, -and an optimal exploitation of the capacities of the infrastructure on which each layer is deployed: -web browser, server application and database. - -Nevertheless, in large-scale projects, -there is often a certain redundancy of the code between the different layers, -as well as a non-negligible share of code dedicated to communication between them. -For small teams and solo developers, this becomes a major drawback. - -## 3 solutions - -Fortunately, there are several approaches to solving this problem: - -1. For **UI-centric applications** without complicated data processing needs, -you can almost completely abandon server-side development and **directly expose the data to the frontend**. -Open-source tools available in this space include Supabase, PocketBase or Hasura. -2. For **applications with a predominant business logic**, traditional _web frameworks_ -solve this problem by centralizing frontend and database control in the backend code. -A common solution involves using an ORM and templating system instead of a dedicated javascript application. -Popular solutions include Django, Ruby on Rails, or Symphony. -3. For simpler applications, it is possible to **avoid both backend and frontend development** -by adopting a _database-first_ approach. -This alternative, although less widespread, allows taking advantage of under-exploited modern capacities of relational databases. -The purpose of the original article was to introduce this lesser known approach. - * **SQLPage** is representative of this last category, - which allows designing a complete web application _in SQL_. - This leads to a loss of control over the precise visual appearance of the application, - which will get a “standardized” look and feel. - On the other hand, this translates into significant gains in terms of development speed, - simplicity and performance. - This solution is not intended to compete with traditional _frameworks_, - but rather integrate earlier in the life cycle of a project. - It thus makes it possible to quickly develop a data structure adapted to the application, - and to iterate over it while benefiting from continuous visual feedback on the final result. - Then, when the application grows, it’s easy to add a classic frontend and backend on top of the existing database, - without having to start from scratch. - -Whichever approach is chosen in the end, -a solid understanding of the conventional three-tier architecture, -as well as a clear perspective on the challenges it creates and the possible solutions, -facilitates decision-making and the evolution of the project with the best suited technologies. - ' - ); \ No newline at end of file diff --git a/scripts/site/documentation.mjs b/scripts/site/documentation.mjs index ad1f0631f..35dc9be6e 100644 --- a/scripts/site/documentation.mjs +++ b/scripts/site/documentation.mjs @@ -9,6 +9,10 @@ export class Seed { constructor(db) { this.db = db; } + script(sql) { + this.db.exec(sql); + this.#sql.push(`${sql}\n`); + } row(sql, ...values) { if (values.some((v) => typeof v === "string" && v.includes("\0"))) throw new Error("NUL byte in SQL text value");