Skip to content

Commit 3351fee

Browse files
committed
Update example
1 parent 57dfe3d commit 3351fee

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

README.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -50,46 +50,46 @@ Options:
5050
## Example
5151

5252
```
53-
$ sqlcup author/authors "id:INTEGER:PRIMARY KEY" "name:text:NOT NULL" bio:text
53+
$ sqlcup --order-by name author/authors "id:INTEGER:PRIMARY KEY" "name:text:NOT NULL" bio:text
5454
#############################################
5555
# Add the following to your SQL schema file #
5656
#############################################
5757
58-
CREATE TABLE IF NOT EXISTS "authors" (
59-
"id" INTEGER PRIMARY KEY,
60-
"name" text NOT NULL,
61-
"bio" text
58+
CREATE TABLE IF NOT EXISTS authors (
59+
id INTEGER PRIMARY KEY,
60+
name text NOT NULL,
61+
bio text
6262
);
6363
6464
##############################################
6565
# Add the following to your SQL queries file #
6666
##############################################
6767
6868
-- name: GetAuthor :one
69-
SELECT * FROM "authors"
70-
WHERE "id" = ? LIMIT 1;
69+
SELECT * FROM authors
70+
WHERE id = ? LIMIT 1;
7171
7272
-- name: ListAuthors :many
73-
SELECT * FROM "authors"
74-
ORDER BY "";
73+
SELECT * FROM authors
74+
ORDER BY name;
7575
7676
-- name: CreateAuthor :one
77-
INSERT INTO "authors" (
78-
"name", "bio"
77+
INSERT INTO authors (
78+
name, bio
7979
) VALUES (
8080
?, ?
8181
)
8282
RETURNING *;
8383
84-
-- name: DeleteAuthor
85-
DELETE FROM "authors"
86-
WHERE "id" = ?;
84+
-- name: DeleteAuthor :exec
85+
DELETE FROM authors
86+
WHERE id = ?;
8787
88-
-- name: UpdateAuthor
89-
UPDATE "authors"
88+
-- name: UpdateAuthor :one
89+
UPDATE authors
9090
SET
91-
"name" = ?,
92-
"bio" = ?
93-
WHERE "id" = ?
91+
name = ?,
92+
bio = ?
93+
WHERE id = ?
9494
RETURNING *;
9595
```

0 commit comments

Comments
 (0)