Skip to content
New issue

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

sql\queries\users.sql:1:1: relation "users" does not exist #3372

Closed
kaliban2056 opened this issue May 10, 2024 · 2 comments
Closed

sql\queries\users.sql:1:1: relation "users" does not exist #3372

kaliban2056 opened this issue May 10, 2024 · 2 comments
Labels
bug Something isn't working triage New issues that hasn't been reviewed

Comments

@kaliban2056
Copy link

Version

1.26.0

What happened?

I encountered this error when I ran the command “sqlc generate”, this is the structure of the sql and yaml files.
image

Relevant log output

PS C:\Users\%USERNAME%\Documents\project_1> sqlc generate
# package 
sql\queries\users.sql:1:1: relation "users" does not exist

Database schema

-- +goose up

CREATE TABLE users (
     id UUID PRIMARY KEY,
     created_at TIMESTAMP NOT NULL,
     updated_at TIMESTAMP NOT NULL,
     name TEXT NOT NULL
);

-- +goose down

DROP TABLE USERS;

SQL queries

-- name: CreateUser :one
INSERT INTO users (id, created_at, updated_at, name)
VALUES ($1, $2, $3, $4)
RETURNING *;

Configuration

version: "2"
sql:
  - schema: "sql/schema"
    queries: "sql/queries"
    engine: "postgresql"
    gen:
      go:
        out: "internal/database"

Playground URL

No response

What operating system are you using?

Windows

What database engines are you using?

PostgreSQL

What type of code are you generating?

Go

@kaliban2056 kaliban2056 added bug Something isn't working triage New issues that hasn't been reviewed labels May 10, 2024
@stnokott
Copy link

Did you try replacing -- +goose up with -- +goose Up (and the same for Down).

That's what the official DDL examples show.

@kaliban2056
Copy link
Author

the only thing, I didn't tried, it works, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage New issues that hasn't been reviewed
Projects
None yet
Development

No branches or pull requests

2 participants