Unexport partial...update() store functions, fix messaging
This commit is contained in:
@@ -203,7 +203,7 @@ func (svc message) Create(msg *types.Message) (*types.Message, error) {
|
||||
|
||||
// Increment counter, on struct and in store.
|
||||
original.Replies++
|
||||
if err = store.PartialMessagingMessageUpdate(ctx, s, []string{"replies"}, original); err != nil {
|
||||
if err = store.UpdateMessagingMessageReplyCount(ctx, s, original.ID, original.Replies); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -355,7 +355,7 @@ func (svc message) Delete(messageID uint64) (err error) {
|
||||
original.Replies--
|
||||
}
|
||||
|
||||
if err = store.PartialMessagingMessageUpdate(ctx, s, []string{"replies"}, original); err != nil {
|
||||
if err = store.UpdateMessagingMessageReplyCount(ctx, s, original.ID, original.Replies); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,6 @@ type (
|
||||
{{- end }}
|
||||
{{ if .Update.Enable }}
|
||||
Update{{ export $Types.Singular }}(ctx context.Context{{ template "extraArgsDef" . }}, rr ... *{{ $Types.GoType }}) error
|
||||
Partial{{ export $Types.Singular }}Update(ctx context.Context{{ template "extraArgsDef" . }}, onlyColumns []string, rr ... *{{ $Types.GoType }}) error
|
||||
{{- end }}
|
||||
{{ if .Upsert.Enable }}
|
||||
Upsert{{ export $Types.Singular }}(ctx context.Context{{ template "extraArgsDef" . }}, rr ... *{{ $Types.GoType }}) error
|
||||
@@ -88,11 +87,6 @@ func Create{{ export $Types.Singular }}(ctx context.Context, s {{ export $Types.
|
||||
func Update{{ export $Types.Singular }}(ctx context.Context, s {{ export $Types.Plural }}{{ template "extraArgsDef" . }}, rr ... *{{ $Types.GoType }}) error {
|
||||
return s.Update{{ export $Types.Singular }}(ctx{{ template "extraArgsCall" . }}, rr... )
|
||||
}
|
||||
|
||||
// Partial{{ export $.Types.Singular }}Update updates one or more existing {{ $.Types.Plural }} in store
|
||||
func Partial{{ export $Types.Singular }}Update(ctx context.Context, s {{ export $Types.Plural }}{{ template "extraArgsDef" . }}, onlyColumns []string, rr ... *{{ $Types.GoType }}) error {
|
||||
return s.Partial{{ export $Types.Singular }}Update(ctx{{ template "extraArgsCall" . }}, onlyColumns, rr...)
|
||||
}
|
||||
{{ end }}
|
||||
|
||||
{{ if .Upsert.Enable }}
|
||||
|
||||
@@ -341,11 +341,11 @@ func (s Store) {{ toggleExport .Create.Export "Create" $.Types.Singular }}(ctx c
|
||||
{{ if .Update.Enable }}
|
||||
// {{ toggleExport .Update.Export "Update" $.Types.Singular }} updates one or more existing rows in {{ $.RDBMS.Table }}
|
||||
func (s Store) {{ toggleExport .Update.Export "Update" $.Types.Singular }}(ctx context.Context{{ template "extraArgsDef" . }}, rr ... *{{ $.Types.GoType }}) error {
|
||||
return s.config.ErrorHandler(s.{{ toggleExport .Update.Export "Partial" $.Types.Singular "Update" }}(ctx{{ template "extraArgsCall" . }}, nil, rr...))
|
||||
return s.config.ErrorHandler(s.partial{{ export $.Types.Singular "Update" }}(ctx{{ template "extraArgsCall" . }}, nil, rr...))
|
||||
}
|
||||
|
||||
// {{ toggleExport .Update.Export "Partial" $.Types.Singular "Update" }} updates one or more existing rows in {{ $.RDBMS.Table }}
|
||||
func (s Store) {{ toggleExport .Update.Export "Partial" $.Types.Singular "Update" }}(ctx context.Context{{ template "extraArgsDef" . }}, onlyColumns []string, rr ... *{{ $.Types.GoType }}) (err error) {
|
||||
// partial{{ export $.Types.Singular "Update" }} updates one or more existing rows in {{ $.RDBMS.Table }}
|
||||
func (s Store) partial{{ export $.Types.Singular "Update" }}(ctx context.Context{{ template "extraArgsDef" . }}, onlyColumns []string, rr ... *{{ $.Types.GoType }}) (err error) {
|
||||
for _, res := range rr {
|
||||
err = s.check{{ export $.Types.Singular }}Constraints(ctx {{ template "extraArgsCall" $ }}, res)
|
||||
if err != nil {
|
||||
|
||||
@@ -21,7 +21,6 @@ type (
|
||||
CreateApplication(ctx context.Context, rr ...*types.Application) error
|
||||
|
||||
UpdateApplication(ctx context.Context, rr ...*types.Application) error
|
||||
PartialApplicationUpdate(ctx context.Context, onlyColumns []string, rr ...*types.Application) error
|
||||
|
||||
UpsertApplication(ctx context.Context, rr ...*types.Application) error
|
||||
|
||||
@@ -62,11 +61,6 @@ func UpdateApplication(ctx context.Context, s Applications, rr ...*types.Applica
|
||||
return s.UpdateApplication(ctx, rr...)
|
||||
}
|
||||
|
||||
// PartialApplicationUpdate updates one or more existing Applications in store
|
||||
func PartialApplicationUpdate(ctx context.Context, s Applications, onlyColumns []string, rr ...*types.Application) error {
|
||||
return s.PartialApplicationUpdate(ctx, onlyColumns, rr...)
|
||||
}
|
||||
|
||||
// UpsertApplication creates new or updates existing one or more Applications in store
|
||||
func UpsertApplication(ctx context.Context, s Applications, rr ...*types.Application) error {
|
||||
return s.UpsertApplication(ctx, rr...)
|
||||
|
||||
@@ -21,7 +21,6 @@ type (
|
||||
CreateAttachment(ctx context.Context, rr ...*types.Attachment) error
|
||||
|
||||
UpdateAttachment(ctx context.Context, rr ...*types.Attachment) error
|
||||
PartialAttachmentUpdate(ctx context.Context, onlyColumns []string, rr ...*types.Attachment) error
|
||||
|
||||
UpsertAttachment(ctx context.Context, rr ...*types.Attachment) error
|
||||
|
||||
@@ -57,11 +56,6 @@ func UpdateAttachment(ctx context.Context, s Attachments, rr ...*types.Attachmen
|
||||
return s.UpdateAttachment(ctx, rr...)
|
||||
}
|
||||
|
||||
// PartialAttachmentUpdate updates one or more existing Attachments in store
|
||||
func PartialAttachmentUpdate(ctx context.Context, s Attachments, onlyColumns []string, rr ...*types.Attachment) error {
|
||||
return s.PartialAttachmentUpdate(ctx, onlyColumns, rr...)
|
||||
}
|
||||
|
||||
// UpsertAttachment creates new or updates existing one or more Attachments in store
|
||||
func UpsertAttachment(ctx context.Context, s Attachments, rr ...*types.Attachment) error {
|
||||
return s.UpsertAttachment(ctx, rr...)
|
||||
|
||||
@@ -21,7 +21,6 @@ type (
|
||||
CreateComposeAttachment(ctx context.Context, rr ...*types.Attachment) error
|
||||
|
||||
UpdateComposeAttachment(ctx context.Context, rr ...*types.Attachment) error
|
||||
PartialComposeAttachmentUpdate(ctx context.Context, onlyColumns []string, rr ...*types.Attachment) error
|
||||
|
||||
UpsertComposeAttachment(ctx context.Context, rr ...*types.Attachment) error
|
||||
|
||||
@@ -57,11 +56,6 @@ func UpdateComposeAttachment(ctx context.Context, s ComposeAttachments, rr ...*t
|
||||
return s.UpdateComposeAttachment(ctx, rr...)
|
||||
}
|
||||
|
||||
// PartialComposeAttachmentUpdate updates one or more existing ComposeAttachments in store
|
||||
func PartialComposeAttachmentUpdate(ctx context.Context, s ComposeAttachments, onlyColumns []string, rr ...*types.Attachment) error {
|
||||
return s.PartialComposeAttachmentUpdate(ctx, onlyColumns, rr...)
|
||||
}
|
||||
|
||||
// UpsertComposeAttachment creates new or updates existing one or more ComposeAttachments in store
|
||||
func UpsertComposeAttachment(ctx context.Context, s ComposeAttachments, rr ...*types.Attachment) error {
|
||||
return s.UpsertComposeAttachment(ctx, rr...)
|
||||
|
||||
@@ -22,7 +22,6 @@ type (
|
||||
CreateComposeChart(ctx context.Context, rr ...*types.Chart) error
|
||||
|
||||
UpdateComposeChart(ctx context.Context, rr ...*types.Chart) error
|
||||
PartialComposeChartUpdate(ctx context.Context, onlyColumns []string, rr ...*types.Chart) error
|
||||
|
||||
UpsertComposeChart(ctx context.Context, rr ...*types.Chart) error
|
||||
|
||||
@@ -63,11 +62,6 @@ func UpdateComposeChart(ctx context.Context, s ComposeCharts, rr ...*types.Chart
|
||||
return s.UpdateComposeChart(ctx, rr...)
|
||||
}
|
||||
|
||||
// PartialComposeChartUpdate updates one or more existing ComposeCharts in store
|
||||
func PartialComposeChartUpdate(ctx context.Context, s ComposeCharts, onlyColumns []string, rr ...*types.Chart) error {
|
||||
return s.PartialComposeChartUpdate(ctx, onlyColumns, rr...)
|
||||
}
|
||||
|
||||
// UpsertComposeChart creates new or updates existing one or more ComposeCharts in store
|
||||
func UpsertComposeChart(ctx context.Context, s ComposeCharts, rr ...*types.Chart) error {
|
||||
return s.UpsertComposeChart(ctx, rr...)
|
||||
|
||||
@@ -21,7 +21,6 @@ type (
|
||||
CreateComposeModuleField(ctx context.Context, rr ...*types.ModuleField) error
|
||||
|
||||
UpdateComposeModuleField(ctx context.Context, rr ...*types.ModuleField) error
|
||||
PartialComposeModuleFieldUpdate(ctx context.Context, onlyColumns []string, rr ...*types.ModuleField) error
|
||||
|
||||
UpsertComposeModuleField(ctx context.Context, rr ...*types.ModuleField) error
|
||||
|
||||
@@ -55,11 +54,6 @@ func UpdateComposeModuleField(ctx context.Context, s ComposeModuleFields, rr ...
|
||||
return s.UpdateComposeModuleField(ctx, rr...)
|
||||
}
|
||||
|
||||
// PartialComposeModuleFieldUpdate updates one or more existing ComposeModuleFields in store
|
||||
func PartialComposeModuleFieldUpdate(ctx context.Context, s ComposeModuleFields, onlyColumns []string, rr ...*types.ModuleField) error {
|
||||
return s.PartialComposeModuleFieldUpdate(ctx, onlyColumns, rr...)
|
||||
}
|
||||
|
||||
// UpsertComposeModuleField creates new or updates existing one or more ComposeModuleFields in store
|
||||
func UpsertComposeModuleField(ctx context.Context, s ComposeModuleFields, rr ...*types.ModuleField) error {
|
||||
return s.UpsertComposeModuleField(ctx, rr...)
|
||||
|
||||
@@ -23,7 +23,6 @@ type (
|
||||
CreateComposeModule(ctx context.Context, rr ...*types.Module) error
|
||||
|
||||
UpdateComposeModule(ctx context.Context, rr ...*types.Module) error
|
||||
PartialComposeModuleUpdate(ctx context.Context, onlyColumns []string, rr ...*types.Module) error
|
||||
|
||||
UpsertComposeModule(ctx context.Context, rr ...*types.Module) error
|
||||
|
||||
@@ -69,11 +68,6 @@ func UpdateComposeModule(ctx context.Context, s ComposeModules, rr ...*types.Mod
|
||||
return s.UpdateComposeModule(ctx, rr...)
|
||||
}
|
||||
|
||||
// PartialComposeModuleUpdate updates one or more existing ComposeModules in store
|
||||
func PartialComposeModuleUpdate(ctx context.Context, s ComposeModules, onlyColumns []string, rr ...*types.Module) error {
|
||||
return s.PartialComposeModuleUpdate(ctx, onlyColumns, rr...)
|
||||
}
|
||||
|
||||
// UpsertComposeModule creates new or updates existing one or more ComposeModules in store
|
||||
func UpsertComposeModule(ctx context.Context, s ComposeModules, rr ...*types.Module) error {
|
||||
return s.UpsertComposeModule(ctx, rr...)
|
||||
|
||||
@@ -22,7 +22,6 @@ type (
|
||||
CreateComposeNamespace(ctx context.Context, rr ...*types.Namespace) error
|
||||
|
||||
UpdateComposeNamespace(ctx context.Context, rr ...*types.Namespace) error
|
||||
PartialComposeNamespaceUpdate(ctx context.Context, onlyColumns []string, rr ...*types.Namespace) error
|
||||
|
||||
UpsertComposeNamespace(ctx context.Context, rr ...*types.Namespace) error
|
||||
|
||||
@@ -63,11 +62,6 @@ func UpdateComposeNamespace(ctx context.Context, s ComposeNamespaces, rr ...*typ
|
||||
return s.UpdateComposeNamespace(ctx, rr...)
|
||||
}
|
||||
|
||||
// PartialComposeNamespaceUpdate updates one or more existing ComposeNamespaces in store
|
||||
func PartialComposeNamespaceUpdate(ctx context.Context, s ComposeNamespaces, onlyColumns []string, rr ...*types.Namespace) error {
|
||||
return s.PartialComposeNamespaceUpdate(ctx, onlyColumns, rr...)
|
||||
}
|
||||
|
||||
// UpsertComposeNamespace creates new or updates existing one or more ComposeNamespaces in store
|
||||
func UpsertComposeNamespace(ctx context.Context, s ComposeNamespaces, rr ...*types.Namespace) error {
|
||||
return s.UpsertComposeNamespace(ctx, rr...)
|
||||
|
||||
@@ -23,7 +23,6 @@ type (
|
||||
CreateComposePage(ctx context.Context, rr ...*types.Page) error
|
||||
|
||||
UpdateComposePage(ctx context.Context, rr ...*types.Page) error
|
||||
PartialComposePageUpdate(ctx context.Context, onlyColumns []string, rr ...*types.Page) error
|
||||
|
||||
UpsertComposePage(ctx context.Context, rr ...*types.Page) error
|
||||
|
||||
@@ -74,11 +73,6 @@ func UpdateComposePage(ctx context.Context, s ComposePages, rr ...*types.Page) e
|
||||
return s.UpdateComposePage(ctx, rr...)
|
||||
}
|
||||
|
||||
// PartialComposePageUpdate updates one or more existing ComposePages in store
|
||||
func PartialComposePageUpdate(ctx context.Context, s ComposePages, onlyColumns []string, rr ...*types.Page) error {
|
||||
return s.PartialComposePageUpdate(ctx, onlyColumns, rr...)
|
||||
}
|
||||
|
||||
// UpsertComposePage creates new or updates existing one or more ComposePages in store
|
||||
func UpsertComposePage(ctx context.Context, s ComposePages, rr ...*types.Page) error {
|
||||
return s.UpsertComposePage(ctx, rr...)
|
||||
|
||||
@@ -21,7 +21,6 @@ type (
|
||||
CreateComposeRecord(ctx context.Context, _mod *types.Module, rr ...*types.Record) error
|
||||
|
||||
UpdateComposeRecord(ctx context.Context, _mod *types.Module, rr ...*types.Record) error
|
||||
PartialComposeRecordUpdate(ctx context.Context, _mod *types.Module, onlyColumns []string, rr ...*types.Record) error
|
||||
|
||||
UpsertComposeRecord(ctx context.Context, _mod *types.Module, rr ...*types.Record) error
|
||||
|
||||
@@ -64,11 +63,6 @@ func UpdateComposeRecord(ctx context.Context, s ComposeRecords, _mod *types.Modu
|
||||
return s.UpdateComposeRecord(ctx, _mod, rr...)
|
||||
}
|
||||
|
||||
// PartialComposeRecordUpdate updates one or more existing ComposeRecords in store
|
||||
func PartialComposeRecordUpdate(ctx context.Context, s ComposeRecords, _mod *types.Module, onlyColumns []string, rr ...*types.Record) error {
|
||||
return s.PartialComposeRecordUpdate(ctx, _mod, onlyColumns, rr...)
|
||||
}
|
||||
|
||||
// UpsertComposeRecord creates new or updates existing one or more ComposeRecords in store
|
||||
func UpsertComposeRecord(ctx context.Context, s ComposeRecords, _mod *types.Module, rr ...*types.Record) error {
|
||||
return s.UpsertComposeRecord(ctx, _mod, rr...)
|
||||
|
||||
@@ -21,7 +21,6 @@ type (
|
||||
CreateCredentials(ctx context.Context, rr ...*types.Credentials) error
|
||||
|
||||
UpdateCredentials(ctx context.Context, rr ...*types.Credentials) error
|
||||
PartialCredentialsUpdate(ctx context.Context, onlyColumns []string, rr ...*types.Credentials) error
|
||||
|
||||
UpsertCredentials(ctx context.Context, rr ...*types.Credentials) error
|
||||
|
||||
@@ -57,11 +56,6 @@ func UpdateCredentials(ctx context.Context, s Credentials, rr ...*types.Credenti
|
||||
return s.UpdateCredentials(ctx, rr...)
|
||||
}
|
||||
|
||||
// PartialCredentialsUpdate updates one or more existing Credentials in store
|
||||
func PartialCredentialsUpdate(ctx context.Context, s Credentials, onlyColumns []string, rr ...*types.Credentials) error {
|
||||
return s.PartialCredentialsUpdate(ctx, onlyColumns, rr...)
|
||||
}
|
||||
|
||||
// UpsertCredentials creates new or updates existing one or more Credentials in store
|
||||
func UpsertCredentials(ctx context.Context, s Credentials, rr ...*types.Credentials) error {
|
||||
return s.UpsertCredentials(ctx, rr...)
|
||||
|
||||
@@ -21,7 +21,6 @@ type (
|
||||
CreateMessagingAttachment(ctx context.Context, rr ...*types.Attachment) error
|
||||
|
||||
UpdateMessagingAttachment(ctx context.Context, rr ...*types.Attachment) error
|
||||
PartialMessagingAttachmentUpdate(ctx context.Context, onlyColumns []string, rr ...*types.Attachment) error
|
||||
|
||||
UpsertMessagingAttachment(ctx context.Context, rr ...*types.Attachment) error
|
||||
|
||||
@@ -57,11 +56,6 @@ func UpdateMessagingAttachment(ctx context.Context, s MessagingAttachments, rr .
|
||||
return s.UpdateMessagingAttachment(ctx, rr...)
|
||||
}
|
||||
|
||||
// PartialMessagingAttachmentUpdate updates one or more existing MessagingAttachments in store
|
||||
func PartialMessagingAttachmentUpdate(ctx context.Context, s MessagingAttachments, onlyColumns []string, rr ...*types.Attachment) error {
|
||||
return s.PartialMessagingAttachmentUpdate(ctx, onlyColumns, rr...)
|
||||
}
|
||||
|
||||
// UpsertMessagingAttachment creates new or updates existing one or more MessagingAttachments in store
|
||||
func UpsertMessagingAttachment(ctx context.Context, s MessagingAttachments, rr ...*types.Attachment) error {
|
||||
return s.UpsertMessagingAttachment(ctx, rr...)
|
||||
|
||||
@@ -20,7 +20,6 @@ type (
|
||||
CreateMessagingChannelMember(ctx context.Context, rr ...*types.ChannelMember) error
|
||||
|
||||
UpdateMessagingChannelMember(ctx context.Context, rr ...*types.ChannelMember) error
|
||||
PartialMessagingChannelMemberUpdate(ctx context.Context, onlyColumns []string, rr ...*types.ChannelMember) error
|
||||
|
||||
UpsertMessagingChannelMember(ctx context.Context, rr ...*types.ChannelMember) error
|
||||
|
||||
@@ -49,11 +48,6 @@ func UpdateMessagingChannelMember(ctx context.Context, s MessagingChannelMembers
|
||||
return s.UpdateMessagingChannelMember(ctx, rr...)
|
||||
}
|
||||
|
||||
// PartialMessagingChannelMemberUpdate updates one or more existing MessagingChannelMembers in store
|
||||
func PartialMessagingChannelMemberUpdate(ctx context.Context, s MessagingChannelMembers, onlyColumns []string, rr ...*types.ChannelMember) error {
|
||||
return s.PartialMessagingChannelMemberUpdate(ctx, onlyColumns, rr...)
|
||||
}
|
||||
|
||||
// UpsertMessagingChannelMember creates new or updates existing one or more MessagingChannelMembers in store
|
||||
func UpsertMessagingChannelMember(ctx context.Context, s MessagingChannelMembers, rr ...*types.ChannelMember) error {
|
||||
return s.UpsertMessagingChannelMember(ctx, rr...)
|
||||
|
||||
@@ -21,7 +21,6 @@ type (
|
||||
CreateMessagingChannel(ctx context.Context, rr ...*types.Channel) error
|
||||
|
||||
UpdateMessagingChannel(ctx context.Context, rr ...*types.Channel) error
|
||||
PartialMessagingChannelUpdate(ctx context.Context, onlyColumns []string, rr ...*types.Channel) error
|
||||
|
||||
UpsertMessagingChannel(ctx context.Context, rr ...*types.Channel) error
|
||||
|
||||
@@ -62,11 +61,6 @@ func UpdateMessagingChannel(ctx context.Context, s MessagingChannels, rr ...*typ
|
||||
return s.UpdateMessagingChannel(ctx, rr...)
|
||||
}
|
||||
|
||||
// PartialMessagingChannelUpdate updates one or more existing MessagingChannels in store
|
||||
func PartialMessagingChannelUpdate(ctx context.Context, s MessagingChannels, onlyColumns []string, rr ...*types.Channel) error {
|
||||
return s.PartialMessagingChannelUpdate(ctx, onlyColumns, rr...)
|
||||
}
|
||||
|
||||
// UpsertMessagingChannel creates new or updates existing one or more MessagingChannels in store
|
||||
func UpsertMessagingChannel(ctx context.Context, s MessagingChannels, rr ...*types.Channel) error {
|
||||
return s.UpsertMessagingChannel(ctx, rr...)
|
||||
|
||||
@@ -21,7 +21,6 @@ type (
|
||||
CreateMessagingFlag(ctx context.Context, rr ...*types.MessageFlag) error
|
||||
|
||||
UpdateMessagingFlag(ctx context.Context, rr ...*types.MessageFlag) error
|
||||
PartialMessagingFlagUpdate(ctx context.Context, onlyColumns []string, rr ...*types.MessageFlag) error
|
||||
|
||||
UpsertMessagingFlag(ctx context.Context, rr ...*types.MessageFlag) error
|
||||
|
||||
@@ -55,11 +54,6 @@ func UpdateMessagingFlag(ctx context.Context, s MessagingFlags, rr ...*types.Mes
|
||||
return s.UpdateMessagingFlag(ctx, rr...)
|
||||
}
|
||||
|
||||
// PartialMessagingFlagUpdate updates one or more existing MessagingFlags in store
|
||||
func PartialMessagingFlagUpdate(ctx context.Context, s MessagingFlags, onlyColumns []string, rr ...*types.MessageFlag) error {
|
||||
return s.PartialMessagingFlagUpdate(ctx, onlyColumns, rr...)
|
||||
}
|
||||
|
||||
// UpsertMessagingFlag creates new or updates existing one or more MessagingFlags in store
|
||||
func UpsertMessagingFlag(ctx context.Context, s MessagingFlags, rr ...*types.MessageFlag) error {
|
||||
return s.UpsertMessagingFlag(ctx, rr...)
|
||||
|
||||
@@ -21,7 +21,6 @@ type (
|
||||
CreateMessagingMention(ctx context.Context, rr ...*types.Mention) error
|
||||
|
||||
UpdateMessagingMention(ctx context.Context, rr ...*types.Mention) error
|
||||
PartialMessagingMentionUpdate(ctx context.Context, onlyColumns []string, rr ...*types.Mention) error
|
||||
|
||||
UpsertMessagingMention(ctx context.Context, rr ...*types.Mention) error
|
||||
|
||||
@@ -57,11 +56,6 @@ func UpdateMessagingMention(ctx context.Context, s MessagingMentions, rr ...*typ
|
||||
return s.UpdateMessagingMention(ctx, rr...)
|
||||
}
|
||||
|
||||
// PartialMessagingMentionUpdate updates one or more existing MessagingMentions in store
|
||||
func PartialMessagingMentionUpdate(ctx context.Context, s MessagingMentions, onlyColumns []string, rr ...*types.Mention) error {
|
||||
return s.PartialMessagingMentionUpdate(ctx, onlyColumns, rr...)
|
||||
}
|
||||
|
||||
// UpsertMessagingMention creates new or updates existing one or more MessagingMentions in store
|
||||
func UpsertMessagingMention(ctx context.Context, s MessagingMentions, rr ...*types.Mention) error {
|
||||
return s.UpsertMessagingMention(ctx, rr...)
|
||||
|
||||
@@ -20,7 +20,6 @@ type (
|
||||
CreateMessagingMessageAttachment(ctx context.Context, rr ...*types.MessageAttachment) error
|
||||
|
||||
UpdateMessagingMessageAttachment(ctx context.Context, rr ...*types.MessageAttachment) error
|
||||
PartialMessagingMessageAttachmentUpdate(ctx context.Context, onlyColumns []string, rr ...*types.MessageAttachment) error
|
||||
|
||||
UpsertMessagingMessageAttachment(ctx context.Context, rr ...*types.MessageAttachment) error
|
||||
|
||||
@@ -49,11 +48,6 @@ func UpdateMessagingMessageAttachment(ctx context.Context, s MessagingMessageAtt
|
||||
return s.UpdateMessagingMessageAttachment(ctx, rr...)
|
||||
}
|
||||
|
||||
// PartialMessagingMessageAttachmentUpdate updates one or more existing MessagingMessageAttachments in store
|
||||
func PartialMessagingMessageAttachmentUpdate(ctx context.Context, s MessagingMessageAttachments, onlyColumns []string, rr ...*types.MessageAttachment) error {
|
||||
return s.PartialMessagingMessageAttachmentUpdate(ctx, onlyColumns, rr...)
|
||||
}
|
||||
|
||||
// UpsertMessagingMessageAttachment creates new or updates existing one or more MessagingMessageAttachments in store
|
||||
func UpsertMessagingMessageAttachment(ctx context.Context, s MessagingMessageAttachments, rr ...*types.MessageAttachment) error {
|
||||
return s.UpsertMessagingMessageAttachment(ctx, rr...)
|
||||
|
||||
@@ -21,7 +21,6 @@ type (
|
||||
CreateMessagingMessage(ctx context.Context, rr ...*types.Message) error
|
||||
|
||||
UpdateMessagingMessage(ctx context.Context, rr ...*types.Message) error
|
||||
PartialMessagingMessageUpdate(ctx context.Context, onlyColumns []string, rr ...*types.Message) error
|
||||
|
||||
UpsertMessagingMessage(ctx context.Context, rr ...*types.Message) error
|
||||
|
||||
@@ -40,6 +39,9 @@ type (
|
||||
|
||||
// LastMessagingMessageID (custom function)
|
||||
LastMessagingMessageID(ctx context.Context, _channelID uint64, _threadID uint64) (uint64, error)
|
||||
|
||||
// UpdateMessagingMessageReplyCount (custom function)
|
||||
UpdateMessagingMessageReplyCount(ctx context.Context, _messageID uint64, _replies uint) error
|
||||
}
|
||||
)
|
||||
|
||||
@@ -68,11 +70,6 @@ func UpdateMessagingMessage(ctx context.Context, s MessagingMessages, rr ...*typ
|
||||
return s.UpdateMessagingMessage(ctx, rr...)
|
||||
}
|
||||
|
||||
// PartialMessagingMessageUpdate updates one or more existing MessagingMessages in store
|
||||
func PartialMessagingMessageUpdate(ctx context.Context, s MessagingMessages, onlyColumns []string, rr ...*types.Message) error {
|
||||
return s.PartialMessagingMessageUpdate(ctx, onlyColumns, rr...)
|
||||
}
|
||||
|
||||
// UpsertMessagingMessage creates new or updates existing one or more MessagingMessages in store
|
||||
func UpsertMessagingMessage(ctx context.Context, s MessagingMessages, rr ...*types.Message) error {
|
||||
return s.UpsertMessagingMessage(ctx, rr...)
|
||||
@@ -104,3 +101,7 @@ func CountMessagingMessagesFromID(ctx context.Context, s MessagingMessages, _cha
|
||||
func LastMessagingMessageID(ctx context.Context, s MessagingMessages, _channelID uint64, _threadID uint64) (uint64, error) {
|
||||
return s.LastMessagingMessageID(ctx, _channelID, _threadID)
|
||||
}
|
||||
|
||||
func UpdateMessagingMessageReplyCount(ctx context.Context, s MessagingMessages, _messageID uint64, _replies uint) error {
|
||||
return s.UpdateMessagingMessageReplyCount(ctx, _messageID, _replies)
|
||||
}
|
||||
|
||||
@@ -41,6 +41,11 @@ functions:
|
||||
- { name: channelID, type: uint64 }
|
||||
- { name: threadID, type: uint64 }
|
||||
return: [ uint64, error ]
|
||||
- name: UpdateMessagingMessageReplyCount
|
||||
arguments:
|
||||
- { name: messageID, type: uint64 }
|
||||
- { name: replies, type: uint }
|
||||
return: [ error ]
|
||||
|
||||
rdbms:
|
||||
alias: msg
|
||||
|
||||
@@ -18,7 +18,6 @@ type (
|
||||
CreateMessagingUnread(ctx context.Context, rr ...*types.Unread) error
|
||||
|
||||
UpdateMessagingUnread(ctx context.Context, rr ...*types.Unread) error
|
||||
PartialMessagingUnreadUpdate(ctx context.Context, onlyColumns []string, rr ...*types.Unread) error
|
||||
|
||||
UpsertMessagingUnread(ctx context.Context, rr ...*types.Unread) error
|
||||
|
||||
@@ -62,11 +61,6 @@ func UpdateMessagingUnread(ctx context.Context, s MessagingUnreads, rr ...*types
|
||||
return s.UpdateMessagingUnread(ctx, rr...)
|
||||
}
|
||||
|
||||
// PartialMessagingUnreadUpdate updates one or more existing MessagingUnreads in store
|
||||
func PartialMessagingUnreadUpdate(ctx context.Context, s MessagingUnreads, onlyColumns []string, rr ...*types.Unread) error {
|
||||
return s.PartialMessagingUnreadUpdate(ctx, onlyColumns, rr...)
|
||||
}
|
||||
|
||||
// UpsertMessagingUnread creates new or updates existing one or more MessagingUnreads in store
|
||||
func UpsertMessagingUnread(ctx context.Context, s MessagingUnreads, rr ...*types.Unread) error {
|
||||
return s.UpsertMessagingUnread(ctx, rr...)
|
||||
|
||||
@@ -20,7 +20,6 @@ type (
|
||||
CreateRbacRule(ctx context.Context, rr ...*permissions.Rule) error
|
||||
|
||||
UpdateRbacRule(ctx context.Context, rr ...*permissions.Rule) error
|
||||
PartialRbacRuleUpdate(ctx context.Context, onlyColumns []string, rr ...*permissions.Rule) error
|
||||
|
||||
UpsertRbacRule(ctx context.Context, rr ...*permissions.Rule) error
|
||||
|
||||
@@ -49,11 +48,6 @@ func UpdateRbacRule(ctx context.Context, s RbacRules, rr ...*permissions.Rule) e
|
||||
return s.UpdateRbacRule(ctx, rr...)
|
||||
}
|
||||
|
||||
// PartialRbacRuleUpdate updates one or more existing RbacRules in store
|
||||
func PartialRbacRuleUpdate(ctx context.Context, s RbacRules, onlyColumns []string, rr ...*permissions.Rule) error {
|
||||
return s.PartialRbacRuleUpdate(ctx, onlyColumns, rr...)
|
||||
}
|
||||
|
||||
// UpsertRbacRule creates new or updates existing one or more RbacRules in store
|
||||
func UpsertRbacRule(ctx context.Context, s RbacRules, rr ...*permissions.Rule) error {
|
||||
return s.UpsertRbacRule(ctx, rr...)
|
||||
|
||||
@@ -246,11 +246,11 @@ func (s Store) CreateApplication(ctx context.Context, rr ...*types.Application)
|
||||
|
||||
// UpdateApplication updates one or more existing rows in applications
|
||||
func (s Store) UpdateApplication(ctx context.Context, rr ...*types.Application) error {
|
||||
return s.config.ErrorHandler(s.PartialApplicationUpdate(ctx, nil, rr...))
|
||||
return s.config.ErrorHandler(s.partialApplicationUpdate(ctx, nil, rr...))
|
||||
}
|
||||
|
||||
// PartialApplicationUpdate updates one or more existing rows in applications
|
||||
func (s Store) PartialApplicationUpdate(ctx context.Context, onlyColumns []string, rr ...*types.Application) (err error) {
|
||||
// partialApplicationUpdate updates one or more existing rows in applications
|
||||
func (s Store) partialApplicationUpdate(ctx context.Context, onlyColumns []string, rr ...*types.Application) (err error) {
|
||||
for _, res := range rr {
|
||||
err = s.checkApplicationConstraints(ctx, res)
|
||||
if err != nil {
|
||||
|
||||
@@ -122,11 +122,11 @@ func (s Store) CreateAttachment(ctx context.Context, rr ...*types.Attachment) (e
|
||||
|
||||
// UpdateAttachment updates one or more existing rows in attachments
|
||||
func (s Store) UpdateAttachment(ctx context.Context, rr ...*types.Attachment) error {
|
||||
return s.config.ErrorHandler(s.PartialAttachmentUpdate(ctx, nil, rr...))
|
||||
return s.config.ErrorHandler(s.partialAttachmentUpdate(ctx, nil, rr...))
|
||||
}
|
||||
|
||||
// PartialAttachmentUpdate updates one or more existing rows in attachments
|
||||
func (s Store) PartialAttachmentUpdate(ctx context.Context, onlyColumns []string, rr ...*types.Attachment) (err error) {
|
||||
// partialAttachmentUpdate updates one or more existing rows in attachments
|
||||
func (s Store) partialAttachmentUpdate(ctx context.Context, onlyColumns []string, rr ...*types.Attachment) (err error) {
|
||||
for _, res := range rr {
|
||||
err = s.checkAttachmentConstraints(ctx, res)
|
||||
if err != nil {
|
||||
|
||||
@@ -122,11 +122,11 @@ func (s Store) CreateComposeAttachment(ctx context.Context, rr ...*types.Attachm
|
||||
|
||||
// UpdateComposeAttachment updates one or more existing rows in compose_attachment
|
||||
func (s Store) UpdateComposeAttachment(ctx context.Context, rr ...*types.Attachment) error {
|
||||
return s.config.ErrorHandler(s.PartialComposeAttachmentUpdate(ctx, nil, rr...))
|
||||
return s.config.ErrorHandler(s.partialComposeAttachmentUpdate(ctx, nil, rr...))
|
||||
}
|
||||
|
||||
// PartialComposeAttachmentUpdate updates one or more existing rows in compose_attachment
|
||||
func (s Store) PartialComposeAttachmentUpdate(ctx context.Context, onlyColumns []string, rr ...*types.Attachment) (err error) {
|
||||
// partialComposeAttachmentUpdate updates one or more existing rows in compose_attachment
|
||||
func (s Store) partialComposeAttachmentUpdate(ctx context.Context, onlyColumns []string, rr ...*types.Attachment) (err error) {
|
||||
for _, res := range rr {
|
||||
err = s.checkComposeAttachmentConstraints(ctx, res)
|
||||
if err != nil {
|
||||
|
||||
@@ -256,11 +256,11 @@ func (s Store) CreateComposeChart(ctx context.Context, rr ...*types.Chart) (err
|
||||
|
||||
// UpdateComposeChart updates one or more existing rows in compose_chart
|
||||
func (s Store) UpdateComposeChart(ctx context.Context, rr ...*types.Chart) error {
|
||||
return s.config.ErrorHandler(s.PartialComposeChartUpdate(ctx, nil, rr...))
|
||||
return s.config.ErrorHandler(s.partialComposeChartUpdate(ctx, nil, rr...))
|
||||
}
|
||||
|
||||
// PartialComposeChartUpdate updates one or more existing rows in compose_chart
|
||||
func (s Store) PartialComposeChartUpdate(ctx context.Context, onlyColumns []string, rr ...*types.Chart) (err error) {
|
||||
// partialComposeChartUpdate updates one or more existing rows in compose_chart
|
||||
func (s Store) partialComposeChartUpdate(ctx context.Context, onlyColumns []string, rr ...*types.Chart) (err error) {
|
||||
for _, res := range rr {
|
||||
err = s.checkComposeChartConstraints(ctx, res)
|
||||
if err != nil {
|
||||
|
||||
@@ -112,11 +112,11 @@ func (s Store) CreateComposeModuleField(ctx context.Context, rr ...*types.Module
|
||||
|
||||
// UpdateComposeModuleField updates one or more existing rows in compose_module_field
|
||||
func (s Store) UpdateComposeModuleField(ctx context.Context, rr ...*types.ModuleField) error {
|
||||
return s.config.ErrorHandler(s.PartialComposeModuleFieldUpdate(ctx, nil, rr...))
|
||||
return s.config.ErrorHandler(s.partialComposeModuleFieldUpdate(ctx, nil, rr...))
|
||||
}
|
||||
|
||||
// PartialComposeModuleFieldUpdate updates one or more existing rows in compose_module_field
|
||||
func (s Store) PartialComposeModuleFieldUpdate(ctx context.Context, onlyColumns []string, rr ...*types.ModuleField) (err error) {
|
||||
// partialComposeModuleFieldUpdate updates one or more existing rows in compose_module_field
|
||||
func (s Store) partialComposeModuleFieldUpdate(ctx context.Context, onlyColumns []string, rr ...*types.ModuleField) (err error) {
|
||||
for _, res := range rr {
|
||||
err = s.checkComposeModuleFieldConstraints(ctx, res)
|
||||
if err != nil {
|
||||
|
||||
@@ -266,11 +266,11 @@ func (s Store) CreateComposeModule(ctx context.Context, rr ...*types.Module) (er
|
||||
|
||||
// UpdateComposeModule updates one or more existing rows in compose_module
|
||||
func (s Store) UpdateComposeModule(ctx context.Context, rr ...*types.Module) error {
|
||||
return s.config.ErrorHandler(s.PartialComposeModuleUpdate(ctx, nil, rr...))
|
||||
return s.config.ErrorHandler(s.partialComposeModuleUpdate(ctx, nil, rr...))
|
||||
}
|
||||
|
||||
// PartialComposeModuleUpdate updates one or more existing rows in compose_module
|
||||
func (s Store) PartialComposeModuleUpdate(ctx context.Context, onlyColumns []string, rr ...*types.Module) (err error) {
|
||||
// partialComposeModuleUpdate updates one or more existing rows in compose_module
|
||||
func (s Store) partialComposeModuleUpdate(ctx context.Context, onlyColumns []string, rr ...*types.Module) (err error) {
|
||||
for _, res := range rr {
|
||||
err = s.checkComposeModuleConstraints(ctx, res)
|
||||
if err != nil {
|
||||
|
||||
@@ -255,11 +255,11 @@ func (s Store) CreateComposeNamespace(ctx context.Context, rr ...*types.Namespac
|
||||
|
||||
// UpdateComposeNamespace updates one or more existing rows in compose_namespace
|
||||
func (s Store) UpdateComposeNamespace(ctx context.Context, rr ...*types.Namespace) error {
|
||||
return s.config.ErrorHandler(s.PartialComposeNamespaceUpdate(ctx, nil, rr...))
|
||||
return s.config.ErrorHandler(s.partialComposeNamespaceUpdate(ctx, nil, rr...))
|
||||
}
|
||||
|
||||
// PartialComposeNamespaceUpdate updates one or more existing rows in compose_namespace
|
||||
func (s Store) PartialComposeNamespaceUpdate(ctx context.Context, onlyColumns []string, rr ...*types.Namespace) (err error) {
|
||||
// partialComposeNamespaceUpdate updates one or more existing rows in compose_namespace
|
||||
func (s Store) partialComposeNamespaceUpdate(ctx context.Context, onlyColumns []string, rr ...*types.Namespace) (err error) {
|
||||
for _, res := range rr {
|
||||
err = s.checkComposeNamespaceConstraints(ctx, res)
|
||||
if err != nil {
|
||||
|
||||
@@ -266,11 +266,11 @@ func (s Store) CreateComposePage(ctx context.Context, rr ...*types.Page) (err er
|
||||
|
||||
// UpdateComposePage updates one or more existing rows in compose_page
|
||||
func (s Store) UpdateComposePage(ctx context.Context, rr ...*types.Page) error {
|
||||
return s.config.ErrorHandler(s.PartialComposePageUpdate(ctx, nil, rr...))
|
||||
return s.config.ErrorHandler(s.partialComposePageUpdate(ctx, nil, rr...))
|
||||
}
|
||||
|
||||
// PartialComposePageUpdate updates one or more existing rows in compose_page
|
||||
func (s Store) PartialComposePageUpdate(ctx context.Context, onlyColumns []string, rr ...*types.Page) (err error) {
|
||||
// partialComposePageUpdate updates one or more existing rows in compose_page
|
||||
func (s Store) partialComposePageUpdate(ctx context.Context, onlyColumns []string, rr ...*types.Page) (err error) {
|
||||
for _, res := range rr {
|
||||
err = s.checkComposePageConstraints(ctx, res)
|
||||
if err != nil {
|
||||
|
||||
@@ -111,11 +111,11 @@ func (s Store) CreateCredentials(ctx context.Context, rr ...*types.Credentials)
|
||||
|
||||
// UpdateCredentials updates one or more existing rows in credentials
|
||||
func (s Store) UpdateCredentials(ctx context.Context, rr ...*types.Credentials) error {
|
||||
return s.config.ErrorHandler(s.PartialCredentialsUpdate(ctx, nil, rr...))
|
||||
return s.config.ErrorHandler(s.partialCredentialsUpdate(ctx, nil, rr...))
|
||||
}
|
||||
|
||||
// PartialCredentialsUpdate updates one or more existing rows in credentials
|
||||
func (s Store) PartialCredentialsUpdate(ctx context.Context, onlyColumns []string, rr ...*types.Credentials) (err error) {
|
||||
// partialCredentialsUpdate updates one or more existing rows in credentials
|
||||
func (s Store) partialCredentialsUpdate(ctx context.Context, onlyColumns []string, rr ...*types.Credentials) (err error) {
|
||||
for _, res := range rr {
|
||||
err = s.checkCredentialsConstraints(ctx, res)
|
||||
if err != nil {
|
||||
|
||||
@@ -122,11 +122,11 @@ func (s Store) CreateMessagingAttachment(ctx context.Context, rr ...*types.Attac
|
||||
|
||||
// UpdateMessagingAttachment updates one or more existing rows in messaging_attachment
|
||||
func (s Store) UpdateMessagingAttachment(ctx context.Context, rr ...*types.Attachment) error {
|
||||
return s.config.ErrorHandler(s.PartialMessagingAttachmentUpdate(ctx, nil, rr...))
|
||||
return s.config.ErrorHandler(s.partialMessagingAttachmentUpdate(ctx, nil, rr...))
|
||||
}
|
||||
|
||||
// PartialMessagingAttachmentUpdate updates one or more existing rows in messaging_attachment
|
||||
func (s Store) PartialMessagingAttachmentUpdate(ctx context.Context, onlyColumns []string, rr ...*types.Attachment) (err error) {
|
||||
// partialMessagingAttachmentUpdate updates one or more existing rows in messaging_attachment
|
||||
func (s Store) partialMessagingAttachmentUpdate(ctx context.Context, onlyColumns []string, rr ...*types.Attachment) (err error) {
|
||||
for _, res := range rr {
|
||||
err = s.checkMessagingAttachmentConstraints(ctx, res)
|
||||
if err != nil {
|
||||
|
||||
@@ -102,11 +102,11 @@ func (s Store) CreateMessagingChannelMember(ctx context.Context, rr ...*types.Ch
|
||||
|
||||
// UpdateMessagingChannelMember updates one or more existing rows in messaging_channel_member
|
||||
func (s Store) UpdateMessagingChannelMember(ctx context.Context, rr ...*types.ChannelMember) error {
|
||||
return s.config.ErrorHandler(s.PartialMessagingChannelMemberUpdate(ctx, nil, rr...))
|
||||
return s.config.ErrorHandler(s.partialMessagingChannelMemberUpdate(ctx, nil, rr...))
|
||||
}
|
||||
|
||||
// PartialMessagingChannelMemberUpdate updates one or more existing rows in messaging_channel_member
|
||||
func (s Store) PartialMessagingChannelMemberUpdate(ctx context.Context, onlyColumns []string, rr ...*types.ChannelMember) (err error) {
|
||||
// partialMessagingChannelMemberUpdate updates one or more existing rows in messaging_channel_member
|
||||
func (s Store) partialMessagingChannelMemberUpdate(ctx context.Context, onlyColumns []string, rr ...*types.ChannelMember) (err error) {
|
||||
for _, res := range rr {
|
||||
err = s.checkMessagingChannelMemberConstraints(ctx, res)
|
||||
if err != nil {
|
||||
|
||||
@@ -246,11 +246,11 @@ func (s Store) CreateMessagingChannel(ctx context.Context, rr ...*types.Channel)
|
||||
|
||||
// UpdateMessagingChannel updates one or more existing rows in messaging_channel
|
||||
func (s Store) UpdateMessagingChannel(ctx context.Context, rr ...*types.Channel) error {
|
||||
return s.config.ErrorHandler(s.PartialMessagingChannelUpdate(ctx, nil, rr...))
|
||||
return s.config.ErrorHandler(s.partialMessagingChannelUpdate(ctx, nil, rr...))
|
||||
}
|
||||
|
||||
// PartialMessagingChannelUpdate updates one or more existing rows in messaging_channel
|
||||
func (s Store) PartialMessagingChannelUpdate(ctx context.Context, onlyColumns []string, rr ...*types.Channel) (err error) {
|
||||
// partialMessagingChannelUpdate updates one or more existing rows in messaging_channel
|
||||
func (s Store) partialMessagingChannelUpdate(ctx context.Context, onlyColumns []string, rr ...*types.Channel) (err error) {
|
||||
for _, res := range rr {
|
||||
err = s.checkMessagingChannelConstraints(ctx, res)
|
||||
if err != nil {
|
||||
|
||||
@@ -109,11 +109,11 @@ func (s Store) CreateMessagingFlag(ctx context.Context, rr ...*types.MessageFlag
|
||||
|
||||
// UpdateMessagingFlag updates one or more existing rows in messaging_message_flag
|
||||
func (s Store) UpdateMessagingFlag(ctx context.Context, rr ...*types.MessageFlag) error {
|
||||
return s.config.ErrorHandler(s.PartialMessagingFlagUpdate(ctx, nil, rr...))
|
||||
return s.config.ErrorHandler(s.partialMessagingFlagUpdate(ctx, nil, rr...))
|
||||
}
|
||||
|
||||
// PartialMessagingFlagUpdate updates one or more existing rows in messaging_message_flag
|
||||
func (s Store) PartialMessagingFlagUpdate(ctx context.Context, onlyColumns []string, rr ...*types.MessageFlag) (err error) {
|
||||
// partialMessagingFlagUpdate updates one or more existing rows in messaging_message_flag
|
||||
func (s Store) partialMessagingFlagUpdate(ctx context.Context, onlyColumns []string, rr ...*types.MessageFlag) (err error) {
|
||||
for _, res := range rr {
|
||||
err = s.checkMessagingFlagConstraints(ctx, res)
|
||||
if err != nil {
|
||||
|
||||
@@ -111,11 +111,11 @@ func (s Store) CreateMessagingMention(ctx context.Context, rr ...*types.Mention)
|
||||
|
||||
// UpdateMessagingMention updates one or more existing rows in messaging_mention
|
||||
func (s Store) UpdateMessagingMention(ctx context.Context, rr ...*types.Mention) error {
|
||||
return s.config.ErrorHandler(s.PartialMessagingMentionUpdate(ctx, nil, rr...))
|
||||
return s.config.ErrorHandler(s.partialMessagingMentionUpdate(ctx, nil, rr...))
|
||||
}
|
||||
|
||||
// PartialMessagingMentionUpdate updates one or more existing rows in messaging_mention
|
||||
func (s Store) PartialMessagingMentionUpdate(ctx context.Context, onlyColumns []string, rr ...*types.Mention) (err error) {
|
||||
// partialMessagingMentionUpdate updates one or more existing rows in messaging_mention
|
||||
func (s Store) partialMessagingMentionUpdate(ctx context.Context, onlyColumns []string, rr ...*types.Mention) (err error) {
|
||||
for _, res := range rr {
|
||||
err = s.checkMessagingMentionConstraints(ctx, res)
|
||||
if err != nil {
|
||||
|
||||
@@ -87,11 +87,11 @@ func (s Store) CreateMessagingMessageAttachment(ctx context.Context, rr ...*type
|
||||
|
||||
// UpdateMessagingMessageAttachment updates one or more existing rows in messaging_message_attachment
|
||||
func (s Store) UpdateMessagingMessageAttachment(ctx context.Context, rr ...*types.MessageAttachment) error {
|
||||
return s.config.ErrorHandler(s.PartialMessagingMessageAttachmentUpdate(ctx, nil, rr...))
|
||||
return s.config.ErrorHandler(s.partialMessagingMessageAttachmentUpdate(ctx, nil, rr...))
|
||||
}
|
||||
|
||||
// PartialMessagingMessageAttachmentUpdate updates one or more existing rows in messaging_message_attachment
|
||||
func (s Store) PartialMessagingMessageAttachmentUpdate(ctx context.Context, onlyColumns []string, rr ...*types.MessageAttachment) (err error) {
|
||||
// partialMessagingMessageAttachmentUpdate updates one or more existing rows in messaging_message_attachment
|
||||
func (s Store) partialMessagingMessageAttachmentUpdate(ctx context.Context, onlyColumns []string, rr ...*types.MessageAttachment) (err error) {
|
||||
for _, res := range rr {
|
||||
err = s.checkMessagingMessageAttachmentConstraints(ctx, res)
|
||||
if err != nil {
|
||||
|
||||
@@ -111,11 +111,11 @@ func (s Store) CreateMessagingMessage(ctx context.Context, rr ...*types.Message)
|
||||
|
||||
// UpdateMessagingMessage updates one or more existing rows in messaging_message
|
||||
func (s Store) UpdateMessagingMessage(ctx context.Context, rr ...*types.Message) error {
|
||||
return s.config.ErrorHandler(s.PartialMessagingMessageUpdate(ctx, nil, rr...))
|
||||
return s.config.ErrorHandler(s.partialMessagingMessageUpdate(ctx, nil, rr...))
|
||||
}
|
||||
|
||||
// PartialMessagingMessageUpdate updates one or more existing rows in messaging_message
|
||||
func (s Store) PartialMessagingMessageUpdate(ctx context.Context, onlyColumns []string, rr ...*types.Message) (err error) {
|
||||
// partialMessagingMessageUpdate updates one or more existing rows in messaging_message
|
||||
func (s Store) partialMessagingMessageUpdate(ctx context.Context, onlyColumns []string, rr ...*types.Message) (err error) {
|
||||
for _, res := range rr {
|
||||
err = s.checkMessagingMessageConstraints(ctx, res)
|
||||
if err != nil {
|
||||
|
||||
@@ -203,6 +203,10 @@ func (s Store) LastMessagingMessageID(ctx context.Context, channelID, threadID u
|
||||
return
|
||||
}
|
||||
|
||||
func (s Store) UpdateMessagingMessageReplyCount(ctx context.Context, messageID uint64, replies uint) error {
|
||||
return s.partialMessagingMessageUpdate(ctx, []string{"replies"}, &types.Message{ID: messageID, Replies: replies})
|
||||
}
|
||||
|
||||
func (s Store) encodeMessagingMessage(res *types.Message) store.Payload {
|
||||
// Custom message encoder to make sure that type is not converted to
|
||||
// NULL when empty string is used (MessageTypeSimpleMessage)
|
||||
|
||||
@@ -80,11 +80,11 @@ func (s Store) CreateMessagingUnread(ctx context.Context, rr ...*types.Unread) (
|
||||
|
||||
// UpdateMessagingUnread updates one or more existing rows in messaging_unread
|
||||
func (s Store) UpdateMessagingUnread(ctx context.Context, rr ...*types.Unread) error {
|
||||
return s.config.ErrorHandler(s.PartialMessagingUnreadUpdate(ctx, nil, rr...))
|
||||
return s.config.ErrorHandler(s.partialMessagingUnreadUpdate(ctx, nil, rr...))
|
||||
}
|
||||
|
||||
// PartialMessagingUnreadUpdate updates one or more existing rows in messaging_unread
|
||||
func (s Store) PartialMessagingUnreadUpdate(ctx context.Context, onlyColumns []string, rr ...*types.Unread) (err error) {
|
||||
// partialMessagingUnreadUpdate updates one or more existing rows in messaging_unread
|
||||
func (s Store) partialMessagingUnreadUpdate(ctx context.Context, onlyColumns []string, rr ...*types.Unread) (err error) {
|
||||
for _, res := range rr {
|
||||
err = s.checkMessagingUnreadConstraints(ctx, res)
|
||||
if err != nil {
|
||||
|
||||
@@ -99,11 +99,11 @@ func (s Store) CreateRbacRule(ctx context.Context, rr ...*permissions.Rule) (err
|
||||
|
||||
// UpdateRbacRule updates one or more existing rows in rbac_rules
|
||||
func (s Store) UpdateRbacRule(ctx context.Context, rr ...*permissions.Rule) error {
|
||||
return s.config.ErrorHandler(s.PartialRbacRuleUpdate(ctx, nil, rr...))
|
||||
return s.config.ErrorHandler(s.partialRbacRuleUpdate(ctx, nil, rr...))
|
||||
}
|
||||
|
||||
// PartialRbacRuleUpdate updates one or more existing rows in rbac_rules
|
||||
func (s Store) PartialRbacRuleUpdate(ctx context.Context, onlyColumns []string, rr ...*permissions.Rule) (err error) {
|
||||
// partialRbacRuleUpdate updates one or more existing rows in rbac_rules
|
||||
func (s Store) partialRbacRuleUpdate(ctx context.Context, onlyColumns []string, rr ...*permissions.Rule) (err error) {
|
||||
for _, res := range rr {
|
||||
err = s.checkRbacRuleConstraints(ctx, res)
|
||||
if err != nil {
|
||||
|
||||
@@ -246,11 +246,11 @@ func (s Store) CreateReminder(ctx context.Context, rr ...*types.Reminder) (err e
|
||||
|
||||
// UpdateReminder updates one or more existing rows in reminders
|
||||
func (s Store) UpdateReminder(ctx context.Context, rr ...*types.Reminder) error {
|
||||
return s.config.ErrorHandler(s.PartialReminderUpdate(ctx, nil, rr...))
|
||||
return s.config.ErrorHandler(s.partialReminderUpdate(ctx, nil, rr...))
|
||||
}
|
||||
|
||||
// PartialReminderUpdate updates one or more existing rows in reminders
|
||||
func (s Store) PartialReminderUpdate(ctx context.Context, onlyColumns []string, rr ...*types.Reminder) (err error) {
|
||||
// partialReminderUpdate updates one or more existing rows in reminders
|
||||
func (s Store) partialReminderUpdate(ctx context.Context, onlyColumns []string, rr ...*types.Reminder) (err error) {
|
||||
for _, res := range rr {
|
||||
err = s.checkReminderConstraints(ctx, res)
|
||||
if err != nil {
|
||||
|
||||
@@ -99,11 +99,11 @@ func (s Store) CreateRoleMember(ctx context.Context, rr ...*types.RoleMember) (e
|
||||
|
||||
// UpdateRoleMember updates one or more existing rows in role_members
|
||||
func (s Store) UpdateRoleMember(ctx context.Context, rr ...*types.RoleMember) error {
|
||||
return s.config.ErrorHandler(s.PartialRoleMemberUpdate(ctx, nil, rr...))
|
||||
return s.config.ErrorHandler(s.partialRoleMemberUpdate(ctx, nil, rr...))
|
||||
}
|
||||
|
||||
// PartialRoleMemberUpdate updates one or more existing rows in role_members
|
||||
func (s Store) PartialRoleMemberUpdate(ctx context.Context, onlyColumns []string, rr ...*types.RoleMember) (err error) {
|
||||
// partialRoleMemberUpdate updates one or more existing rows in role_members
|
||||
func (s Store) partialRoleMemberUpdate(ctx context.Context, onlyColumns []string, rr ...*types.RoleMember) (err error) {
|
||||
for _, res := range rr {
|
||||
err = s.checkRoleMemberConstraints(ctx, res)
|
||||
if err != nil {
|
||||
|
||||
@@ -270,11 +270,11 @@ func (s Store) CreateRole(ctx context.Context, rr ...*types.Role) (err error) {
|
||||
|
||||
// UpdateRole updates one or more existing rows in roles
|
||||
func (s Store) UpdateRole(ctx context.Context, rr ...*types.Role) error {
|
||||
return s.config.ErrorHandler(s.PartialRoleUpdate(ctx, nil, rr...))
|
||||
return s.config.ErrorHandler(s.partialRoleUpdate(ctx, nil, rr...))
|
||||
}
|
||||
|
||||
// PartialRoleUpdate updates one or more existing rows in roles
|
||||
func (s Store) PartialRoleUpdate(ctx context.Context, onlyColumns []string, rr ...*types.Role) (err error) {
|
||||
// partialRoleUpdate updates one or more existing rows in roles
|
||||
func (s Store) partialRoleUpdate(ctx context.Context, onlyColumns []string, rr ...*types.Role) (err error) {
|
||||
for _, res := range rr {
|
||||
err = s.checkRoleConstraints(ctx, res)
|
||||
if err != nil {
|
||||
|
||||
@@ -121,11 +121,11 @@ func (s Store) CreateSetting(ctx context.Context, rr ...*types.SettingValue) (er
|
||||
|
||||
// UpdateSetting updates one or more existing rows in settings
|
||||
func (s Store) UpdateSetting(ctx context.Context, rr ...*types.SettingValue) error {
|
||||
return s.config.ErrorHandler(s.PartialSettingUpdate(ctx, nil, rr...))
|
||||
return s.config.ErrorHandler(s.partialSettingUpdate(ctx, nil, rr...))
|
||||
}
|
||||
|
||||
// PartialSettingUpdate updates one or more existing rows in settings
|
||||
func (s Store) PartialSettingUpdate(ctx context.Context, onlyColumns []string, rr ...*types.SettingValue) (err error) {
|
||||
// partialSettingUpdate updates one or more existing rows in settings
|
||||
func (s Store) partialSettingUpdate(ctx context.Context, onlyColumns []string, rr ...*types.SettingValue) (err error) {
|
||||
for _, res := range rr {
|
||||
err = s.checkSettingConstraints(ctx, res)
|
||||
if err != nil {
|
||||
|
||||
@@ -282,11 +282,11 @@ func (s Store) CreateUser(ctx context.Context, rr ...*types.User) (err error) {
|
||||
|
||||
// UpdateUser updates one or more existing rows in users
|
||||
func (s Store) UpdateUser(ctx context.Context, rr ...*types.User) error {
|
||||
return s.config.ErrorHandler(s.PartialUserUpdate(ctx, nil, rr...))
|
||||
return s.config.ErrorHandler(s.partialUserUpdate(ctx, nil, rr...))
|
||||
}
|
||||
|
||||
// PartialUserUpdate updates one or more existing rows in users
|
||||
func (s Store) PartialUserUpdate(ctx context.Context, onlyColumns []string, rr ...*types.User) (err error) {
|
||||
// partialUserUpdate updates one or more existing rows in users
|
||||
func (s Store) partialUserUpdate(ctx context.Context, onlyColumns []string, rr ...*types.User) (err error) {
|
||||
for _, res := range rr {
|
||||
err = s.checkUserConstraints(ctx, res)
|
||||
if err != nil {
|
||||
|
||||
@@ -21,7 +21,6 @@ type (
|
||||
CreateReminder(ctx context.Context, rr ...*types.Reminder) error
|
||||
|
||||
UpdateReminder(ctx context.Context, rr ...*types.Reminder) error
|
||||
PartialReminderUpdate(ctx context.Context, onlyColumns []string, rr ...*types.Reminder) error
|
||||
|
||||
UpsertReminder(ctx context.Context, rr ...*types.Reminder) error
|
||||
|
||||
@@ -57,11 +56,6 @@ func UpdateReminder(ctx context.Context, s Reminders, rr ...*types.Reminder) err
|
||||
return s.UpdateReminder(ctx, rr...)
|
||||
}
|
||||
|
||||
// PartialReminderUpdate updates one or more existing Reminders in store
|
||||
func PartialReminderUpdate(ctx context.Context, s Reminders, onlyColumns []string, rr ...*types.Reminder) error {
|
||||
return s.PartialReminderUpdate(ctx, onlyColumns, rr...)
|
||||
}
|
||||
|
||||
// UpsertReminder creates new or updates existing one or more Reminders in store
|
||||
func UpsertReminder(ctx context.Context, s Reminders, rr ...*types.Reminder) error {
|
||||
return s.UpsertReminder(ctx, rr...)
|
||||
|
||||
@@ -20,7 +20,6 @@ type (
|
||||
CreateRoleMember(ctx context.Context, rr ...*types.RoleMember) error
|
||||
|
||||
UpdateRoleMember(ctx context.Context, rr ...*types.RoleMember) error
|
||||
PartialRoleMemberUpdate(ctx context.Context, onlyColumns []string, rr ...*types.RoleMember) error
|
||||
|
||||
UpsertRoleMember(ctx context.Context, rr ...*types.RoleMember) error
|
||||
|
||||
@@ -49,11 +48,6 @@ func UpdateRoleMember(ctx context.Context, s RoleMembers, rr ...*types.RoleMembe
|
||||
return s.UpdateRoleMember(ctx, rr...)
|
||||
}
|
||||
|
||||
// PartialRoleMemberUpdate updates one or more existing RoleMembers in store
|
||||
func PartialRoleMemberUpdate(ctx context.Context, s RoleMembers, onlyColumns []string, rr ...*types.RoleMember) error {
|
||||
return s.PartialRoleMemberUpdate(ctx, onlyColumns, rr...)
|
||||
}
|
||||
|
||||
// UpsertRoleMember creates new or updates existing one or more RoleMembers in store
|
||||
func UpsertRoleMember(ctx context.Context, s RoleMembers, rr ...*types.RoleMember) error {
|
||||
return s.UpsertRoleMember(ctx, rr...)
|
||||
|
||||
@@ -23,7 +23,6 @@ type (
|
||||
CreateRole(ctx context.Context, rr ...*types.Role) error
|
||||
|
||||
UpdateRole(ctx context.Context, rr ...*types.Role) error
|
||||
PartialRoleUpdate(ctx context.Context, onlyColumns []string, rr ...*types.Role) error
|
||||
|
||||
UpsertRole(ctx context.Context, rr ...*types.Role) error
|
||||
|
||||
@@ -78,11 +77,6 @@ func UpdateRole(ctx context.Context, s Roles, rr ...*types.Role) error {
|
||||
return s.UpdateRole(ctx, rr...)
|
||||
}
|
||||
|
||||
// PartialRoleUpdate updates one or more existing Roles in store
|
||||
func PartialRoleUpdate(ctx context.Context, s Roles, onlyColumns []string, rr ...*types.Role) error {
|
||||
return s.PartialRoleUpdate(ctx, onlyColumns, rr...)
|
||||
}
|
||||
|
||||
// UpsertRole creates new or updates existing one or more Roles in store
|
||||
func UpsertRole(ctx context.Context, s Roles, rr ...*types.Role) error {
|
||||
return s.UpsertRole(ctx, rr...)
|
||||
|
||||
@@ -21,7 +21,6 @@ type (
|
||||
CreateSetting(ctx context.Context, rr ...*types.SettingValue) error
|
||||
|
||||
UpdateSetting(ctx context.Context, rr ...*types.SettingValue) error
|
||||
PartialSettingUpdate(ctx context.Context, onlyColumns []string, rr ...*types.SettingValue) error
|
||||
|
||||
UpsertSetting(ctx context.Context, rr ...*types.SettingValue) error
|
||||
|
||||
@@ -55,11 +54,6 @@ func UpdateSetting(ctx context.Context, s Settings, rr ...*types.SettingValue) e
|
||||
return s.UpdateSetting(ctx, rr...)
|
||||
}
|
||||
|
||||
// PartialSettingUpdate updates one or more existing Settings in store
|
||||
func PartialSettingUpdate(ctx context.Context, s Settings, onlyColumns []string, rr ...*types.SettingValue) error {
|
||||
return s.PartialSettingUpdate(ctx, onlyColumns, rr...)
|
||||
}
|
||||
|
||||
// UpsertSetting creates new or updates existing one or more Settings in store
|
||||
func UpsertSetting(ctx context.Context, s Settings, rr ...*types.SettingValue) error {
|
||||
return s.UpsertSetting(ctx, rr...)
|
||||
|
||||
@@ -24,7 +24,6 @@ type (
|
||||
CreateUser(ctx context.Context, rr ...*types.User) error
|
||||
|
||||
UpdateUser(ctx context.Context, rr ...*types.User) error
|
||||
PartialUserUpdate(ctx context.Context, onlyColumns []string, rr ...*types.User) error
|
||||
|
||||
UpsertUser(ctx context.Context, rr ...*types.User) error
|
||||
|
||||
@@ -89,11 +88,6 @@ func UpdateUser(ctx context.Context, s Users, rr ...*types.User) error {
|
||||
return s.UpdateUser(ctx, rr...)
|
||||
}
|
||||
|
||||
// PartialUserUpdate updates one or more existing Users in store
|
||||
func PartialUserUpdate(ctx context.Context, s Users, onlyColumns []string, rr ...*types.User) error {
|
||||
return s.PartialUserUpdate(ctx, onlyColumns, rr...)
|
||||
}
|
||||
|
||||
// UpsertUser creates new or updates existing one or more Users in store
|
||||
func UpsertUser(ctx context.Context, s Users, rr ...*types.User) error {
|
||||
return s.UpsertUser(ctx, rr...)
|
||||
|
||||
Reference in New Issue
Block a user