Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit90c7b64

Browse files
committed
work on db queries
1 parentdedc32f commit90c7b64

File tree

12 files changed

+530
-0
lines changed

12 files changed

+530
-0
lines changed

‎coderd/database/dbauthz/dbauthz.go‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1417,6 +1417,14 @@ func (q *querier) FavoriteWorkspace(ctx context.Context, id uuid.UUID) error {
14171417
returnupdate(q.log,q.auth,fetch,q.db.FavoriteWorkspace)(ctx,id)
14181418
}
14191419

1420+
func (q*querier)FetchInboxNotificationsByUserID(ctx context.Context,userID uuid.UUID) ([]database.NotificationsInbox,error) {
1421+
panic("not implemented")
1422+
}
1423+
1424+
func (q*querier)FetchInboxNotificationsByUserIDAndTemplateIDAndTargetID(ctx context.Context,arg database.FetchInboxNotificationsByUserIDAndTemplateIDAndTargetIDParams) ([]database.NotificationsInbox,error) {
1425+
panic("not implemented")
1426+
}
1427+
14201428
func (q*querier)FetchMemoryResourceMonitorsByAgentID(ctx context.Context,agentID uuid.UUID) (database.WorkspaceAgentMemoryResourceMonitor,error) {
14211429
workspace,err:=q.db.GetWorkspaceByAgentID(ctx,agentID)
14221430
iferr!=nil {
@@ -1438,6 +1446,14 @@ func (q *querier) FetchNewMessageMetadata(ctx context.Context, arg database.Fetc
14381446
returnq.db.FetchNewMessageMetadata(ctx,arg)
14391447
}
14401448

1449+
func (q*querier)FetchUnreadInboxNotificationsByUserID(ctx context.Context,userID uuid.UUID) ([]database.NotificationsInbox,error) {
1450+
panic("not implemented")
1451+
}
1452+
1453+
func (q*querier)FetchUnreadInboxNotificationsByUserIDAndTemplateIDAndTargetID(ctx context.Context,arg database.FetchUnreadInboxNotificationsByUserIDAndTemplateIDAndTargetIDParams) ([]database.NotificationsInbox,error) {
1454+
panic("not implemented")
1455+
}
1456+
14411457
func (q*querier)FetchVolumesResourceMonitorsByAgentID(ctx context.Context,agentID uuid.UUID) ([]database.WorkspaceAgentVolumeResourceMonitor,error) {
14421458
workspace,err:=q.db.GetWorkspaceByAgentID(ctx,agentID)
14431459
iferr!=nil {
@@ -3077,6 +3093,10 @@ func (q *querier) InsertGroupMember(ctx context.Context, arg database.InsertGrou
30773093
returnupdate(q.log,q.auth,fetch,q.db.InsertGroupMember)(ctx,arg)
30783094
}
30793095

3096+
func (q*querier)InsertInboxNotification(ctx context.Context,arg database.InsertInboxNotificationParams) (database.NotificationsInbox,error) {
3097+
panic("not implemented")
3098+
}
3099+
30803100
func (q*querier)InsertLicense(ctx context.Context,arg database.InsertLicenseParams) (database.License,error) {
30813101
iferr:=q.authorizeContext(ctx,policy.ActionCreate,rbac.ResourceLicense);err!=nil {
30823102
return database.License{},err
@@ -3564,6 +3584,10 @@ func (q *querier) RevokeDBCryptKey(ctx context.Context, activeKeyDigest string)
35643584
returnq.db.RevokeDBCryptKey(ctx,activeKeyDigest)
35653585
}
35663586

3587+
func (q*querier)SetInboxNotificationAsRead(ctx context.Context,arg database.SetInboxNotificationAsReadParams)error {
3588+
panic("not implemented")
3589+
}
3590+
35673591
func (q*querier)TryAcquireLock(ctx context.Context,idint64) (bool,error) {
35683592
returnq.db.TryAcquireLock(ctx,id)
35693593
}

‎coderd/database/dbmem/dbmem.go‎

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2363,6 +2363,19 @@ func (q *FakeQuerier) FavoriteWorkspace(_ context.Context, arg uuid.UUID) error
23632363
returnnil
23642364
}
23652365

2366+
func (q*FakeQuerier)FetchInboxNotificationsByUserID(ctx context.Context,userID uuid.UUID) ([]database.NotificationsInbox,error) {
2367+
panic("not implemented")
2368+
}
2369+
2370+
func (q*FakeQuerier)FetchInboxNotificationsByUserIDAndTemplateIDAndTargetID(ctx context.Context,arg database.FetchInboxNotificationsByUserIDAndTemplateIDAndTargetIDParams) ([]database.NotificationsInbox,error) {
2371+
err:=validateDatabaseType(arg)
2372+
iferr!=nil {
2373+
returnnil,err
2374+
}
2375+
2376+
panic("not implemented")
2377+
}
2378+
23662379
func (q*FakeQuerier)FetchMemoryResourceMonitorsByAgentID(_ context.Context,agentID uuid.UUID) (database.WorkspaceAgentMemoryResourceMonitor,error) {
23672380
for_,monitor:=rangeq.workspaceAgentMemoryResourceMonitors {
23682381
ifmonitor.AgentID==agentID {
@@ -2405,6 +2418,19 @@ func (q *FakeQuerier) FetchNewMessageMetadata(_ context.Context, arg database.Fe
24052418
},nil
24062419
}
24072420

2421+
func (q*FakeQuerier)FetchUnreadInboxNotificationsByUserID(ctx context.Context,userID uuid.UUID) ([]database.NotificationsInbox,error) {
2422+
panic("not implemented")
2423+
}
2424+
2425+
func (q*FakeQuerier)FetchUnreadInboxNotificationsByUserIDAndTemplateIDAndTargetID(ctx context.Context,arg database.FetchUnreadInboxNotificationsByUserIDAndTemplateIDAndTargetIDParams) ([]database.NotificationsInbox,error) {
2426+
err:=validateDatabaseType(arg)
2427+
iferr!=nil {
2428+
returnnil,err
2429+
}
2430+
2431+
panic("not implemented")
2432+
}
2433+
24082434
func (q*FakeQuerier)FetchVolumesResourceMonitorsByAgentID(_ context.Context,agentID uuid.UUID) ([]database.WorkspaceAgentVolumeResourceMonitor,error) {
24092435
monitors:= []database.WorkspaceAgentVolumeResourceMonitor{}
24102436

@@ -7959,6 +7985,15 @@ func (q *FakeQuerier) InsertGroupMember(_ context.Context, arg database.InsertGr
79597985
returnnil
79607986
}
79617987

7988+
func (q*FakeQuerier)InsertInboxNotification(ctx context.Context,arg database.InsertInboxNotificationParams) (database.NotificationsInbox,error) {
7989+
err:=validateDatabaseType(arg)
7990+
iferr!=nil {
7991+
return database.NotificationsInbox{},err
7992+
}
7993+
7994+
panic("not implemented")
7995+
}
7996+
79627997
func (q*FakeQuerier)InsertLicense(
79637998
_ context.Context,arg database.InsertLicenseParams,
79647999
) (database.License,error) {
@@ -9443,6 +9478,15 @@ func (q *FakeQuerier) RevokeDBCryptKey(_ context.Context, activeKeyDigest string
94439478
returnsql.ErrNoRows
94449479
}
94459480

9481+
func (q*FakeQuerier)SetInboxNotificationAsRead(ctx context.Context,arg database.SetInboxNotificationAsReadParams)error {
9482+
err:=validateDatabaseType(arg)
9483+
iferr!=nil {
9484+
returnerr
9485+
}
9486+
9487+
panic("not implemented")
9488+
}
9489+
94469490
func (*FakeQuerier)TryAcquireLock(_ context.Context,_int64) (bool,error) {
94479491
returnfalse,xerrors.New("TryAcquireLock must only be called within a transaction")
94489492
}

‎coderd/database/dbmetrics/querymetrics.go‎

Lines changed: 42 additions & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎coderd/database/dbmock/dbmock.go‎

Lines changed: 89 additions & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎coderd/database/dump.sql‎

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
DROPTABLE IF EXISTS notifications_inbox;
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
CREATETABLEnotifications_inbox (
2+
id UUIDPRIMARY KEY,
3+
user_id UUIDNOT NULL,
4+
template_id UUIDNOT NULL,
5+
target_id UUID,
6+
titleTEXTNOT NULL,
7+
contentTEXTNOT NULL,
8+
iconTEXTNOT NULL,
9+
actions JSONBNOT NULL,
10+
read_atTIMESTAMP WITH TIME ZONE,
11+
created_atTIMESTAMP WITH TIME ZONENOT NULL DEFAULT NOW()
12+
);
13+
14+
CREATEINDEXidx_notifications_inbox_user_id_read_atON notifications_inbox(user_id, read_at);
15+
CREATEINDEXidx_notifications_inbox_user_id_template_id_target_idON notifications_inbox(user_id, template_id, target_id);

‎coderd/database/models.go‎

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp