Files
MonkeyCode/monkeyai/backend/internal/model/sqlc/query.sql.go
T
monster b65cc80b16 feat(admin): align resource pages with lazy loading, search and pagination
Apply the shared 48-item list layout to connectors, experts, skills, models and mock knowledge bases. Fetch ownership pages on demand, search on Enter, keep pagination below ScrollArea and preserve editor snapshots during reloads. Add filtered model cursor pagination and PostgreSQL coverage for each resource.
2026-10-15 20:11:56 +08:00

943 lines
22 KiB
Go

// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.30.0
// source: query.sql
package sqlc
import (
"context"
"time"
"github.com/jackc/pgx/v5/pgconn"
)
const createModel = `-- name: CreateModel :one
INSERT INTO models (ownership_type, owner_user_id, model_id, display_name, protocol, base_url, api_key,
advanced_config, credit_multiplier, kind, provider, provider_options, image_config, image_pricing,
video_config, video_pricing, proxy_id, enabled)
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, TRUE)
RETURNING
id, ownership_type, owner_user_id, model_id, display_name, protocol, base_url, api_key, advanced_config, credit_multiplier, enabled, created_at, updated_at, deleted_at, kind, provider, provider_options, image_config, image_pricing, video_config, video_pricing, proxy_id
`
type CreateModelParams struct {
OwnershipType string
OwnerUserID string
ModelID string
DisplayName string
Protocol string
BaseUrl string
ApiKey string
AdvancedConfig []byte
CreditMultiplier float64
Kind string
Provider string
ProviderOptions []byte
ImageConfig []byte
ImagePricing []byte
VideoConfig []byte
VideoPricing []byte
ProxyID string
}
func (q *Queries) CreateModel(ctx context.Context, arg CreateModelParams) (Model, error) {
row := q.db.QueryRow(ctx, createModel,
arg.OwnershipType,
arg.OwnerUserID,
arg.ModelID,
arg.DisplayName,
arg.Protocol,
arg.BaseUrl,
arg.ApiKey,
arg.AdvancedConfig,
arg.CreditMultiplier,
arg.Kind,
arg.Provider,
arg.ProviderOptions,
arg.ImageConfig,
arg.ImagePricing,
arg.VideoConfig,
arg.VideoPricing,
arg.ProxyID,
)
var i Model
err := row.Scan(
&i.ID,
&i.OwnershipType,
&i.OwnerUserID,
&i.ModelID,
&i.DisplayName,
&i.Protocol,
&i.BaseUrl,
&i.ApiKey,
&i.AdvancedConfig,
&i.CreditMultiplier,
&i.Enabled,
&i.CreatedAt,
&i.UpdatedAt,
&i.DeletedAt,
&i.Kind,
&i.Provider,
&i.ProviderOptions,
&i.ImageConfig,
&i.ImagePricing,
&i.VideoConfig,
&i.VideoPricing,
&i.ProxyID,
)
return i, err
}
const deleteGrants = `-- name: DeleteGrants :execresult
DELETE FROM resource_access_grants
WHERE resource_type = 'model'
AND resource_id = $1
`
func (q *Queries) DeleteGrants(ctx context.Context, resourceID string) (pgconn.CommandTag, error) {
return q.db.Exec(ctx, deleteGrants, resourceID)
}
const deleteModel = `-- name: DeleteModel :execresult
UPDATE
models
SET
deleted_at = now(),
enabled = FALSE,
updated_at = now()
WHERE
id = $1
AND ownership_type = $2
AND ($2 = 'system'
OR owner_user_id = NULLIF ($3::text, '')::uuid)
AND deleted_at IS NULL
`
type DeleteModelParams struct {
ID string
OwnershipType string
OwnerUserID string
}
func (q *Queries) DeleteModel(ctx context.Context, arg DeleteModelParams) (pgconn.CommandTag, error) {
return q.db.Exec(ctx, deleteModel, arg.ID, arg.OwnershipType, arg.OwnerUserID)
}
const getModel = `-- name: GetModel :one
SELECT
id, ownership_type, owner_user_id, model_id, display_name, protocol, base_url, api_key, advanced_config, credit_multiplier, enabled, created_at, updated_at, deleted_at, kind, provider, provider_options, image_config, image_pricing, video_config, video_pricing, proxy_id
FROM
models
WHERE
id = $1
AND deleted_at IS NULL
`
func (q *Queries) GetModel(ctx context.Context, id string) (Model, error) {
row := q.db.QueryRow(ctx, getModel, id)
var i Model
err := row.Scan(
&i.ID,
&i.OwnershipType,
&i.OwnerUserID,
&i.ModelID,
&i.DisplayName,
&i.Protocol,
&i.BaseUrl,
&i.ApiKey,
&i.AdvancedConfig,
&i.CreditMultiplier,
&i.Enabled,
&i.CreatedAt,
&i.UpdatedAt,
&i.DeletedAt,
&i.Kind,
&i.Provider,
&i.ProviderOptions,
&i.ImageConfig,
&i.ImagePricing,
&i.VideoConfig,
&i.VideoPricing,
&i.ProxyID,
)
return i, err
}
const grantAllUsers = `-- name: GrantAllUsers :execresult
INSERT INTO resource_access_grants (resource_type, resource_id, all_users, access_level, granted_by_user_id)
VALUES ('model', $1, true, 'read_only', $2)
`
type GrantAllUsersParams struct {
ResourceID string
GrantedByUserID string
}
func (q *Queries) GrantAllUsers(ctx context.Context, arg GrantAllUsersParams) (pgconn.CommandTag, error) {
return q.db.Exec(ctx, grantAllUsers, arg.ResourceID, arg.GrantedByUserID)
}
const grantGroup = `-- name: GrantGroup :execresult
INSERT INTO resource_access_grants (resource_type, resource_id, group_id, access_level, granted_by_user_id)
VALUES ('model', $1, $2, 'read_only', $3)
`
type GrantGroupParams struct {
ResourceID string
GroupID *string
GrantedByUserID string
}
func (q *Queries) GrantGroup(ctx context.Context, arg GrantGroupParams) (pgconn.CommandTag, error) {
return q.db.Exec(ctx, grantGroup, arg.ResourceID, arg.GroupID, arg.GrantedByUserID)
}
const grantUser = `-- name: GrantUser :execresult
INSERT INTO resource_access_grants (resource_type, resource_id, user_id, access_level, granted_by_user_id)
VALUES ('model', $1, $2, 'read_only', $3)
`
type GrantUserParams struct {
ResourceID string
UserID *string
GrantedByUserID string
}
func (q *Queries) GrantUser(ctx context.Context, arg GrantUserParams) (pgconn.CommandTag, error) {
return q.db.Exec(ctx, grantUser, arg.ResourceID, arg.UserID, arg.GrantedByUserID)
}
const listAvailable = `-- name: ListAvailable :many
WITH RECURSIVE user_groups (
group_id
) AS (
SELECT
id
FROM
GROUPS
WHERE
deleted_at IS NULL
AND id IN (
SELECT
group_id
FROM
group_users
WHERE
user_id = $3
AND removed_at IS NULL)
UNION
SELECT
parent.id
FROM
GROUPS g
JOIN user_groups ug ON ug.group_id = g.id
JOIN GROUPS parent ON parent.id = g.parent_id
WHERE
parent.deleted_at IS NULL
AND g.deleted_at IS NULL
)
SELECT
m.id, m.ownership_type, m.owner_user_id, m.model_id, m.display_name, m.protocol, m.base_url, m.api_key, m.advanced_config, m.credit_multiplier, m.enabled, m.created_at, m.updated_at, m.deleted_at, m.kind, m.provider, m.provider_options, m.image_config, m.image_pricing, m.video_config, m.video_pricing, m.proxy_id
FROM
models m
WHERE
m.enabled
AND m.deleted_at IS NULL
AND (m.ownership_type = 'user' OR $1::boolean)
AND (($2::boolean
AND m.ownership_type = 'system')
OR m.owner_user_id = $3
OR EXISTS (
SELECT
1
FROM
resource_access_grants rag
WHERE
rag.resource_type = 'model'
AND rag.resource_id = m.id
AND ((rag.all_users AND EXISTS (
SELECT 1 FROM users u WHERE u.id = $3 AND u.status = 'active' AND u.deleted_at IS NULL
))
OR rag.user_id = $3
OR rag.group_id IN (
SELECT
group_id
FROM
user_groups))))
ORDER BY
m.display_name,
m.id
`
type ListAvailableParams struct {
SystemAccess bool
IsAdmin bool
OwnerUserID string
}
func (q *Queries) ListAvailable(ctx context.Context, arg ListAvailableParams) ([]Model, error) {
rows, err := q.db.Query(ctx, listAvailable, arg.SystemAccess, arg.IsAdmin, arg.OwnerUserID)
if err != nil {
return nil, err
}
defer rows.Close()
items := []Model{}
for rows.Next() {
var i Model
if err := rows.Scan(
&i.ID,
&i.OwnershipType,
&i.OwnerUserID,
&i.ModelID,
&i.DisplayName,
&i.Protocol,
&i.BaseUrl,
&i.ApiKey,
&i.AdvancedConfig,
&i.CreditMultiplier,
&i.Enabled,
&i.CreatedAt,
&i.UpdatedAt,
&i.DeletedAt,
&i.Kind,
&i.Provider,
&i.ProviderOptions,
&i.ImageConfig,
&i.ImagePricing,
&i.VideoConfig,
&i.VideoPricing,
&i.ProxyID,
); err != nil {
return nil, err
}
items = append(items, i)
}
if err := rows.Err(); err != nil {
return nil, err
}
return items, nil
}
const listGrants = `-- name: ListGrants :many
SELECT
resource_id,
user_id,
group_id,
all_users
FROM
resource_access_grants
WHERE
resource_type = 'model'
AND resource_id::text = ANY ($1::text[])
ORDER BY
resource_id,
id
`
type ListGrantsRow struct {
ResourceID string
UserID *string
GroupID *string
AllUsers bool
}
func (q *Queries) ListGrants(ctx context.Context, dollar_1 []string) ([]ListGrantsRow, error) {
rows, err := q.db.Query(ctx, listGrants, dollar_1)
if err != nil {
return nil, err
}
defer rows.Close()
items := []ListGrantsRow{}
for rows.Next() {
var i ListGrantsRow
if err := rows.Scan(
&i.ResourceID,
&i.UserID,
&i.GroupID,
&i.AllUsers,
); err != nil {
return nil, err
}
items = append(items, i)
}
if err := rows.Err(); err != nil {
return nil, err
}
return items, nil
}
const listGroups = `-- name: ListGroups :many
SELECT
id,
parent_id,
name
FROM
GROUPS
WHERE
deleted_at IS NULL
ORDER BY
name,
id
`
type ListGroupsRow struct {
ID string
ParentID *string
Name string
}
func (q *Queries) ListGroups(ctx context.Context) ([]ListGroupsRow, error) {
rows, err := q.db.Query(ctx, listGroups)
if err != nil {
return nil, err
}
defer rows.Close()
items := []ListGroupsRow{}
for rows.Next() {
var i ListGroupsRow
if err := rows.Scan(&i.ID, &i.ParentID, &i.Name); err != nil {
return nil, err
}
items = append(items, i)
}
if err := rows.Err(); err != nil {
return nil, err
}
return items, nil
}
const listModels = `-- name: ListModels :many
SELECT
id, ownership_type, owner_user_id, model_id, display_name, protocol, base_url, api_key, advanced_config, credit_multiplier, enabled, created_at, updated_at, deleted_at, kind, provider, provider_options, image_config, image_pricing, video_config, video_pricing, proxy_id
FROM
models
WHERE
deleted_at IS NULL
AND ($1::text = ''
OR ownership_type = $1::text)
ORDER BY
created_at DESC
`
func (q *Queries) ListModels(ctx context.Context, dollar_1 string) ([]Model, error) {
rows, err := q.db.Query(ctx, listModels, dollar_1)
if err != nil {
return nil, err
}
defer rows.Close()
items := []Model{}
for rows.Next() {
var i Model
if err := rows.Scan(
&i.ID,
&i.OwnershipType,
&i.OwnerUserID,
&i.ModelID,
&i.DisplayName,
&i.Protocol,
&i.BaseUrl,
&i.ApiKey,
&i.AdvancedConfig,
&i.CreditMultiplier,
&i.Enabled,
&i.CreatedAt,
&i.UpdatedAt,
&i.DeletedAt,
&i.Kind,
&i.Provider,
&i.ProviderOptions,
&i.ImageConfig,
&i.ImagePricing,
&i.VideoConfig,
&i.VideoPricing,
&i.ProxyID,
); err != nil {
return nil, err
}
items = append(items, i)
}
if err := rows.Err(); err != nil {
return nil, err
}
return items, nil
}
const listPeople = `-- name: ListPeople :many
SELECT
m.id AS model_id,
u.id AS user_id,
u.name,
u.email,
TRUE AS creator
FROM
models m
JOIN users u ON u.id = m.owner_user_id
WHERE
m.id::text = ANY ($1::text[])
AND m.owner_user_id <> $2
UNION ALL
SELECT
m.id AS model_id,
u.id AS user_id,
u.name,
u.email,
FALSE AS creator
FROM
models m
JOIN resource_access_grants g ON g.resource_type = 'model'
AND g.resource_id = m.id
JOIN users u ON u.id = g.user_id
WHERE
m.id::text = ANY ($1::text[])
AND m.owner_user_id = $2
AND u.id <> $2
AND u.deleted_at IS NULL
ORDER BY
1,
3,
2
`
type ListPeopleParams struct {
ModelIds []string
OwnerUserID string
}
type ListPeopleRow struct {
ModelID string
UserID string
Name string
Email string
Creator bool
}
func (q *Queries) ListPeople(ctx context.Context, arg ListPeopleParams) ([]ListPeopleRow, error) {
rows, err := q.db.Query(ctx, listPeople, arg.ModelIds, arg.OwnerUserID)
if err != nil {
return nil, err
}
defer rows.Close()
items := []ListPeopleRow{}
for rows.Next() {
var i ListPeopleRow
if err := rows.Scan(
&i.ModelID,
&i.UserID,
&i.Name,
&i.Email,
&i.Creator,
); err != nil {
return nil, err
}
items = append(items, i)
}
if err := rows.Err(); err != nil {
return nil, err
}
return items, nil
}
const listUsers = `-- name: ListUsers :many
SELECT
id,
name,
email
FROM
users
WHERE
status = 'active'
AND deleted_at IS NULL
ORDER BY
name,
id
`
type ListUsersRow struct {
ID string
Name string
Email string
}
func (q *Queries) ListUsers(ctx context.Context) ([]ListUsersRow, error) {
rows, err := q.db.Query(ctx, listUsers)
if err != nil {
return nil, err
}
defer rows.Close()
items := []ListUsersRow{}
for rows.Next() {
var i ListUsersRow
if err := rows.Scan(&i.ID, &i.Name, &i.Email); err != nil {
return nil, err
}
items = append(items, i)
}
if err := rows.Err(); err != nil {
return nil, err
}
return items, nil
}
const lockOwned = `-- name: LockOwned :one
SELECT
id
FROM
models
WHERE
id = $1
AND owner_user_id = $2
AND ownership_type = 'user'
AND deleted_at IS NULL
FOR UPDATE
`
type LockOwnedParams struct {
ID string
OwnerUserID string
}
func (q *Queries) LockOwned(ctx context.Context, arg LockOwnedParams) (string, error) {
row := q.db.QueryRow(ctx, lockOwned, arg.ID, arg.OwnerUserID)
var id string
err := row.Scan(&id)
return id, err
}
const pageModels = `-- name: PageModels :many
SELECT id, ownership_type, owner_user_id, model_id, display_name, protocol, base_url, api_key, advanced_config, credit_multiplier, enabled, created_at, updated_at, deleted_at, kind, provider, provider_options, image_config, image_pricing, video_config, video_pricing, proxy_id
FROM models
WHERE deleted_at IS NULL
AND ($1::jsonb ->> 'ownership' = ''
OR ownership_type = $1::jsonb ->> 'ownership')
AND (strpos(lower(display_name), lower($1::jsonb ->> 'search')) > 0
OR strpos(lower(model_id), lower($1::jsonb ->> 'search')) > 0
OR strpos(lower(base_url), lower($1::jsonb ->> 'search')) > 0)
AND id::text > $1::jsonb ->> 'cursor'
ORDER BY id
LIMIT ($1::jsonb ->> 'limit')::integer
`
func (q *Queries) PageModels(ctx context.Context, filter []byte) ([]Model, error) {
rows, err := q.db.Query(ctx, pageModels, filter)
if err != nil {
return nil, err
}
defer rows.Close()
items := []Model{}
for rows.Next() {
var i Model
if err := rows.Scan(
&i.ID,
&i.OwnershipType,
&i.OwnerUserID,
&i.ModelID,
&i.DisplayName,
&i.Protocol,
&i.BaseUrl,
&i.ApiKey,
&i.AdvancedConfig,
&i.CreditMultiplier,
&i.Enabled,
&i.CreatedAt,
&i.UpdatedAt,
&i.DeletedAt,
&i.Kind,
&i.Provider,
&i.ProviderOptions,
&i.ImageConfig,
&i.ImagePricing,
&i.VideoConfig,
&i.VideoPricing,
&i.ProxyID,
); err != nil {
return nil, err
}
items = append(items, i)
}
if err := rows.Err(); err != nil {
return nil, err
}
return items, nil
}
const recordModelCall = `-- name: RecordModelCall :execresult
INSERT INTO model_calls (session_id, user_id, model_id, request_id, status, input_tokens, cached_input_tokens,
output_tokens, cache_hit, error_code, started_at, completed_at, first_token_duration_ms)
SELECT NULLIF($1::text, '')::uuid, $2::uuid, m.id, NULLIF($3::text, ''),
$4::text, $5::bigint, $6::bigint,
$7::bigint, $6::bigint > 0,
NULLIF($8::text, ''), $9::timestamptz,
$10::timestamptz, $11::integer
FROM models m
WHERE m.id = $12::uuid AND m.ownership_type = 'user'
`
type RecordModelCallParams struct {
SessionID string
UserID string
RequestID string
Status string
InputTokens int64
CachedInputTokens int64
OutputTokens int64
ErrorCode string
StartedAt time.Time
CompletedAt time.Time
FirstTokenDurationMs *int32
ModelID string
}
func (q *Queries) RecordModelCall(ctx context.Context, arg RecordModelCallParams) (pgconn.CommandTag, error) {
return q.db.Exec(ctx, recordModelCall,
arg.SessionID,
arg.UserID,
arg.RequestID,
arg.Status,
arg.InputTokens,
arg.CachedInputTokens,
arg.OutputTokens,
arg.ErrorCode,
arg.StartedAt,
arg.CompletedAt,
arg.FirstTokenDurationMs,
arg.ModelID,
)
}
const resolveModel = `-- name: ResolveModel :one
WITH RECURSIVE user_groups(group_id) AS (
SELECT id
FROM groups
WHERE deleted_at IS NULL
AND id IN (
SELECT group_id FROM group_users
WHERE user_id = $1 AND removed_at IS NULL
)
UNION
SELECT parent.id
FROM groups g
JOIN user_groups ug ON ug.group_id = g.id
JOIN groups parent ON parent.id = g.parent_id
WHERE parent.deleted_at IS NULL AND g.deleted_at IS NULL
)
SELECT m.id, m.ownership_type, m.owner_user_id, m.model_id, m.display_name, m.protocol, m.base_url, m.api_key, m.advanced_config, m.credit_multiplier, m.enabled, m.created_at, m.updated_at, m.deleted_at, m.kind, m.provider, m.provider_options, m.image_config, m.image_pricing, m.video_config, m.video_pricing, m.proxy_id
FROM models m
JOIN users u ON u.id = $1
WHERE (m.model_id || '@' || m.id::text = $2::text
OR m.id::text = $2::text
OR m.model_id = $2::text)
AND m.enabled AND m.deleted_at IS NULL
AND (m.ownership_type = 'user' OR $3::boolean)
AND (
(u.role = 'admin' AND m.ownership_type = 'system')
OR m.owner_user_id = $1
OR EXISTS (
SELECT 1 FROM resource_access_grants rag
WHERE rag.resource_type = 'model' AND rag.resource_id = m.id
AND ((rag.all_users AND u.status = 'active' AND u.deleted_at IS NULL)
OR rag.user_id = $1 OR rag.group_id IN (SELECT group_id FROM user_groups))
)
)
ORDER BY (m.model_id || '@' || m.id::text = $2::text) DESC,
(m.id::text = $2::text) DESC, m.created_at, m.id
LIMIT 1
`
type ResolveModelParams struct {
UserID string
RequestedModel string
SystemAccess bool
}
func (q *Queries) ResolveModel(ctx context.Context, arg ResolveModelParams) (Model, error) {
row := q.db.QueryRow(ctx, resolveModel, arg.UserID, arg.RequestedModel, arg.SystemAccess)
var i Model
err := row.Scan(
&i.ID,
&i.OwnershipType,
&i.OwnerUserID,
&i.ModelID,
&i.DisplayName,
&i.Protocol,
&i.BaseUrl,
&i.ApiKey,
&i.AdvancedConfig,
&i.CreditMultiplier,
&i.Enabled,
&i.CreatedAt,
&i.UpdatedAt,
&i.DeletedAt,
&i.Kind,
&i.Provider,
&i.ProviderOptions,
&i.ImageConfig,
&i.ImagePricing,
&i.VideoConfig,
&i.VideoPricing,
&i.ProxyID,
)
return i, err
}
const setEnabled = `-- name: SetEnabled :one
UPDATE
models
SET
enabled = $2,
updated_at = now()
WHERE
id = $1
AND ownership_type = 'system'
AND deleted_at IS NULL
RETURNING
id, ownership_type, owner_user_id, model_id, display_name, protocol, base_url, api_key, advanced_config, credit_multiplier, enabled, created_at, updated_at, deleted_at, kind, provider, provider_options, image_config, image_pricing, video_config, video_pricing, proxy_id
`
type SetEnabledParams struct {
ID string
Enabled bool
}
func (q *Queries) SetEnabled(ctx context.Context, arg SetEnabledParams) (Model, error) {
row := q.db.QueryRow(ctx, setEnabled, arg.ID, arg.Enabled)
var i Model
err := row.Scan(
&i.ID,
&i.OwnershipType,
&i.OwnerUserID,
&i.ModelID,
&i.DisplayName,
&i.Protocol,
&i.BaseUrl,
&i.ApiKey,
&i.AdvancedConfig,
&i.CreditMultiplier,
&i.Enabled,
&i.CreatedAt,
&i.UpdatedAt,
&i.DeletedAt,
&i.Kind,
&i.Provider,
&i.ProviderOptions,
&i.ImageConfig,
&i.ImagePricing,
&i.VideoConfig,
&i.VideoPricing,
&i.ProxyID,
)
return i, err
}
const touchModel = `-- name: TouchModel :execresult
UPDATE
models
SET
updated_at = now()
WHERE
id = $1
`
func (q *Queries) TouchModel(ctx context.Context, id string) (pgconn.CommandTag, error) {
return q.db.Exec(ctx, touchModel, id)
}
const updateModel = `-- name: UpdateModel :one
UPDATE
models
SET
model_id = $2,
display_name = $3,
protocol = $4,
base_url = $5,
api_key = $6,
advanced_config = $7,
credit_multiplier = $8,
kind = $11,
provider = $12,
provider_options = $13,
image_config = $14,
image_pricing = $15,
video_config = $16,
video_pricing = $17,
proxy_id = $18,
updated_at = now()
WHERE
id = $1
AND ownership_type = $9
AND owner_user_id = $10
AND deleted_at IS NULL
RETURNING
id, ownership_type, owner_user_id, model_id, display_name, protocol, base_url, api_key, advanced_config, credit_multiplier, enabled, created_at, updated_at, deleted_at, kind, provider, provider_options, image_config, image_pricing, video_config, video_pricing, proxy_id
`
type UpdateModelParams struct {
ID string
ModelID string
DisplayName string
Protocol string
BaseUrl string
ApiKey string
AdvancedConfig []byte
CreditMultiplier float64
OwnershipType string
OwnerUserID string
Kind string
Provider string
ProviderOptions []byte
ImageConfig []byte
ImagePricing []byte
VideoConfig []byte
VideoPricing []byte
ProxyID string
}
func (q *Queries) UpdateModel(ctx context.Context, arg UpdateModelParams) (Model, error) {
row := q.db.QueryRow(ctx, updateModel,
arg.ID,
arg.ModelID,
arg.DisplayName,
arg.Protocol,
arg.BaseUrl,
arg.ApiKey,
arg.AdvancedConfig,
arg.CreditMultiplier,
arg.OwnershipType,
arg.OwnerUserID,
arg.Kind,
arg.Provider,
arg.ProviderOptions,
arg.ImageConfig,
arg.ImagePricing,
arg.VideoConfig,
arg.VideoPricing,
arg.ProxyID,
)
var i Model
err := row.Scan(
&i.ID,
&i.OwnershipType,
&i.OwnerUserID,
&i.ModelID,
&i.DisplayName,
&i.Protocol,
&i.BaseUrl,
&i.ApiKey,
&i.AdvancedConfig,
&i.CreditMultiplier,
&i.Enabled,
&i.CreatedAt,
&i.UpdatedAt,
&i.DeletedAt,
&i.Kind,
&i.Provider,
&i.ProviderOptions,
&i.ImageConfig,
&i.ImagePricing,
&i.VideoConfig,
&i.VideoPricing,
&i.ProxyID,
)
return i, err
}