Skip to content

Commit

Permalink
document postgres-specific syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
lovasoa committed Jan 5, 2024
1 parent 99c7e02 commit e010692
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion examples/master-detail-forms/insert_user.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
INSERT INTO user (id, first_name, last_name, email) VALUES (CAST($id AS INT), :"First name", :"Last name", :Email)
ON CONFLICT (id) DO UPDATE SET first_name = excluded.first_name, last_name = excluded.last_name, email = excluded.email
ON CONFLICT (id) DO -- this syntax is PostgreSQL-specific. In SQLite, use ON CONFLICT IGNORE.
UPDATE SET first_name = excluded.first_name, last_name = excluded.last_name, email = excluded.email
RETURNING
'redirect' AS component,
'edit_user.sql?id=' || id AS link;
2 changes: 1 addition & 1 deletion examples/user-authentication/create_user.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
INSERT INTO user_info (username, password_hash)
VALUES (:username, sqlpage.hash_password(:password))
ON CONFLICT (username) DO NOTHING
ON CONFLICT (username) DO NOTHING -- this syntax is PostgreSQL-specific. In SQLite, use ON CONFLICT IGNORE.
RETURNING
'redirect' AS component,
'create_user_welcome_message.sql?username=' || :username AS link;
Expand Down

0 comments on commit e010692

Please sign in to comment.