snapshot of https://github.com/sqlc-dev/sqlc.git (main, 2026-09-16; blobs > 131072B omitted)
Some checks failed
kotlin / test (push) Has been skipped
python / test (push) Has been skipped
typescript / test (push) Has been skipped
go / build darwin/amd64 (push) Has been cancelled
go / build linux/amd64 (push) Has been cancelled
go / build windows/amd64 (push) Has been cancelled
go / build darwin/arm64 (push) Has been cancelled
go / build linux/arm64 (push) Has been cancelled
go / build windows/arm64 (push) Has been cancelled
go / test (push) Has been cancelled
go / vuln_check (push) Has been cancelled

This commit is contained in:
upstream-mirror
2026-09-16 02:17:34 +05:00
commit 0f4df23290
7340 changed files with 238743 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.31.1
package querytest
import (
"context"
"database/sql"
)
type DBTX interface {
ExecContext(context.Context, string, ...any) (sql.Result, error)
PrepareContext(context.Context, string) (*sql.Stmt, error)
QueryContext(context.Context, string, ...any) (*sql.Rows, error)
QueryRowContext(context.Context, string, ...any) *sql.Row
}
func New(db DBTX) *Queries {
return &Queries{db: db}
}
type Queries struct {
db DBTX
}
func (q *Queries) WithTx(tx *sql.Tx) *Queries {
return &Queries{
db: tx,
}
}

View File

@@ -0,0 +1,24 @@
// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.31.1
package querytest
import (
"database/sql"
)
type Author struct {
ID int64
Name sql.NullString
}
type Book struct {
ID int64
Title sql.NullString
}
type User struct {
ID int64
Name sql.NullString
}

View File

@@ -0,0 +1,183 @@
// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.31.1
// source: query.sql
package querytest
import (
"context"
"database/sql"
)
const deleteAuthor = `-- name: DeleteAuthor :exec
DELETE FROM "Authors" WHERE id = ?
`
func (q *Queries) DeleteAuthor(ctx context.Context, id int64) error {
_, err := q.db.ExecContext(ctx, deleteAuthor, id)
return err
}
const deleteBook = `-- name: DeleteBook :exec
DELETE FROM books WHERE id = ?
`
func (q *Queries) DeleteBook(ctx context.Context, id int64) error {
_, err := q.db.ExecContext(ctx, deleteBook, id)
return err
}
const deleteUser = `-- name: DeleteUser :exec
DELETE FROM users WHERE id = ?
`
func (q *Queries) DeleteUser(ctx context.Context, id int64) error {
_, err := q.db.ExecContext(ctx, deleteUser, id)
return err
}
const deleteUserMixedCase = `-- name: DeleteUserMixedCase :exec
DELETE FROM users WHERE id = ?
`
func (q *Queries) DeleteUserMixedCase(ctx context.Context, id int64) error {
_, err := q.db.ExecContext(ctx, deleteUserMixedCase, id)
return err
}
const getAuthor = `-- name: GetAuthor :one
SELECT id, name FROM "Authors" WHERE id = ?
`
func (q *Queries) GetAuthor(ctx context.Context, id int64) (Author, error) {
row := q.db.QueryRowContext(ctx, getAuthor, id)
var i Author
err := row.Scan(&i.ID, &i.Name)
return i, err
}
const getBook = `-- name: GetBook :one
SELECT id, title FROM books WHERE id = ?
`
func (q *Queries) GetBook(ctx context.Context, id int64) (Book, error) {
row := q.db.QueryRowContext(ctx, getBook, id)
var i Book
err := row.Scan(&i.ID, &i.Title)
return i, err
}
const getUser = `-- name: GetUser :one
SELECT id, name FROM users WHERE id = ?
`
func (q *Queries) GetUser(ctx context.Context, id int64) (User, error) {
row := q.db.QueryRowContext(ctx, getUser, id)
var i User
err := row.Scan(&i.ID, &i.Name)
return i, err
}
const getUserMixedCase = `-- name: GetUserMixedCase :one
SELECT id, name FROM users WHERE id = ?
`
func (q *Queries) GetUserMixedCase(ctx context.Context, id int64) (User, error) {
row := q.db.QueryRowContext(ctx, getUserMixedCase, id)
var i User
err := row.Scan(&i.ID, &i.Name)
return i, err
}
const insertAuthor = `-- name: InsertAuthor :exec
INSERT INTO "Authors" (name) VALUES (?)
`
func (q *Queries) InsertAuthor(ctx context.Context, name sql.NullString) error {
_, err := q.db.ExecContext(ctx, insertAuthor, name)
return err
}
const insertBook = `-- name: InsertBook :exec
INSERT INTO books (title) VALUES (?)
`
func (q *Queries) InsertBook(ctx context.Context, title sql.NullString) error {
_, err := q.db.ExecContext(ctx, insertBook, title)
return err
}
const insertUser = `-- name: InsertUser :exec
INSERT INTO users (name) VALUES (?)
`
func (q *Queries) InsertUser(ctx context.Context, name sql.NullString) error {
_, err := q.db.ExecContext(ctx, insertUser, name)
return err
}
const insertUserMixedCase = `-- name: InsertUserMixedCase :exec
INSERT INTO users (name) VALUES (?)
`
func (q *Queries) InsertUserMixedCase(ctx context.Context, name sql.NullString) error {
_, err := q.db.ExecContext(ctx, insertUserMixedCase, name)
return err
}
const updateAuthor = `-- name: UpdateAuthor :exec
UPDATE "Authors" SET name = ? WHERE id = ?
`
type UpdateAuthorParams struct {
Name sql.NullString
ID int64
}
func (q *Queries) UpdateAuthor(ctx context.Context, arg UpdateAuthorParams) error {
_, err := q.db.ExecContext(ctx, updateAuthor, arg.Name, arg.ID)
return err
}
const updateBook = `-- name: UpdateBook :exec
UPDATE books SET title = ? WHERE id = ?
`
type UpdateBookParams struct {
Title sql.NullString
ID int64
}
func (q *Queries) UpdateBook(ctx context.Context, arg UpdateBookParams) error {
_, err := q.db.ExecContext(ctx, updateBook, arg.Title, arg.ID)
return err
}
const updateUser = `-- name: UpdateUser :exec
UPDATE users SET name = ? WHERE id = ?
`
type UpdateUserParams struct {
Name sql.NullString
ID int64
}
func (q *Queries) UpdateUser(ctx context.Context, arg UpdateUserParams) error {
_, err := q.db.ExecContext(ctx, updateUser, arg.Name, arg.ID)
return err
}
const updateUserMixedCase = `-- name: UpdateUserMixedCase :exec
UPDATE users SET name = ? WHERE id = ?
`
type UpdateUserMixedCaseParams struct {
Name sql.NullString
ID int64
}
func (q *Queries) UpdateUserMixedCase(ctx context.Context, arg UpdateUserMixedCaseParams) error {
_, err := q.db.ExecContext(ctx, updateUserMixedCase, arg.Name, arg.ID)
return err
}