Rename cavage singing func, add import for server
All checks were successful
/ docker (push) Successful in 4m1s

This commit is contained in:
Melody Becker 2025-04-15 14:51:07 +02:00
parent 5e13817563
commit 08f6de0bd7
Signed by: mstar
SSH key fingerprint: SHA256:9VAo09aaVNTWKzPW7Hq2LW+ox9OdwmTSHRoD4mlz1yI
39 changed files with 2035 additions and 364 deletions

View file

@ -16,32 +16,33 @@ import (
)
var (
Q = new(Query)
AccessToken *accessToken
Emote *emote
Feed *feed
LoginProcessToken *loginProcessToken
MediaMetadata *mediaMetadata
Note *note
NoteTag *noteTag
NoteToAttachment *noteToAttachment
NoteToBoost *noteToBoost
NoteToEmote *noteToEmote
NoteToFeed *noteToFeed
NoteToPing *noteToPing
Notification *notification
Reaction *reaction
RemoteServer *remoteServer
Role *role
User *user
UserAuthMethod *userAuthMethod
UserInfoField *userInfoField
UserRemoteLinks *userRemoteLinks
UserToBeing *userToBeing
UserToPronoun *userToPronoun
UserToRole *userToRole
UserToTag *userToTag
UserToUserRelation *userToUserRelation
Q = new(Query)
AccessToken *accessToken
Emote *emote
Feed *feed
LoginProcessToken *loginProcessToken
MediaMetadata *mediaMetadata
Note *note
NoteTag *noteTag
NoteToAttachment *noteToAttachment
NoteToBoost *noteToBoost
NoteToEmote *noteToEmote
NoteToFeed *noteToFeed
NoteToPing *noteToPing
Notification *notification
Reaction *reaction
RemoteServer *remoteServer
RemoteServerMetadata *remoteServerMetadata
Role *role
User *user
UserAuthMethod *userAuthMethod
UserInfoField *userInfoField
UserRemoteLinks *userRemoteLinks
UserToBeing *userToBeing
UserToPronoun *userToPronoun
UserToRole *userToRole
UserToTag *userToTag
UserToUserRelation *userToUserRelation
)
func SetDefault(db *gorm.DB, opts ...gen.DOOption) {
@ -61,6 +62,7 @@ func SetDefault(db *gorm.DB, opts ...gen.DOOption) {
Notification = &Q.Notification
Reaction = &Q.Reaction
RemoteServer = &Q.RemoteServer
RemoteServerMetadata = &Q.RemoteServerMetadata
Role = &Q.Role
User = &Q.User
UserAuthMethod = &Q.UserAuthMethod
@ -75,95 +77,98 @@ func SetDefault(db *gorm.DB, opts ...gen.DOOption) {
func Use(db *gorm.DB, opts ...gen.DOOption) *Query {
return &Query{
db: db,
AccessToken: newAccessToken(db, opts...),
Emote: newEmote(db, opts...),
Feed: newFeed(db, opts...),
LoginProcessToken: newLoginProcessToken(db, opts...),
MediaMetadata: newMediaMetadata(db, opts...),
Note: newNote(db, opts...),
NoteTag: newNoteTag(db, opts...),
NoteToAttachment: newNoteToAttachment(db, opts...),
NoteToBoost: newNoteToBoost(db, opts...),
NoteToEmote: newNoteToEmote(db, opts...),
NoteToFeed: newNoteToFeed(db, opts...),
NoteToPing: newNoteToPing(db, opts...),
Notification: newNotification(db, opts...),
Reaction: newReaction(db, opts...),
RemoteServer: newRemoteServer(db, opts...),
Role: newRole(db, opts...),
User: newUser(db, opts...),
UserAuthMethod: newUserAuthMethod(db, opts...),
UserInfoField: newUserInfoField(db, opts...),
UserRemoteLinks: newUserRemoteLinks(db, opts...),
UserToBeing: newUserToBeing(db, opts...),
UserToPronoun: newUserToPronoun(db, opts...),
UserToRole: newUserToRole(db, opts...),
UserToTag: newUserToTag(db, opts...),
UserToUserRelation: newUserToUserRelation(db, opts...),
db: db,
AccessToken: newAccessToken(db, opts...),
Emote: newEmote(db, opts...),
Feed: newFeed(db, opts...),
LoginProcessToken: newLoginProcessToken(db, opts...),
MediaMetadata: newMediaMetadata(db, opts...),
Note: newNote(db, opts...),
NoteTag: newNoteTag(db, opts...),
NoteToAttachment: newNoteToAttachment(db, opts...),
NoteToBoost: newNoteToBoost(db, opts...),
NoteToEmote: newNoteToEmote(db, opts...),
NoteToFeed: newNoteToFeed(db, opts...),
NoteToPing: newNoteToPing(db, opts...),
Notification: newNotification(db, opts...),
Reaction: newReaction(db, opts...),
RemoteServer: newRemoteServer(db, opts...),
RemoteServerMetadata: newRemoteServerMetadata(db, opts...),
Role: newRole(db, opts...),
User: newUser(db, opts...),
UserAuthMethod: newUserAuthMethod(db, opts...),
UserInfoField: newUserInfoField(db, opts...),
UserRemoteLinks: newUserRemoteLinks(db, opts...),
UserToBeing: newUserToBeing(db, opts...),
UserToPronoun: newUserToPronoun(db, opts...),
UserToRole: newUserToRole(db, opts...),
UserToTag: newUserToTag(db, opts...),
UserToUserRelation: newUserToUserRelation(db, opts...),
}
}
type Query struct {
db *gorm.DB
AccessToken accessToken
Emote emote
Feed feed
LoginProcessToken loginProcessToken
MediaMetadata mediaMetadata
Note note
NoteTag noteTag
NoteToAttachment noteToAttachment
NoteToBoost noteToBoost
NoteToEmote noteToEmote
NoteToFeed noteToFeed
NoteToPing noteToPing
Notification notification
Reaction reaction
RemoteServer remoteServer
Role role
User user
UserAuthMethod userAuthMethod
UserInfoField userInfoField
UserRemoteLinks userRemoteLinks
UserToBeing userToBeing
UserToPronoun userToPronoun
UserToRole userToRole
UserToTag userToTag
UserToUserRelation userToUserRelation
AccessToken accessToken
Emote emote
Feed feed
LoginProcessToken loginProcessToken
MediaMetadata mediaMetadata
Note note
NoteTag noteTag
NoteToAttachment noteToAttachment
NoteToBoost noteToBoost
NoteToEmote noteToEmote
NoteToFeed noteToFeed
NoteToPing noteToPing
Notification notification
Reaction reaction
RemoteServer remoteServer
RemoteServerMetadata remoteServerMetadata
Role role
User user
UserAuthMethod userAuthMethod
UserInfoField userInfoField
UserRemoteLinks userRemoteLinks
UserToBeing userToBeing
UserToPronoun userToPronoun
UserToRole userToRole
UserToTag userToTag
UserToUserRelation userToUserRelation
}
func (q *Query) Available() bool { return q.db != nil }
func (q *Query) clone(db *gorm.DB) *Query {
return &Query{
db: db,
AccessToken: q.AccessToken.clone(db),
Emote: q.Emote.clone(db),
Feed: q.Feed.clone(db),
LoginProcessToken: q.LoginProcessToken.clone(db),
MediaMetadata: q.MediaMetadata.clone(db),
Note: q.Note.clone(db),
NoteTag: q.NoteTag.clone(db),
NoteToAttachment: q.NoteToAttachment.clone(db),
NoteToBoost: q.NoteToBoost.clone(db),
NoteToEmote: q.NoteToEmote.clone(db),
NoteToFeed: q.NoteToFeed.clone(db),
NoteToPing: q.NoteToPing.clone(db),
Notification: q.Notification.clone(db),
Reaction: q.Reaction.clone(db),
RemoteServer: q.RemoteServer.clone(db),
Role: q.Role.clone(db),
User: q.User.clone(db),
UserAuthMethod: q.UserAuthMethod.clone(db),
UserInfoField: q.UserInfoField.clone(db),
UserRemoteLinks: q.UserRemoteLinks.clone(db),
UserToBeing: q.UserToBeing.clone(db),
UserToPronoun: q.UserToPronoun.clone(db),
UserToRole: q.UserToRole.clone(db),
UserToTag: q.UserToTag.clone(db),
UserToUserRelation: q.UserToUserRelation.clone(db),
db: db,
AccessToken: q.AccessToken.clone(db),
Emote: q.Emote.clone(db),
Feed: q.Feed.clone(db),
LoginProcessToken: q.LoginProcessToken.clone(db),
MediaMetadata: q.MediaMetadata.clone(db),
Note: q.Note.clone(db),
NoteTag: q.NoteTag.clone(db),
NoteToAttachment: q.NoteToAttachment.clone(db),
NoteToBoost: q.NoteToBoost.clone(db),
NoteToEmote: q.NoteToEmote.clone(db),
NoteToFeed: q.NoteToFeed.clone(db),
NoteToPing: q.NoteToPing.clone(db),
Notification: q.Notification.clone(db),
Reaction: q.Reaction.clone(db),
RemoteServer: q.RemoteServer.clone(db),
RemoteServerMetadata: q.RemoteServerMetadata.clone(db),
Role: q.Role.clone(db),
User: q.User.clone(db),
UserAuthMethod: q.UserAuthMethod.clone(db),
UserInfoField: q.UserInfoField.clone(db),
UserRemoteLinks: q.UserRemoteLinks.clone(db),
UserToBeing: q.UserToBeing.clone(db),
UserToPronoun: q.UserToPronoun.clone(db),
UserToRole: q.UserToRole.clone(db),
UserToTag: q.UserToTag.clone(db),
UserToUserRelation: q.UserToUserRelation.clone(db),
}
}
@ -177,90 +182,93 @@ func (q *Query) WriteDB() *Query {
func (q *Query) ReplaceDB(db *gorm.DB) *Query {
return &Query{
db: db,
AccessToken: q.AccessToken.replaceDB(db),
Emote: q.Emote.replaceDB(db),
Feed: q.Feed.replaceDB(db),
LoginProcessToken: q.LoginProcessToken.replaceDB(db),
MediaMetadata: q.MediaMetadata.replaceDB(db),
Note: q.Note.replaceDB(db),
NoteTag: q.NoteTag.replaceDB(db),
NoteToAttachment: q.NoteToAttachment.replaceDB(db),
NoteToBoost: q.NoteToBoost.replaceDB(db),
NoteToEmote: q.NoteToEmote.replaceDB(db),
NoteToFeed: q.NoteToFeed.replaceDB(db),
NoteToPing: q.NoteToPing.replaceDB(db),
Notification: q.Notification.replaceDB(db),
Reaction: q.Reaction.replaceDB(db),
RemoteServer: q.RemoteServer.replaceDB(db),
Role: q.Role.replaceDB(db),
User: q.User.replaceDB(db),
UserAuthMethod: q.UserAuthMethod.replaceDB(db),
UserInfoField: q.UserInfoField.replaceDB(db),
UserRemoteLinks: q.UserRemoteLinks.replaceDB(db),
UserToBeing: q.UserToBeing.replaceDB(db),
UserToPronoun: q.UserToPronoun.replaceDB(db),
UserToRole: q.UserToRole.replaceDB(db),
UserToTag: q.UserToTag.replaceDB(db),
UserToUserRelation: q.UserToUserRelation.replaceDB(db),
db: db,
AccessToken: q.AccessToken.replaceDB(db),
Emote: q.Emote.replaceDB(db),
Feed: q.Feed.replaceDB(db),
LoginProcessToken: q.LoginProcessToken.replaceDB(db),
MediaMetadata: q.MediaMetadata.replaceDB(db),
Note: q.Note.replaceDB(db),
NoteTag: q.NoteTag.replaceDB(db),
NoteToAttachment: q.NoteToAttachment.replaceDB(db),
NoteToBoost: q.NoteToBoost.replaceDB(db),
NoteToEmote: q.NoteToEmote.replaceDB(db),
NoteToFeed: q.NoteToFeed.replaceDB(db),
NoteToPing: q.NoteToPing.replaceDB(db),
Notification: q.Notification.replaceDB(db),
Reaction: q.Reaction.replaceDB(db),
RemoteServer: q.RemoteServer.replaceDB(db),
RemoteServerMetadata: q.RemoteServerMetadata.replaceDB(db),
Role: q.Role.replaceDB(db),
User: q.User.replaceDB(db),
UserAuthMethod: q.UserAuthMethod.replaceDB(db),
UserInfoField: q.UserInfoField.replaceDB(db),
UserRemoteLinks: q.UserRemoteLinks.replaceDB(db),
UserToBeing: q.UserToBeing.replaceDB(db),
UserToPronoun: q.UserToPronoun.replaceDB(db),
UserToRole: q.UserToRole.replaceDB(db),
UserToTag: q.UserToTag.replaceDB(db),
UserToUserRelation: q.UserToUserRelation.replaceDB(db),
}
}
type queryCtx struct {
AccessToken IAccessTokenDo
Emote IEmoteDo
Feed IFeedDo
LoginProcessToken ILoginProcessTokenDo
MediaMetadata IMediaMetadataDo
Note INoteDo
NoteTag INoteTagDo
NoteToAttachment INoteToAttachmentDo
NoteToBoost INoteToBoostDo
NoteToEmote INoteToEmoteDo
NoteToFeed INoteToFeedDo
NoteToPing INoteToPingDo
Notification INotificationDo
Reaction IReactionDo
RemoteServer IRemoteServerDo
Role IRoleDo
User IUserDo
UserAuthMethod IUserAuthMethodDo
UserInfoField IUserInfoFieldDo
UserRemoteLinks IUserRemoteLinksDo
UserToBeing IUserToBeingDo
UserToPronoun IUserToPronounDo
UserToRole IUserToRoleDo
UserToTag IUserToTagDo
UserToUserRelation IUserToUserRelationDo
AccessToken IAccessTokenDo
Emote IEmoteDo
Feed IFeedDo
LoginProcessToken ILoginProcessTokenDo
MediaMetadata IMediaMetadataDo
Note INoteDo
NoteTag INoteTagDo
NoteToAttachment INoteToAttachmentDo
NoteToBoost INoteToBoostDo
NoteToEmote INoteToEmoteDo
NoteToFeed INoteToFeedDo
NoteToPing INoteToPingDo
Notification INotificationDo
Reaction IReactionDo
RemoteServer IRemoteServerDo
RemoteServerMetadata IRemoteServerMetadataDo
Role IRoleDo
User IUserDo
UserAuthMethod IUserAuthMethodDo
UserInfoField IUserInfoFieldDo
UserRemoteLinks IUserRemoteLinksDo
UserToBeing IUserToBeingDo
UserToPronoun IUserToPronounDo
UserToRole IUserToRoleDo
UserToTag IUserToTagDo
UserToUserRelation IUserToUserRelationDo
}
func (q *Query) WithContext(ctx context.Context) *queryCtx {
return &queryCtx{
AccessToken: q.AccessToken.WithContext(ctx),
Emote: q.Emote.WithContext(ctx),
Feed: q.Feed.WithContext(ctx),
LoginProcessToken: q.LoginProcessToken.WithContext(ctx),
MediaMetadata: q.MediaMetadata.WithContext(ctx),
Note: q.Note.WithContext(ctx),
NoteTag: q.NoteTag.WithContext(ctx),
NoteToAttachment: q.NoteToAttachment.WithContext(ctx),
NoteToBoost: q.NoteToBoost.WithContext(ctx),
NoteToEmote: q.NoteToEmote.WithContext(ctx),
NoteToFeed: q.NoteToFeed.WithContext(ctx),
NoteToPing: q.NoteToPing.WithContext(ctx),
Notification: q.Notification.WithContext(ctx),
Reaction: q.Reaction.WithContext(ctx),
RemoteServer: q.RemoteServer.WithContext(ctx),
Role: q.Role.WithContext(ctx),
User: q.User.WithContext(ctx),
UserAuthMethod: q.UserAuthMethod.WithContext(ctx),
UserInfoField: q.UserInfoField.WithContext(ctx),
UserRemoteLinks: q.UserRemoteLinks.WithContext(ctx),
UserToBeing: q.UserToBeing.WithContext(ctx),
UserToPronoun: q.UserToPronoun.WithContext(ctx),
UserToRole: q.UserToRole.WithContext(ctx),
UserToTag: q.UserToTag.WithContext(ctx),
UserToUserRelation: q.UserToUserRelation.WithContext(ctx),
AccessToken: q.AccessToken.WithContext(ctx),
Emote: q.Emote.WithContext(ctx),
Feed: q.Feed.WithContext(ctx),
LoginProcessToken: q.LoginProcessToken.WithContext(ctx),
MediaMetadata: q.MediaMetadata.WithContext(ctx),
Note: q.Note.WithContext(ctx),
NoteTag: q.NoteTag.WithContext(ctx),
NoteToAttachment: q.NoteToAttachment.WithContext(ctx),
NoteToBoost: q.NoteToBoost.WithContext(ctx),
NoteToEmote: q.NoteToEmote.WithContext(ctx),
NoteToFeed: q.NoteToFeed.WithContext(ctx),
NoteToPing: q.NoteToPing.WithContext(ctx),
Notification: q.Notification.WithContext(ctx),
Reaction: q.Reaction.WithContext(ctx),
RemoteServer: q.RemoteServer.WithContext(ctx),
RemoteServerMetadata: q.RemoteServerMetadata.WithContext(ctx),
Role: q.Role.WithContext(ctx),
User: q.User.WithContext(ctx),
UserAuthMethod: q.UserAuthMethod.WithContext(ctx),
UserInfoField: q.UserInfoField.WithContext(ctx),
UserRemoteLinks: q.UserRemoteLinks.WithContext(ctx),
UserToBeing: q.UserToBeing.WithContext(ctx),
UserToPronoun: q.UserToPronoun.WithContext(ctx),
UserToRole: q.UserToRole.WithContext(ctx),
UserToTag: q.UserToTag.WithContext(ctx),
UserToUserRelation: q.UserToUserRelation.WithContext(ctx),
}
}