Skip to content

Instantly share code, notes, and snippets.

View bcsmith2846's full-sized avatar

Brenden Smith bcsmith2846

View GitHub Profile
@bcsmith2846
bcsmith2846 / embed.sql
Created June 30, 2022 19:26
Embedded Structs with sqlc
-- name: ContactsByCustomerID :many
SELECT sqlc.embed(contacts),
sqlc.embed(customers),
sqlc.embed(addresses)
FROM
(
SELECT *
FROM addresses
WHERE addresses.id = contacts.address_id
) AS a,
@bcsmith2846
bcsmith2846 / Decimal.go
Last active June 7, 2022 13:29
Gravel Decimal and Currency Types
package domain
import (
"fmt"
"github.com/bojanz/currency"
"github.com/cockroachdb/apd"
)
/*