MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / liveSessionWhere

Function liveSessionWhere

freebuff/web/src/server/live-stats.ts:40–50  ·  view source on GitHub ↗
(now: Date)

Source from the content-addressed store, hash-verified

38}
39
40function liveSessionWhere(now: Date) {
41 return and(
42 eq(schema.freeSession.status, 'active'),
43 gt(schema.freeSession.expires_at, now),
44 sql`NOT EXISTS (
45 SELECT 1 FROM ${schema.user}
46 WHERE ${schema.user.id} = ${schema.freeSession.user_id}
47 AND ${schema.user.banned} = true
48 )`,
49 )
50}
51
52function sortCounts<T extends { count: number }>(rows: T[]): T[] {
53 return [...rows].sort((a, b) => b.count - a.count)

Callers 1

getFreebuffLiveStatsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected