BREAKING CHANGE: V2 of thr SDK #12
No reviewers
Labels
No Milestone
No project
No Assignees
2 Participants
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: anthrove/otter-space-sdk#12
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "develop/postgresql"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR is a complete rewrite of the SDK for the use of a PostgreSQL. It breaks all version
This is a breaking change!
It breaks every version that came before since it completely removed thr ability to communicate with thr Graph Database and renamed nearly all functions.
It also introduced new API endpoints to use
@ -0,0 +59,4 @@
return &post, nil
}
func GetPostByURL(ctx context.Context, db *gorm.DB, sourceURL string) (*models.Post, error) {
didn't we call the sourceURL not postUrl or so?
Something, so we don't mix it up with domainUrl or sourceDomain...
@ -0,0 +47,4 @@
dbLogger := logger2.New(log2.New(os.Stdout, "\r\n", log2.LstdFlags), logger2.Config{
SlowThreshold: 200 * time.Millisecond,
LogLevel: logger2.Info,
Set this LogLevel depending on DEBUG or not in config
@ -0,0 +7,4 @@
)
type Tag interface {
// GetAllTags retrieves all tags.
Did I miss it or where are the create Tag, delete tag and so on functions?
we never decided to implement those functions since those operations are build in other functions, but I can add a Create, Get and Delete functions for Tag. Like i did fir TagGroup and TagType
yes please
@ -0,0 +9,4 @@
type User interface {
// CreateUserWithRelationToSource adds a user with a relation to a source.
CreateUserWithRelationToSource(ctx context.Context, anthroveUserID models.AnthroveUserID, sourceID models.AnthroveSourceID, accountId string, accountUsername string) error
Here you write Relation and one function below you call it reference... shouldn't be it the same?
I dont see what you mean, in this file there is nothing with
reference
@ -0,0 +12,4 @@
return "UserFavorites"
}
type FavoriteList struct {
I am unsure... what is your opinion about moving specific structs thats are only for SDK Responses to an own file like
api.go
in this package?That makes sense, so we can distinguish it easier
@ -0,0 +69,4 @@
return nil, &otterError.EntityValidationFailed{Reason: "tagType cannot be empty"}
}
result := db.WithContext(ctx).Find(&tags).Where("tag_type = ?", tagType)
please use Scan instead of Find if you have a Where clause.
Or if you use find, put the Filter into the find function. Also its best practice if you move the Find, Scan, Create, ... as last method.