sqlc

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 22, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewStore

func NewStore(dsn string) (s rocketride.Datastore, err error)

Types

type AuditRecord

type AuditRecord struct {
	ID           int64
	Action       string
	CreatedAt    time.Time
	Data         json.RawMessage
	OriginIp     string
	ResourceID   int64
	ResourceType string
	UserID       int64
}

type CreateAuditRecordParams

type CreateAuditRecordParams struct {
	Action       string
	CreatedAt    time.Time
	Data         json.RawMessage
	OriginIp     string
	ResourceID   int64
	ResourceType string
	UserID       int64
}

type CreateIdempotencyKeyParams

type CreateIdempotencyKeyParams struct {
	CreatedAt      time.Time
	IdempotencyKey string
	LastRunAt      time.Time
	LockedAt       sql.NullTime
	RequestMethod  string
	RequestParams  json.RawMessage
	RequestPath    string
	ResponseCode   sql.NullInt32
	ResponseBody   pqtype.NullRawMessage
	RecoveryPoint  string
	UserID         int64
}

type CreateRideParams

type CreateRideParams struct {
	CreatedAt        time.Time
	IdempotencyKeyID sql.NullInt64
	OriginLat        float64
	OriginLon        float64
	TargetLat        float64
	TargetLon        float64
	StripeChargeID   sql.NullString
	UserID           int64
}

type CreateStagedJobParams

type CreateStagedJobParams struct {
	JobName string
	JobArgs json.RawMessage
}

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type GetIdempotencyKeyParams

type GetIdempotencyKeyParams struct {
	UserID         int64
	IdempotencyKey string
}

type IdempotencyKey

type IdempotencyKey struct {
	ID             int64
	CreatedAt      time.Time
	IdempotencyKey string
	LastRunAt      time.Time
	LockedAt       sql.NullTime
	RequestMethod  string
	RequestParams  json.RawMessage
	RequestPath    string
	ResponseCode   sql.NullInt32
	ResponseBody   pqtype.NullRawMessage
	RecoveryPoint  string
	UserID         int64
}

type Queries

type Queries struct {
	// contains filtered or unexported fields
}

func New

func New(db DBTX) *Queries

func (*Queries) CreateAuditRecord

func (q *Queries) CreateAuditRecord(ctx context.Context, arg CreateAuditRecordParams) (AuditRecord, error)

func (*Queries) CreateIdempotencyKey

func (q *Queries) CreateIdempotencyKey(ctx context.Context, arg CreateIdempotencyKeyParams) (IdempotencyKey, error)

func (*Queries) CreateRide

func (q *Queries) CreateRide(ctx context.Context, arg CreateRideParams) (Ride, error)

func (*Queries) CreateStagedJob

func (q *Queries) CreateStagedJob(ctx context.Context, arg CreateStagedJobParams) (StagedJob, error)

func (*Queries) GetIdempotencyKey

func (q *Queries) GetIdempotencyKey(ctx context.Context, arg GetIdempotencyKeyParams) (IdempotencyKey, error)

func (*Queries) GetRideByID

func (q *Queries) GetRideByID(ctx context.Context, id int64) (Ride, error)

func (*Queries) GetRideByIdempotencyKeyID

func (q *Queries) GetRideByIdempotencyKeyID(ctx context.Context, idempotencyKeyID sql.NullInt64) (Ride, error)

func (*Queries) GetUserByEmail

func (q *Queries) GetUserByEmail(ctx context.Context, email string) (User, error)

func (*Queries) GetUserByID

func (q *Queries) GetUserByID(ctx context.Context, id int64) (User, error)

func (*Queries) UpdateIdempotencyKey

func (q *Queries) UpdateIdempotencyKey(ctx context.Context, arg UpdateIdempotencyKeyParams) (IdempotencyKey, error)

func (*Queries) UpdateRide

func (q *Queries) UpdateRide(ctx context.Context, arg UpdateRideParams) (Ride, error)

func (*Queries) WithTx

func (q *Queries) WithTx(tx *sql.Tx) *Queries

type Ride

type Ride struct {
	ID               int64
	CreatedAt        time.Time
	IdempotencyKeyID sql.NullInt64
	OriginLat        float64
	OriginLon        float64
	TargetLat        float64
	TargetLon        float64
	StripeChargeID   sql.NullString
	UserID           int64
}

type StagedJob

type StagedJob struct {
	ID      int64
	JobName string
	JobArgs json.RawMessage
}

type UpdateIdempotencyKeyParams

type UpdateIdempotencyKeyParams struct {
	ID            int64
	LastRunAt     time.Time
	LockedAt      sql.NullTime
	ResponseCode  sql.NullInt32
	ResponseBody  pqtype.NullRawMessage
	RecoveryPoint string
}

type UpdateRideParams

type UpdateRideParams struct {
	ID             int64
	StripeChargeID sql.NullString
}

type User

type User struct {
	ID               int64
	Email            string
	StripeCustomerID string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL