-
Notifications
You must be signed in to change notification settings - Fork 962
Closed
@Stan-breaks
Description
Version
1.30.0
What happened?
I ran sqlc generate, and it failed with the error
But I only have one .sql file (sqlc/query.sql), and inside it there’s only a single query named CreateUser and the other queries. I checked the whole project, and there are no other .sql files or duplicate query names anywhere.
Relevant log output
sqlc/query.sql:1:1: duplicate query name: CreateUser
Database schema
--users CREATE TABLE users ( id INTEGER PRIMARY KEY AUTOINCREMENT, email TEXT NOT NULL UNIQUE, phone TEXT NOT NULL UNIQUE, role TEXT NOT NULL, fullName TEXT NOT NULL, password TEXT NOT NULL ); --bikes CREATE TABLE bikes( id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL UNIQUE, model TEXT NOT NULL, class INTEGER NOT NULL, imagePath TEXT NOT NULL )
SQL queries
-- name: CreateUser :one INSERT INTO users( fullname, email, phone, role, password ) VALUES (?,?,?,?,?) RETURNING *; -- name: GetUSer :one SELECT * FROM users WHERE email =? LIMIT 1; -- name: CreateBike :one INSERT INTO bikes( name, model, class, imagePath ) VALUES (?,?,?,?) RETURNING *; -- name: GetAllBikes :many SELECT * FROM bikes; -- name: DeleteBike :exec DELETE FROM bikes WHERE name=? -- name: GetBike :one SELECT * FROM bikes where name=? LIMIT 1;
Configuration
version: "2" sql: - engine: "sqlite" queries: "sqlc/query.sql" schema: "sqlc/schema.sql" gen: go: package: "database" out: "database"
Playground URL
No response
What operating system are you using?
Linux
What database engines are you using?
SQLite
What type of code are you generating?
Go