File tree Expand file tree Collapse file tree 1 file changed +19
-19
lines changed Expand file tree Collapse file tree 1 file changed +19
-19
lines changed Original file line number Diff line number Diff line change @@ -50,46 +50,46 @@ Options:
50
50
## Example
51
51
52
52
```
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
54
54
#############################################
55
55
# Add the following to your SQL schema file #
56
56
#############################################
57
57
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
62
62
);
63
63
64
64
##############################################
65
65
# Add the following to your SQL queries file #
66
66
##############################################
67
67
68
68
-- name: GetAuthor :one
69
- SELECT * FROM " authors"
70
- WHERE "id" = ? LIMIT 1;
69
+ SELECT * FROM authors
70
+ WHERE id = ? LIMIT 1;
71
71
72
72
-- name: ListAuthors :many
73
- SELECT * FROM " authors"
74
- ORDER BY "" ;
73
+ SELECT * FROM authors
74
+ ORDER BY name ;
75
75
76
76
-- name: CreateAuthor :one
77
- INSERT INTO " authors" (
78
- " name", " bio"
77
+ INSERT INTO authors (
78
+ name, bio
79
79
) VALUES (
80
80
?, ?
81
81
)
82
82
RETURNING *;
83
83
84
- -- name: DeleteAuthor
85
- DELETE FROM " authors"
86
- WHERE "id" = ?;
84
+ -- name: DeleteAuthor :exec
85
+ DELETE FROM authors
86
+ WHERE id = ?;
87
87
88
- -- name: UpdateAuthor
89
- UPDATE " authors"
88
+ -- name: UpdateAuthor :one
89
+ UPDATE authors
90
90
SET
91
- " name" = ?,
92
- " bio" = ?
93
- WHERE "id" = ?
91
+ name = ?,
92
+ bio = ?
93
+ WHERE id = ?
94
94
RETURNING *;
95
95
```
You can’t perform that action at this time.
0 commit comments