Update new storage types and regenerate

This commit is contained in:
Melody Becker 2025-03-28 16:15:41 +01:00
parent 0932f19f71
commit 41e432b56e
Signed by: mstar
SSH key fingerprint: SHA256:9VAo09aaVNTWKzPW7Hq2LW+ox9OdwmTSHRoD4mlz1yI
28 changed files with 6561 additions and 23 deletions

View file

@ -17,7 +17,9 @@ import (
var (
Q = new(Query)
AccessToken *accessToken
Emote *emote
LoginProcessToken *loginProcessToken
MediaMetadata *mediaMetadata
Note *note
NoteTag *noteTag
@ -32,6 +34,7 @@ var (
UserInfoField *userInfoField
UserRemoteLinks *userRemoteLinks
UserToBeing *userToBeing
UserToPronoun *userToPronoun
UserToRole *userToRole
UserToTag *userToTag
UserToUserRelation *userToUserRelation
@ -39,7 +42,9 @@ var (
func SetDefault(db *gorm.DB, opts ...gen.DOOption) {
*Q = *Use(db, opts...)
AccessToken = &Q.AccessToken
Emote = &Q.Emote
LoginProcessToken = &Q.LoginProcessToken
MediaMetadata = &Q.MediaMetadata
Note = &Q.Note
NoteTag = &Q.NoteTag
@ -54,6 +59,7 @@ func SetDefault(db *gorm.DB, opts ...gen.DOOption) {
UserInfoField = &Q.UserInfoField
UserRemoteLinks = &Q.UserRemoteLinks
UserToBeing = &Q.UserToBeing
UserToPronoun = &Q.UserToPronoun
UserToRole = &Q.UserToRole
UserToTag = &Q.UserToTag
UserToUserRelation = &Q.UserToUserRelation
@ -62,7 +68,9 @@ 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...),
LoginProcessToken: newLoginProcessToken(db, opts...),
MediaMetadata: newMediaMetadata(db, opts...),
Note: newNote(db, opts...),
NoteTag: newNoteTag(db, opts...),
@ -77,6 +85,7 @@ func Use(db *gorm.DB, opts ...gen.DOOption) *Query {
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...),
@ -86,7 +95,9 @@ func Use(db *gorm.DB, opts ...gen.DOOption) *Query {
type Query struct {
db *gorm.DB
AccessToken accessToken
Emote emote
LoginProcessToken loginProcessToken
MediaMetadata mediaMetadata
Note note
NoteTag noteTag
@ -101,6 +112,7 @@ type Query struct {
UserInfoField userInfoField
UserRemoteLinks userRemoteLinks
UserToBeing userToBeing
UserToPronoun userToPronoun
UserToRole userToRole
UserToTag userToTag
UserToUserRelation userToUserRelation
@ -111,7 +123,9 @@ 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),
LoginProcessToken: q.LoginProcessToken.clone(db),
MediaMetadata: q.MediaMetadata.clone(db),
Note: q.Note.clone(db),
NoteTag: q.NoteTag.clone(db),
@ -126,6 +140,7 @@ func (q *Query) clone(db *gorm.DB) *Query {
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),
@ -143,7 +158,9 @@ 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),
LoginProcessToken: q.LoginProcessToken.replaceDB(db),
MediaMetadata: q.MediaMetadata.replaceDB(db),
Note: q.Note.replaceDB(db),
NoteTag: q.NoteTag.replaceDB(db),
@ -158,6 +175,7 @@ func (q *Query) ReplaceDB(db *gorm.DB) *Query {
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),
@ -165,7 +183,9 @@ func (q *Query) ReplaceDB(db *gorm.DB) *Query {
}
type queryCtx struct {
AccessToken IAccessTokenDo
Emote IEmoteDo
LoginProcessToken ILoginProcessTokenDo
MediaMetadata IMediaMetadataDo
Note INoteDo
NoteTag INoteTagDo
@ -180,6 +200,7 @@ type queryCtx struct {
UserInfoField IUserInfoFieldDo
UserRemoteLinks IUserRemoteLinksDo
UserToBeing IUserToBeingDo
UserToPronoun IUserToPronounDo
UserToRole IUserToRoleDo
UserToTag IUserToTagDo
UserToUserRelation IUserToUserRelationDo
@ -187,7 +208,9 @@ type queryCtx struct {
func (q *Query) WithContext(ctx context.Context) *queryCtx {
return &queryCtx{
AccessToken: q.AccessToken.WithContext(ctx),
Emote: q.Emote.WithContext(ctx),
LoginProcessToken: q.LoginProcessToken.WithContext(ctx),
MediaMetadata: q.MediaMetadata.WithContext(ctx),
Note: q.Note.WithContext(ctx),
NoteTag: q.NoteTag.WithContext(ctx),
@ -202,6 +225,7 @@ func (q *Query) WithContext(ctx context.Context) *queryCtx {
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),