Move all tables into a schema
All checks were successful
Build and Push Docker Image / build (push) Successful in 7m19s
All checks were successful
Build and Push Docker Image / build (push) Successful in 7m19s
This commit is contained in:
@@ -11,18 +11,18 @@ import (
|
||||
)
|
||||
|
||||
const getClicks = `-- name: GetClicks :many
|
||||
SELECT click_id, url_id, clicked_at, referrer, user_agent, ip_address FROM click_logs
|
||||
SELECT click_id, url_id, clicked_at, referrer, user_agent, ip_address FROM lss.click_logs
|
||||
`
|
||||
|
||||
func (q *Queries) GetClicks(ctx context.Context) ([]ClickLog, error) {
|
||||
func (q *Queries) GetClicks(ctx context.Context) ([]LssClickLog, error) {
|
||||
rows, err := q.db.QueryContext(ctx, getClicks)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
var items []ClickLog
|
||||
var items []LssClickLog
|
||||
for rows.Next() {
|
||||
var i ClickLog
|
||||
var i LssClickLog
|
||||
if err := rows.Scan(
|
||||
&i.ClickID,
|
||||
&i.UrlID,
|
||||
@@ -45,7 +45,7 @@ func (q *Queries) GetClicks(ctx context.Context) ([]ClickLog, error) {
|
||||
}
|
||||
|
||||
const trackClick = `-- name: TrackClick :one
|
||||
INSERT INTO click_logs (url_id, referrer, user_agent, ip_address)
|
||||
INSERT INTO lss.click_logs (url_id, referrer, user_agent, ip_address)
|
||||
VALUES (
|
||||
$1,
|
||||
$2,
|
||||
@@ -62,14 +62,14 @@ type TrackClickParams struct {
|
||||
IpAddress sql.NullString
|
||||
}
|
||||
|
||||
func (q *Queries) TrackClick(ctx context.Context, arg TrackClickParams) (ClickLog, error) {
|
||||
func (q *Queries) TrackClick(ctx context.Context, arg TrackClickParams) (LssClickLog, error) {
|
||||
row := q.db.QueryRowContext(ctx, trackClick,
|
||||
arg.UrlID,
|
||||
arg.Referrer,
|
||||
arg.UserAgent,
|
||||
arg.IpAddress,
|
||||
)
|
||||
var i ClickLog
|
||||
var i LssClickLog
|
||||
err := row.Scan(
|
||||
&i.ClickID,
|
||||
&i.UrlID,
|
||||
|
||||
Reference in New Issue
Block a user