feat: update session + ps type overriding

This commit is contained in:
2025-06-11 18:48:41 +02:00
parent 38955ee4e6
commit f892f0da24
5 changed files with 98 additions and 52 deletions

View File

@ -10,7 +10,6 @@ import (
"time"
"github.com/google/uuid"
"github.com/jackc/pgx/v5/pgtype"
)
const createServiceSession = `-- name: CreateServiceSession :one
@ -27,15 +26,15 @@ RETURNING id, service_id, client_id, user_id, issued_at, expires_at, last_active
`
type CreateServiceSessionParams struct {
ServiceID uuid.UUID `json:"service_id"`
ClientID string `json:"client_id"`
UserID *uuid.UUID `json:"user_id"`
ExpiresAt *time.Time `json:"expires_at"`
LastActive *time.Time `json:"last_active"`
IpAddress pgtype.Text `json:"ip_address"`
UserAgent *string `json:"user_agent"`
AccessTokenID *uuid.UUID `json:"access_token_id"`
RefreshTokenID *uuid.UUID `json:"refresh_token_id"`
ServiceID uuid.UUID `json:"service_id"`
ClientID string `json:"client_id"`
UserID *uuid.UUID `json:"user_id"`
ExpiresAt *time.Time `json:"expires_at"`
LastActive *time.Time `json:"last_active"`
IpAddress *string `json:"ip_address"`
UserAgent *string `json:"user_agent"`
AccessTokenID *uuid.UUID `json:"access_token_id"`
RefreshTokenID *uuid.UUID `json:"refresh_token_id"`
}
func (q *Queries) CreateServiceSession(ctx context.Context, arg CreateServiceSessionParams) (ServiceSession, error) {