-
Notifications
You must be signed in to change notification settings - Fork 930
-
CREATE TABLE users (
id bigserial PRIMARY KEY,
first_name VARCHAR(255),
last_name VARCHAR(255),
email VARCHAR(255) NOT NULL,
password VARCHAR(255) NOT NULL,
created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP
);
-- name: GetUserByID :one
SELECT * FROM users
WHERE id = 1ドル LIMIT 1;
Generates this:
type User struct {
ID int64
FirstName sql.NullString
LastName sql.NullString
Email string
Password string
CreatedAt sql.NullTime
UpdatedAt time.Time
}
Beta Was this translation helpful? Give feedback.
All reactions
Hmm... seems like I just misunderstood what sql.NullString is used for.
Please disregard.
Replies: 1 comment
-
Hmm... seems like I just misunderstood what sql.NullString is used for.
Please disregard.
Beta Was this translation helpful? Give feedback.