55 lines
1.6 KiB
Go
55 lines
1.6 KiB
Go
// Code generated by sqlc. DO NOT EDIT.
|
|
// versions:
|
|
// sqlc v1.29.0
|
|
// source: payment_mappings.sql
|
|
|
|
package stripe
|
|
|
|
import (
|
|
"context"
|
|
"database/sql"
|
|
)
|
|
|
|
const getPaymentMappingByStripePaymentIntentID = `-- name: GetPaymentMappingByStripePaymentIntentID :one
|
|
SELECT payment_id, stripe_payment_intent_id, sync_status, created_at, updated_at FROM stripe.payment_mappings
|
|
WHERE stripe_payment_intent_id = $1
|
|
`
|
|
|
|
func (q *Queries) GetPaymentMappingByStripePaymentIntentID(ctx context.Context, stripePaymentIntentID sql.NullString) (PaymentMapping, error) {
|
|
row := q.db.QueryRowContext(ctx, getPaymentMappingByStripePaymentIntentID, stripePaymentIntentID)
|
|
var i PaymentMapping
|
|
err := row.Scan(
|
|
&i.PaymentID,
|
|
&i.StripePaymentIntentID,
|
|
&i.SyncStatus,
|
|
&i.CreatedAt,
|
|
&i.UpdatedAt,
|
|
)
|
|
return i, err
|
|
}
|
|
|
|
const insertPaymentMapping = `-- name: InsertPaymentMapping :one
|
|
INSERT INTO stripe.payment_mappings (payment_id, stripe_payment_intent_id, sync_status)
|
|
VALUES ($1, $2, $3)
|
|
RETURNING payment_id, stripe_payment_intent_id, sync_status, created_at, updated_at
|
|
`
|
|
|
|
type InsertPaymentMappingParams struct {
|
|
PaymentID string `json:"payment_id"`
|
|
StripePaymentIntentID sql.NullString `json:"stripe_payment_intent_id"`
|
|
SyncStatus string `json:"sync_status"`
|
|
}
|
|
|
|
func (q *Queries) InsertPaymentMapping(ctx context.Context, arg InsertPaymentMappingParams) (PaymentMapping, error) {
|
|
row := q.db.QueryRowContext(ctx, insertPaymentMapping, arg.PaymentID, arg.StripePaymentIntentID, arg.SyncStatus)
|
|
var i PaymentMapping
|
|
err := row.Scan(
|
|
&i.PaymentID,
|
|
&i.StripePaymentIntentID,
|
|
&i.SyncStatus,
|
|
&i.CreatedAt,
|
|
&i.UpdatedAt,
|
|
)
|
|
return i, err
|
|
}
|