-
Notifications
You must be signed in to change notification settings - Fork 178
Add addons table #1337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add addons table #1337
Conversation
61c521c
to
dd8cc31
Compare
a006852
to
bd08a5e
Compare
AND addon.valid_from <= now() | ||
AND (addon.valid_to IS NULL OR addon.valid_to > now()) | ||
) a ON true | ||
WHERE ut.user_id = $1 AND t.id = $2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we create view that will precalculate addon values per team so we dont need to do this sum in multiple queries?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe sqlc comes with some way how to re-use part of query
ctx := c.Request.Context() | ||
|
||
teams, err := a.sqlcDB.GetTeamsWithUsersTeamsWithTier(ctx, userID) | ||
teams, err := dbapi.GetTeamByUser(ctx, a.sqlcDB, userID) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GetTeamByUser
-> GetTeamsByUser
Note
Adds addons table and refactors API to use a unified
types.Team
with computed limits (replacing tier usage) across auth, handlers, orchestration, and template flows.public.addons
table and migration with RLS; aggregates extra limits into team queries.teams__get.sql
returning tier + addon extras; remove old tier-specific queries.internal/db/types
: addsTeam
,TeamLimits
,TeamWithDefault
; builds limits from tier + addons.Tier
ent schema and related generated code;Team
retainstier
as string.*types.Team
(drops tier in cache); authentication functions updated to use*types.Team
.GetTeamAndTier
toGetTeamAndLimits
; all handlers use*types.Team
and enforceteam.Limits
(timeout, CPU/RAM checks, metrics, logs, lists, template ops).GetTeamAuth
,GetTeamByUser
,GetTeamByIDAndUserIDAuth
constructingtypes.Team
with limits.team.Limits
(concurrency, max length).team.Limits
.*types.Team
.Written by Cursor Bugbot for commit bd08a5e. This will update automatically on new commits. Configure here.