Refactor: Centralize App Startup and Config Loading (#33)
SonarQube Scan / SonarQube Trigger (push) Successful in 3m49s
SonarQube Scan / SonarQube Trigger (push) Successful in 3m49s
Reviewed-on: #33
This commit was merged in pull request #33.
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
// Code generated by sqlc. DO NOT EDIT.
|
||||
// versions:
|
||||
// sqlc v1.27.0
|
||||
|
||||
package repository
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/jackc/pgx/v5"
|
||||
"github.com/jackc/pgx/v5/pgconn"
|
||||
)
|
||||
|
||||
type DBTX interface {
|
||||
Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
|
||||
Query(context.Context, string, ...interface{}) (pgx.Rows, error)
|
||||
QueryRow(context.Context, string, ...interface{}) pgx.Row
|
||||
}
|
||||
|
||||
func New(db DBTX) *Queries {
|
||||
return &Queries{db: db}
|
||||
}
|
||||
|
||||
type Queries struct {
|
||||
db DBTX
|
||||
}
|
||||
|
||||
func (q *Queries) WithTx(tx pgx.Tx) *Queries {
|
||||
return &Queries{
|
||||
db: tx,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
// Code generated by sqlc. DO NOT EDIT.
|
||||
// versions:
|
||||
// sqlc v1.27.0
|
||||
|
||||
package repository
|
||||
|
||||
import (
|
||||
"github.com/jackc/pgx/v5/pgtype"
|
||||
)
|
||||
|
||||
type Account struct {
|
||||
ID string
|
||||
AccountID string
|
||||
ProviderID string
|
||||
UserID string
|
||||
AccessToken pgtype.Text
|
||||
RefreshToken pgtype.Text
|
||||
IDToken pgtype.Text
|
||||
AccessTokenExpiresAt pgtype.Timestamp
|
||||
RefreshTokenExpiresAt pgtype.Timestamp
|
||||
Scope pgtype.Text
|
||||
Password pgtype.Text
|
||||
CreatedAt pgtype.Timestamp
|
||||
UpdatedAt pgtype.Timestamp
|
||||
}
|
||||
|
||||
type Session struct {
|
||||
ID string
|
||||
ExpiresAt pgtype.Timestamp
|
||||
Token string
|
||||
CreatedAt pgtype.Timestamp
|
||||
UpdatedAt pgtype.Timestamp
|
||||
IpAddress pgtype.Text
|
||||
UserAgent pgtype.Text
|
||||
UserID string
|
||||
}
|
||||
|
||||
type User struct {
|
||||
ID string
|
||||
SshIdentifier string
|
||||
Name string
|
||||
Email string
|
||||
EmailVerified bool
|
||||
Image pgtype.Text
|
||||
CreatedAt pgtype.Timestamp
|
||||
UpdatedAt pgtype.Timestamp
|
||||
}
|
||||
|
||||
type Verification struct {
|
||||
ID string
|
||||
Identifier string
|
||||
Value string
|
||||
ExpiresAt pgtype.Timestamp
|
||||
CreatedAt pgtype.Timestamp
|
||||
UpdatedAt pgtype.Timestamp
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
// Code generated by sqlc. DO NOT EDIT.
|
||||
// versions:
|
||||
// sqlc v1.27.0
|
||||
// source: query.sql
|
||||
|
||||
package repository
|
||||
|
||||
import (
|
||||
"context"
|
||||
)
|
||||
|
||||
const getVerifiedEmailBySSHIdentifier = `-- name: GetVerifiedEmailBySSHIdentifier :one
|
||||
SELECT email
|
||||
FROM public."user"
|
||||
WHERE ssh_identifier = $1
|
||||
AND email_verified = true
|
||||
`
|
||||
|
||||
func (q *Queries) GetVerifiedEmailBySSHIdentifier(ctx context.Context, sshIdentifier string) (string, error) {
|
||||
row := q.db.QueryRow(ctx, getVerifiedEmailBySSHIdentifier, sshIdentifier)
|
||||
var email string
|
||||
err := row.Scan(&email)
|
||||
return email, err
|
||||
}
|
||||
Reference in New Issue
Block a user