File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 1- > 🚨
1+ > 🚨
22>
33> sqlc is ** very new** and under rapid development.
44>
55> The code it generates is correct and safe for production use, but
66> there is currently no guarantee of stability or backwards-compatibility of
77> the command line interface, configuration file format or generated code.
88>
9- > 🚨
9+ > 🚨
1010
1111# sqlc: A SQL Compiler
1212
1313> And lo, the Great One looked down upon the people and proclaimed:
14- >
14+ >
1515> "SQL is actually pretty great"
1616
1717sqlc generates ** fully-type safe idiomatic Go code** from SQL. Here's how it works:
@@ -56,7 +56,7 @@ CREATE TABLE authors (
5656
5757-- name: GetAuthor :one
5858SELECT * FROM authors
59- WHERE id = $1 ;
59+ WHERE id = $1 LIMIT 1 ;
6060
6161-- name: ListAuthors :many
6262SELECT * FROM authors
@@ -154,7 +154,7 @@ func (q *Queries) DeleteAuthor(ctx context.Context, id int64) error {
154154
155155const getAuthor = ` -- name: GetAuthor :one
156156SELECT id, name, bio FROM authors
157- WHERE id = $1
157+ WHERE id = $1 LIMIT 1
158158`
159159
160160func (q *Queries ) GetAuthor (ctx context .Context , id int64 ) (Author , error ) {
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ In PostgreSQL,
44[ ANY] ( https://www.postgresql.org/docs/current/functions-comparisons.html#id-1.5.8.28.16 )
55allows you to check if a value exists in an array expression. Queries using ANY
66with a single parameter will generate method signatures with slices as
7- arguments.
7+ arguments.
88
99``` sql
1010CREATE TABLE authors (
You can’t perform that action at this time.
0 commit comments