Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion examples/official-site/blog.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
select 'redirect' as component, '/blog.sql' as link
where ($post IS NULL AND sqlpage.path() <> '/blog.sql') OR ($post IS NOT NULL AND NOT EXISTS (SELECT 1 FROM blog_posts WHERE title = $post));

select 'redirect' as component, external_url as link
from blog_posts where title = $post and external_url is not null;

select 'shell-docs' as component, coalesce($post || ' - ', '') || 'SQLPage Blog' as title;

SELECT 'text' AS component,
Expand All @@ -19,4 +22,4 @@ SELECT title,
CASE WHEN external_url IS NULL THEN json_object('post', title) ELSE NULL END
) AS link
FROM blog_posts
ORDER BY created_at DESC;
ORDER BY created_at DESC;
5 changes: 5 additions & 0 deletions examples/official-site/test.hurl
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ HTTP 200
[Asserts]
xpath "normalize-space(//main//h3/a[@href='/functions.sql?function=variables'])" == "variables([method])"

GET http://localhost:8080/blog.sql?post=Repeating+yourself+thrice+won%27t+make+you+a+3X+developer
HTTP 302
[Asserts]
header "Location" == "https://yrashk.medium.com/repeating-yourself-thrice-doesnt-turn-you-into-a-3x-developer-a778495229c0"

GET http://localhost:8080/functions.sql?function=url_encode
HTTP 200
[Asserts]
Expand Down
Loading