Skip to content

Commit 9872234

Browse files
committed
Preserve streaming and cover database examples
1 parent 7231527 commit 9872234

14 files changed

Lines changed: 511 additions & 133 deletions

File tree

Cargo.lock

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ sqlx-sqlserver = { version = "0.0.3", features = [
3838
"uuid",
3939
] }
4040
sqlx-odbc = { version = "0.0.1", features = ["runtime-tokio"] }
41+
# sqlx-sqlserver currently uses native-tls. Enable vendored OpenSSL so Docker cross-builds
42+
# do not depend on target-architecture OpenSSL development packages.
43+
openssl = { version = "0.10", features = ["vendored"] }
4144
libsqlite3-sys = "0.37"
4245
chrono = "0.4.23"
4346
actix-web = { version = "4", features = ["rustls-0_23", "cookies"] }

examples/mysql json handling/index.sql

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
select 'form' as component, 'Create a new Group' as title, 'Create' as validate;
22
select 'Name' as name;
33

4-
insert into groups(name) select :Name where :Name is not null;
4+
insert into `groups`(name) select :Name where :Name is not null;
55

66
select 'list' as component, 'Groups' as title, 'No group yet' as empty_title;
7-
select name as title from groups;
7+
select name as title from `groups`;
88

99
select 'form' as component, 'Add a user' as title, 'Add' as validate;
1010
select 'UserName' as name, 'Name' as label;
@@ -15,7 +15,7 @@ select
1515
TRUE as multiple,
1616
'press ctrl to select multiple values' as description,
1717
json_arrayagg(json_object("label", name, "value", id)) as options
18-
from groups;
18+
from `groups`;
1919

2020
insert into users(name) select :UserName where :UserName is not null;
2121
insert into group_members(group_id, user_id)
@@ -28,8 +28,8 @@ where :Memberships is not null;
2828
select 'list' as component, 'Users' as title, 'No user yet' as empty_title;
2929
select
3030
users.name as title,
31-
group_concat(groups.name) as description
31+
group_concat(`groups`.name) as description
3232
from users
3333
left join group_members on users.id = group_members.user_id
34-
left join groups on groups.id = group_members.group_id
35-
group by users.id, users.name;
34+
left join `groups` on `groups`.id = group_members.group_id
35+
group by users.id, users.name;

examples/mysql json handling/sqlpage/migrations/0001_users_and_groups.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ create table users (
33
name varchar(255) not null
44
);
55

6-
create table groups (
6+
create table `groups` (
77
id int primary key auto_increment,
88
name varchar(255) not null
99
);
@@ -12,6 +12,6 @@ create table group_members (
1212
group_id int not null,
1313
user_id int not null,
1414
primary key (group_id, user_id),
15-
foreign key (group_id) references groups (id),
15+
foreign key (group_id) references `groups` (id),
1616
foreign key (user_id) references users (id)
17-
);
17+
);

examples/mysql json handling/survey.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ select 'card' as component, 'Survey results' as title;
2222
select
2323
questions.question_text as title,
2424
survey_answers.answer as description,
25-
'On ' || survey_answers.timestamp as footer
25+
CONCAT('On ', survey_answers.timestamp) as footer
2626
from survey_answers
2727
inner join questions on questions.id = survey_answers.question_id;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
INSERT INTO comments (post_id, user_id, content) VALUES ($id, 1, :content);
2-
SELECT 'redirect' as component, '/post/' || $id AS link;
2+
SELECT 'redirect' as component, CONCAT('/post/', $id) AS link;

examples/nginx/website/index.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ SELECT
44
p.title,
55
u.username AS description,
66
'user' AS icon,
7-
'/post/' || p.id AS link
7+
CONCAT('/post/', p.id) AS link
88
FROM posts p
99
JOIN users u ON p.user_id = u.id
10-
ORDER BY p.created_at DESC;
10+
ORDER BY p.created_at DESC;

examples/nginx/website/post.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ SELECT 'divider' as component;
3737
SELECT 'form' as component,
3838
'Add a comment' as title,
3939
'Post comment' as validate,
40-
'/add_comment.sql?id=' || $id as action;
40+
CONCAT('/add_comment.sql?id=', $id) as action;
4141

4242
SELECT 'textarea' as type,
4343
'content' as name,
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
select
22
'text' as component,
33
true as article,
4-
'
4+
CONCAT('
55
# Welcome to my website
66
7-
Using SQLPage v' || sqlpage.version() || '
7+
Using SQLPage v', sqlpage.version(), '
88
9-
Connected to **MySQL** v' || version () as contents_md;
9+
Connected to **MySQL** v', version ()) as contents_md;

0 commit comments

Comments
 (0)