Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions internal/endtoend/testdata/multibyte_comment/sqlite/go/db.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions internal/endtoend/testdata/multibyte_comment/sqlite/go/models.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions internal/endtoend/testdata/multibyte_comment/sqlite/query.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
-- Multi-byte UTF-8 in comments must not shift the byte offsets used to slice
-- query text out of the source file (#4523, #4235, #4372).

-- name: ListItems :many
-- an em dash right here — must not truncate the ORDER BY below
SELECT id, name, cap_read
FROM items WHERE cap_read = 'anonymous' ORDER BY name;

-- section — divider between queries

-- name: UpdateItem :exec
UPDATE items SET name = ? WHERE id = ?;

-- name: CreateItem :exec
-- 当新建条目时,需要写入名称和权限
INSERT INTO items (name, cap_read)
VALUES (?, ?);

-- name: DeleteItem :one
DELETE FROM items WHERE id = ? RETURNING id, name, cap_read;
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
CREATE TABLE items (
id INTEGER PRIMARY KEY,
name TEXT NOT NULL,
cap_read TEXT NOT NULL
);
12 changes: 12 additions & 0 deletions internal/endtoend/testdata/multibyte_comment/sqlite/sqlc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"version": "1",
"packages": [
{
"path": "go",
"engine": "sqlite",
"name": "querytest",
"schema": "schema.sql",
"queries": "query.sql"
}
]
}
Loading