MCPcopy Index your code
hub / github.com/coder/coder / ResolveUserChatSpendLimit

Method ResolveUserChatSpendLimit

coderd/database/querier.go:1115–1115  ·  view source on GitHub ↗

Resolves the effective spend limit for a user using the hierarchy: 1. Individual user override (highest priority, applies globally across all organizations since it lives on the users table) 2. Minimum group limit across the user's groups 3. Global default from config Returns -1 if limits are not en

(ctx context.Context, arg ResolveUserChatSpendLimitParams)

Source from the content-addressed store, hash-verified

1113 // limit_source indicates which tier won: 'user', 'group', 'default',
1114 // or 'disabled'.
1115 ResolveUserChatSpendLimit(ctx context.Context, arg ResolveUserChatSpendLimitParams) (ResolveUserChatSpendLimitRow, error)
1116 RevokeDBCryptKey(ctx context.Context, activeKeyDigest string) error
1117 // Note that this selects from the CTE, not the original table. The CTE is named
1118 // the same as the original table to trick sqlc into reusing the existing struct

Callers 4

TestChatsMethod · 0.65
ResolveUsageLimitStatusFunction · 0.65

Implementers 5

sqlQueriercoderd/database/db.go
queryMetricsStorecoderd/database/dbmetrics/querymetrics
queriercoderd/database/dbauthz/dbauthz.go
MockStorecoderd/database/dbmock/dbmock.go
MockStoreMockRecordercoderd/database/dbmock/dbmock.go

Calls

no outgoing calls

Tested by 1

TestChatsMethod · 0.52