We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1.26.0
-- name: GetJobPostings :many SELECT * FROM JobPostings WHERE created_at >= ? AND job_type = COALESCE(sqlc.narg ('job_type'), job_type) AND salary >= COALESCE(sqlc.narg ('salary'), salary) AND gender = COALESCE(sqlc.narg ('gender'), gender) AND posting_type = COALESCE(sqlc.narg ('posting_type'), posting_type) AND max_age = COALESCE(sqlc.narg ('max_age'), max_age) AND work_hours_type = COALESCE(sqlc.narg ('work_hours_type'), work_hours_type) AND work_days_type = COALESCE(sqlc.narg ('work_days_type'), work_days_type) ORDER BY created_at DESC LIMIT ? OFFSET ?;
generated:
type GetJobPostingsParams struct { CreatedAt time.Time JobType sql.NullInt64 Salary sql.NullInt64 Gender sql.NullString PostingType sql.NullInt64 MaxAge sql.NullInt64 WorkHoursType sql.NullInt64 WorkDaysType sql.NullInt64 Limit int64 Offset int64 }
my code:
postings, err := p.DB.GetJobPostings(r.Context(), database.GetJobPostingsParams{ CreatedAt: time.Now().AddDate(0, 0, -7), JobType: sql.NullInt64{Int64: 0, Valid: false}, Salary: sql.NullInt64{Int64: 0, Valid: false}, Gender: sql.NullString{String: "", Valid: false}, PostingType: sql.NullInt64{Int64: 0, Valid: false}, MaxAge: sql.NullInt64{Int64: 0, Valid: false}, WorkHoursType: sql.NullInt64{Int64: 0, Valid: false}, WorkDaysType: sql.NullInt64{Int64: 0, Valid: false}, Offset: 0, Limit: 4, }) if err != nil { fmt.Printf("Error: %v\n", err) http.Error(w, "Internal Server Error", http.StatusInternalServerError) return }
Error: not enough args to execute query: want 12 got 10
CREATE TABLE JobPostings ( id INTEGER PRIMARY KEY AUTOINCREMENT, user_id INTEGER NOT NULL, created_at TIMESTAMP NOT NULL, updated_at TIMESTAMP NOT NULL, title TEXT NOT NULL, short_description TEXT NOT NULL, full_description TEXT, job_type INTEGER NOT NULL, salary INTEGER, salary_type TEXT, gender TEXT, posting_type INTEGER NOT NULL, max_age INTEGER, work_hours_type INTEGER, work_days_type INTEGER, work_hours_description TEXT, address TEXT, map_url TEXT, foreign key (user_id) references Users (id) );
version: "2" sql: - engine: "sqlite" queries: "sql/queries" schema: "sql/schema" gen: go: out: "internal/database"
No response
macOS
SQLite
Go
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Version
1.26.0
What happened?
generated:
my code:
Relevant log output
Database schema
SQL queries
Configuration
Playground URL
No response
What operating system are you using?
macOS
What database engines are you using?
SQLite
What type of code are you generating?
Go
The text was updated successfully, but these errors were encountered: