develop/batch-jobs #13
@ -2,7 +2,6 @@ package database
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"gorm.io/gorm"
|
|
||||||
|
|
||||||
"git.dragse.it/anthrove/otter-space-sdk/v2/pkg/models"
|
"git.dragse.it/anthrove/otter-space-sdk/v2/pkg/models"
|
||||||
)
|
)
|
||||||
@ -13,7 +12,7 @@ type Post interface {
|
|||||||
CreatePost(ctx context.Context, anthrovePost *models.Post) error
|
CreatePost(ctx context.Context, anthrovePost *models.Post) error
|
||||||
|
|
||||||
// TODO: Everything
|
// TODO: Everything
|
||||||
CreatePostInBatch(ctx context.Context, db *gorm.DB, anthrovePost []models.Post, batchSize int) error
|
CreatePostInBatch(ctx context.Context, anthrovePost []models.Post, batchSize int) error
|
||||||
|
|
||||||
// GetPostByAnthroveID retrieves a post by its Anthrove ID.
|
// GetPostByAnthroveID retrieves a post by its Anthrove ID.
|
||||||
GetPostByAnthroveID(ctx context.Context, anthrovePostID models.AnthrovePostID) (*models.Post, error)
|
GetPostByAnthroveID(ctx context.Context, anthrovePostID models.AnthrovePostID) (*models.Post, error)
|
||||||
|
@ -92,7 +92,7 @@ func (p *postgresqlConnection) CreatePost(ctx context.Context, anthrovePost *mod
|
|||||||
return postgres.CreatePost(ctx, p.db, anthrovePost)
|
return postgres.CreatePost(ctx, p.db, anthrovePost)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *postgresqlConnection) CreatePostInBatch(ctx context.Context, db *gorm.DB, anthrovePost []models.Post, batchSize int) error {
|
func (p *postgresqlConnection) CreatePostInBatch(ctx context.Context, anthrovePost []models.Post, batchSize int) error {
|
||||||
return postgres.CreatePostInBatch(ctx, p.db, anthrovePost, batchSize)
|
return postgres.CreatePostInBatch(ctx, p.db, anthrovePost, batchSize)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user