Skip to content

Commit 1f7d26c

Browse files
committed
prepare queries for payroll update
1 parent 6ce6f2c commit 1f7d26c

File tree

3 files changed

+37
-14
lines changed

3 files changed

+37
-14
lines changed

internal/db/queries/payroll.sql

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,11 @@ INSERT INTO payroll (
88
-- name: UpdatePayroll :exec
99
UPDATE payroll
1010
SET
11-
employee_id = $2,
12-
basic_salary = $3,
13-
tin = $4,
14-
bank_name = $5,
15-
bank_account = $6,
16-
is_active = $7,
11+
basic_salary = $2,
12+
tin = $3,
13+
bank_name = $4,
14+
bank_account = $5,
15+
is_active = $6,
1716
updated_at = NOW()
1817
WHERE id = $1;
1918

@@ -71,3 +70,7 @@ WHERE id = $1;
7170
SELECT EXISTS (
7271
SELECT 1 FROM payroll WHERE employee_id = $1
7372
);
73+
74+
-- name: JustGetPayroll :one
75+
SELECT *
76+
FROM payroll;

internal/db/sqlc/payroll.sql.go

Lines changed: 27 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/db/sqlc/querier.go

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)