feat(idx) add auto idx

This commit is contained in:
lumither committed 2024-05-03 21:40:53 +08:00
1 parent 6b311ab255
commit 36825b4950
8 files changed
+115 -17

No files matched your search

+4 -2
View File
@@ -2,13 +2,15 @@ CREATE TABLE IF NOT EXISTS Post
(
post_id UUID PRIMARY KEY,
title VARCHAR(255) NOT NULL,
summary TEXT NOT NULL,
content TEXT NOT NULL,
last_update TIMESTAMP
);
INSERT INTO Post (post_id, title, content, last_update)
VALUES (?1, ?2, ?3, ?4)
INSERT INTO Post (post_id, title, summary, content, last_update)
VALUES ($1, $2, $3, $4, $5)
ON CONFLICT (post_id)
DO UPDATE SET title = excluded.title,
summary = excluded.summary,
content = excluded.content,
last_update = excluded.last_update