mirror of
https://github.com/Kyren223/eko.git
synced 2025-12-28 00:44:38 +00:00
51 lines
1010 B
Go
51 lines
1010 B
Go
// Code generated by sqlc. DO NOT EDIT.
|
|
// versions:
|
|
// sqlc v1.29.0
|
|
// source: device_analytics.sql
|
|
|
|
package data
|
|
|
|
import (
|
|
"context"
|
|
)
|
|
|
|
const setDeviceAnalytics = `-- name: SetDeviceAnalytics :one
|
|
INSERT INTO device_analytics (
|
|
device_id, os, arch, term, colorterm
|
|
) VALUES (
|
|
?1, ?2, ?3, ?4, ?5
|
|
)
|
|
ON CONFLICT DO
|
|
UPDATE SET
|
|
os = EXCLUDED.os, arch = EXCLUDED.arch, term = EXCLUDED.term, colorterm = EXCLUDED.colorterm
|
|
WHERE device_id = EXCLUDED.device_id
|
|
RETURNING device_id, os, arch, term, colorterm
|
|
`
|
|
|
|
type SetDeviceAnalyticsParams struct {
|
|
DeviceID string
|
|
Os *string
|
|
Arch *string
|
|
Term *string
|
|
Colorterm *string
|
|
}
|
|
|
|
func (q *Queries) SetDeviceAnalytics(ctx context.Context, arg SetDeviceAnalyticsParams) (DeviceAnalytic, error) {
|
|
row := q.db.QueryRowContext(ctx, setDeviceAnalytics,
|
|
arg.DeviceID,
|
|
arg.Os,
|
|
arg.Arch,
|
|
arg.Term,
|
|
arg.Colorterm,
|
|
)
|
|
var i DeviceAnalytic
|
|
err := row.Scan(
|
|
&i.DeviceID,
|
|
&i.Os,
|
|
&i.Arch,
|
|
&i.Term,
|
|
&i.Colorterm,
|
|
)
|
|
return i, err
|
|
}
|