-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
920 additions
and
240 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,22 @@ | ||
-- name: VerifyToken :one | ||
SELECT COUNT(*) FROM users WHERE token = $1; | ||
SELECT COUNT(*) FROM ninja WHERE token = $1; | ||
-- name: GetOrder :one | ||
SELECT * FROM orders WHERE id = $1; | ||
SELECT * FROM position WHERE id = $1; | ||
-- name: InsertOrder :exec | ||
INSERT INTO orders (amount, currency, created_at, expiry_at, premium, payment) VALUES ($1, $2, $3, $4, $5, $6) RETURNING id; | ||
INSERT INTO position (amount, currency, created_at, expiry_at, premium, payment) VALUES ($1, $2, $3, $4, $5, $6) RETURNING id; | ||
-- name: PatchOrder :exec | ||
UPDATE orders SET amount = $1, currency = $2, created_at = $3, expiry_at = $4, premium = $5, payment = $6 WHERE id = $7; | ||
UPDATE position SET amount = $1, currency = $2, created_at = $3, expiry_at = $4, premium = $5, payment = $6 WHERE id = $7; | ||
-- name: DeleteOrder :exec | ||
DELETE FROM orders WHERE id = $1; | ||
DELETE FROM position WHERE id = $1; | ||
-- name: CountOrders :one | ||
SELECT COUNT(*) FROM orders; | ||
-- name: CreateTrade :one | ||
SELECT COUNT(*) FROM position; | ||
-- name: CreateTrade :exec | ||
UPDATE position SET order_status = $1, buyer = $2, seller = $3, trade_created_at = NOW(), trade_update_at = NOW() WHERE id = $4; | ||
-- name: DeleteTrade :exec | ||
UPDATE position SET order_status = $1, buyer = NULL, seller = NULL, trade_created_at = NULL, trade_update_at = NULL WHERE id = $2; | ||
-- name: LockEscrow :exec | ||
UPDATE position SET order_status = $1, escrow_buyer_key = $2, escrow_seller_key = $3, escrow_created_at = NOW(), escrow_updated_at = NOW(), trade_update_at = NOW() WHERE id = $4; | ||
-- name: ReleaseEscrow :exec | ||
UPDATE position SET order_status = $1, escrow_buyer_key = NULL, escrow_seller_key = NULL, escrow_created_at = NULL, escrow_updated_at = NULL, trade_update_at = NOW() WHERE id = $2; | ||
-- name: RaiseDispute :exec | ||
-- name: ResolveDispute :exec |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.