BREAKING CHANGE: V2 of thr SDK #12

Merged
fenpaws merged 124 commits from develop/postgresql into main 2024-07-01 20:46:28 +00:00
Owner

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

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
fenpaws added this to the v2.0.0 milestone 2024-07-01 15:34:13 +00:00
fenpaws added the
enhancement
label 2024-07-01 15:34:13 +00:00
fenpaws self-assigned this 2024-07-01 15:34:13 +00:00
lennard.brinkhaus was assigned by fenpaws 2024-07-01 15:34:13 +00:00
fenpaws added 119 commits 2024-07-01 15:34:15 +00:00
Signed-off-by: SoXX <soxx@fenpa.ws>
Signed-off-by: SoXX <soxx@fenpa.ws>
Signed-off-by: SoXX <soxx@fenpa.ws>
Signed-off-by: SoXX <soxx@fenpa.ws>
Signed-off-by: SoXX <soxx@fenpa.ws>
Signed-off-by: SoXX <soxx@fenpa.ws>
Signed-off-by: SoXX <soxx@fenpa.ws>
Signed-off-by: SoXX <soxx@fenpa.ws>
Signed-off-by: SoXX <soxx@fenpa.ws>
Signed-off-by: SoXX <soxx@fenpa.ws>
Signed-off-by: SoXX <soxx@fenpa.ws>
Signed-off-by: SoXX <soxx@fenpa.ws>
Signed-off-by: SoXX <soxx@fenpa.ws>
Signed-off-by: SoXX <soxx@fenpa.ws>
Signed-off-by: SoXX <soxx@fenpa.ws>
Signed-off-by: SoXX <soxx@fenpa.ws>
Signed-off-by: SoXX <soxx@fenpa.ws>
Signed-off-by: SoXX <soxx@fenpa.ws>
Signed-off-by: soxx <soxx@fenpa.ws>
Signed-off-by: soxx <soxx@fenpa.ws>
Signed-off-by: soxx <soxx@fenpa.ws>
Signed-off-by: soxx <soxx@fenpa.ws>
Signed-off-by: soxx <soxx@fenpa.ws>
Signed-off-by: soxx <soxx@fenpa.ws>
Signed-off-by: soxx <soxx@fenpa.ws>
Signed-off-by: soxx <soxx@fenpa.ws>
Signed-off-by: soxx <soxx@fenpa.ws>
Signed-off-by: soxx <soxx@fenpa.ws>
Signed-off-by: soxx <soxx@fenpa.ws>
Signed-off-by: soxx <soxx@fenpa.ws>
Signed-off-by: soxx <soxx@fenpa.ws>
Signed-off-by: soxx <soxx@fenpa.ws>
Signed-off-by: soxx <soxx@fenpa.ws>
Signed-off-by: soxx <soxx@fenpa.ws>
Signed-off-by: soxx <soxx@fenpa.ws>
Signed-off-by: soxx <soxx@fenpa.ws>
Signed-off-by: soxx <soxx@fenpa.ws>
Signed-off-by: soxx <soxx@fenpa.ws>
Signed-off-by: soxx <soxx@fenpa.ws>
Signed-off-by: soxx <soxx@fenpa.ws>
Signed-off-by: soxx <soxx@fenpa.ws>
Signed-off-by: soxx <soxx@fenpa.ws>
Signed-off-by: soxx <soxx@fenpa.ws>
Signed-off-by: soxx <soxx@fenpa.ws>
Signed-off-by: soxx <soxx@fenpa.ws>
Signed-off-by: soxx <soxx@fenpa.ws>
Signed-off-by: soxx <soxx@fenpa.ws>
Signed-off-by: soxx <soxx@fenpa.ws>
Signed-off-by: soxx <soxx@fenpa.ws>
Signed-off-by: SoXX <soxx@fenpa.ws>
ci(postgres): fixed trigger
All checks were successful
Gitea Build Check / Build (push) Successful in 10m54s
bfa074fd9b
Signed-off-by: SoXX <soxx@fenpa.ws>
Signed-off-by: SoXX <soxx@fenpa.ws>
feat(postgres): using only gorm
All checks were successful
Gitea Build Check / Build (push) Successful in 10m40s
57729359d2
Signed-off-by: SoXX <soxx@fenpa.ws>
feat(postgres): added more tests
All checks were successful
Gitea Build Check / Build (push) Successful in 10m40s
30fa03ef9a
Signed-off-by: SoXX <soxx@fenpa.ws>
test(postgres): added more tests
All checks were successful
Gitea Build Check / Build (push) Successful in 10m49s
2a752adcac
Signed-off-by: soxx <soxx@fenpa.ws>
test(postgres): added more tests and some fixes
All checks were successful
Gitea Build Check / Build (push) Successful in 10m44s
97758b180e
Signed-off-by: soxx <soxx@fenpa.ws>
Signed-off-by: soxx <soxx@fenpa.ws>
docs(postgres): added all the sonarqube badges
Some checks failed
Gitea Build Check / Build (push) Has been cancelled
df14171bad
Signed-off-by: soxx <soxx@fenpa.ws>
docs(postgres): rearranged
Some checks failed
Gitea Build Check / Build (push) Has been cancelled
895c4cd436
Signed-off-by: soxx <soxx@fenpa.ws>
Signed-off-by: soxx <soxx@fenpa.ws>
refactor(postgres): use generics for IDs
Some checks failed
Gitea Build Check / Build (push) Failing after 4m57s
31c4249129
Signed-off-by: soxx <soxx@fenpa.ws>
feat(postgres): start implementing new generic orm model
Some checks failed
Gitea Build Check / Build (push) Failing after 5m46s
5aac1f2916
Signed-off-by: soxx <soxx@fenpa.ws>
test(postgres): finished test migrations to generic orm base
Some checks failed
Gitea Build Check / Build (push) Has been cancelled
c0cae140f1
Signed-off-by: SoXX <soxx@fenpa.ws>
ci: disable check for latest go
Some checks failed
Gitea Build Check / Build (push) Has been cancelled
d3c0599263
Signed-off-by: SoXX <soxx@fenpa.ws>
ci: disable cache
Some checks failed
Gitea Build Check / Build (push) Failing after 1m17s
d8f338332b
Signed-off-by: SoXX <soxx@fenpa.ws>
test(postgres): fixed to use new ORM Generic
Some checks failed
Gitea Build Check / Build (push) Failing after 1m15s
07b69f6c18
Signed-off-by: SoXX <soxx@fenpa.ws>
feat(postgres): updated go mod
Some checks failed
Gitea Build Check / Build (push) Failing after 1m19s
819dc7055a
Signed-off-by: SoXX <soxx@fenpa.ws>
ci: readable cache and check for latest
Some checks failed
Gitea Build Check / Build (push) Has been cancelled
f34cc637ec
Signed-off-by: SoXX <soxx@fenpa.ws>
ci: update version of steps
All checks were successful
Gitea Build Check / Build (push) Successful in 11m7s
c246f661ff
Signed-off-by: SoXX <soxx@fenpa.ws>
feat(error): added first steps for custom errors
All checks were successful
Gitea Build Check / Build (push) Successful in 11m2s
63e74219ed
Signed-off-by: SoXX <soxx@fenpa.ws>
Signed-off-by: SoXX <soxx@fenpa.ws>
tests(errors): fix test cases to reflect the new validation and error handling
Some checks failed
Gitea Build Check / Build (push) Failing after 5m49s
f66fc6b6d7
Signed-off-by: SoXX <soxx@fenpa.ws>
Signed-off-by: SoXX <soxx@fenpa.ws>
fix(errors): added const
All checks were successful
Gitea Build Check / Build (push) Successful in 10m58s
4fa936d774
Signed-off-by: SoXX <soxx@fenpa.ws>
Signed-off-by: SoXX <soxx@fenpa.ws>
Signed-off-by: SoXX <soxx@fenpa.ws>
fix(errors): fix unneeded error handling
Some checks failed
Gitea Build Check / Build (push) Failing after 5m41s
615a6b1a25
Signed-off-by: SoXX <soxx@fenpa.ws>
fix(errors): added more tests
Some checks failed
Gitea Build Check / Build (push) Failing after 5m41s
a026563835
Signed-off-by: SoXX <soxx@fenpa.ws>
ci: fix go command to show in log
Some checks failed
Gitea Build Check / Build (push) Failing after 5m40s
0a5359d723
Signed-off-by: SoXX <soxx@fenpa.ws>
ci: fix go command to show in log
Some checks failed
Gitea Build Check / Build (push) Failing after 5m38s
97d314ba3e
Signed-off-by: SoXX <soxx@fenpa.ws>
test(helper): extend the waiting time to 10 seconds
All checks were successful
Gitea Build Check / Build (push) Successful in 10m40s
a9a21581bd
Signed-off-by: SoXX <soxx@fenpa.ws>
feat(functions): enhanced function with RAW SQL
Some checks failed
Gitea Build Check / Build (push) Failing after 4m59s
e29cea6e3c
Signed-off-by: SoXX <soxx@fenpa.ws>
Signed-off-by: SoXX <soxx@fenpa.ws>
refactor(postgres): a lot of things happened here
Some checks failed
Gitea Build Check / Build (push) Failing after 6m7s
da4fda3597
Signed-off-by: SoXX <soxx@fenpa.ws>
Signed-off-by: SoXX <soxx@fenpa.ws>
Signed-off-by: SoXX <soxx@fenpa.ws>
fix(tests): remove timeout
Some checks failed
Gitea Build Check / Build (push) Failing after 4m49s
9c8a7c1e16
Signed-off-by: SoXX <soxx@fenpa.ws>
Signed-off-by: SoXX <soxx@fenpa.ws>
Signed-off-by: SoXX <soxx@fenpa.ws>
Signed-off-by: SoXX <soxx@fenpa.ws>
Signed-off-by: SoXX <soxx@fenpa.ws>
tests: fixed tests
All checks were successful
Gitea Build Check / Build (push) Successful in 10m55s
b5437ecc62
Signed-off-by: SoXX <soxx@fenpa.ws>
feat(TagAlias): added function and tests
All checks were successful
Gitea Build Check / Build (push) Successful in 11m5s
bb45658310
Signed-off-by: SoXX <soxx@fenpa.ws>
Signed-off-by: SoXX <soxx@fenpa.ws>
feat(TagAlias): added function and tests
All checks were successful
Gitea Build Check / Build (push) Successful in 11m35s
702870db1e
Signed-off-by: SoXX <soxx@fenpa.ws>
feat(TagGroup): added function and tests
All checks were successful
Gitea Build Check / Build (push) Successful in 11m24s
d759e072f7
Signed-off-by: SoXX <soxx@fenpa.ws>
Signed-off-by: SoXX <soxx@fenpa.ws>
feat: implemented all functions
All checks were successful
Gitea Build Check / Build (push) Successful in 11m38s
5f9ace9bd3
Signed-off-by: SoXX <soxx@fenpa.ws>
fix: make sonarqube happy
All checks were successful
Gitea Build Check / Build (push) Successful in 11m26s
Gitea Build Check / Build (pull_request) Successful in 11m31s
3dfb345edc
Signed-off-by: SoXX <soxx@fenpa.ws>
fenpaws added this to the Anthrove project 2024-07-01 15:34:20 +00:00
lennard.brinkhaus requested changes 2024-07-01 19:07:23 +00:00
Dismissed
@ -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...

didn't we call the sourceURL not postUrl or so? Something, so we don't mix it up with domainUrl or sourceDomain...
fenpaws marked this conversation as resolved
@ -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

Set this LogLevel depending on DEBUG or not in config
fenpaws marked this conversation as resolved
@ -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?

Did I miss it or where are the create Tag, delete tag and so on functions?
Author
Owner

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

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

yes please
lennard.brinkhaus marked this conversation as resolved
@ -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?

Here you write Relation and one function below you call it reference... shouldn't be it the same?
Author
Owner

I dont see what you mean, in this file there is nothing with reference

I dont see what you mean, in this file there is nothing with `reference`
fenpaws marked this conversation as resolved
@ -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 likeapi.go in this package?

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?
Author
Owner

That makes sense, so we can distinguish it easier

That makes sense, so we can distinguish it easier
fenpaws marked this conversation as resolved
fenpaws added 1 commit 2024-07-01 19:42:22 +00:00
fix: fixed issues in PR
All checks were successful
Gitea Build Check / Build (push) Successful in 11m38s
Gitea Build Check / Build (pull_request) Successful in 11m37s
47fda2994b
Signed-off-by: SoXX <soxx@fenpa.ws>
lennard.brinkhaus approved these changes 2024-07-01 20:00:04 +00:00
Dismissed
fenpaws added 3 commits 2024-07-01 20:29:55 +00:00
Signed-off-by: SoXX <soxx@fenpa.ws>
Signed-off-by: SoXX <soxx@fenpa.ws>
refactor: added getting of tag by specific type
Some checks failed
Gitea Build Check / Build (push) Has been cancelled
Gitea Build Check / Build (pull_request) Successful in 11m44s
2d4102be6a
Signed-off-by: SoXX <soxx@fenpa.ws>
lennard.brinkhaus approved these changes 2024-07-01 20:34:25 +00:00
Dismissed
@ -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.

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.
fenpaws marked this conversation as resolved
fenpaws added 1 commit 2024-07-01 20:41:08 +00:00
fix: fixed function to work properly
Some checks failed
Gitea Build Check / Build (pull_request) Failing after 6m32s
Gitea Build Check / Build (push) Failing after 6m28s
768203ebd7
Signed-off-by: SoXX <soxx@fenpa.ws>
lennard.brinkhaus approved these changes 2024-07-01 20:42:28 +00:00
fenpaws merged commit a39cfd2027 into main 2024-07-01 20:46:28 +00:00
fenpaws deleted branch develop/postgresql 2024-07-01 20:46:30 +00:00
This repo is archived. You cannot comment on pull requests.
No description provided.