Rename module to new repository root

This commit is contained in:
Achim Rohn
2025-11-15 12:04:39 +01:00
parent 7d213824cf
commit 18d05566e2
85 changed files with 251 additions and 251 deletions
@@ -7,8 +7,8 @@ import (
"context"
"encoding/json"
"errors"
"ersteller-lib"
"fmt"
"git.gorlug.de/code/ersteller"
"github.com/doug-martin/goqu/v9"
_ "github.com/doug-martin/goqu/v9/dialect/postgres"
"github.com/doug-martin/goqu/v9/exp"
@@ -42,13 +42,13 @@ func (r *GoogleAuthRepository) Create(googleAuth GoogleAuth) (int, error) {
Returning("id").
ToSQL()
if err != nil {
ersteller_lib.LogError("error creating create GoogleAuth sql: %v", err)
ersteller.LogError("error creating create GoogleAuth sql: %v", err)
return -1, err
}
rows, err := r.connPool.Query(context.Background(), sql, args...)
if err != nil {
ersteller_lib.LogError("error creating GoogleAuth: %v", err)
ersteller.LogError("error creating GoogleAuth: %v", err)
return -1, err
}
defer rows.Close()
@@ -56,11 +56,11 @@ func (r *GoogleAuthRepository) Create(googleAuth GoogleAuth) (int, error) {
if rows.Next() {
err = rows.Scan(&id)
if err != nil {
ersteller_lib.LogError("error scanning User: %v", err)
ersteller.LogError("error scanning User: %v", err)
return -1, err
}
} else {
ersteller_lib.Error("GoogleAuth already exists")
ersteller.Error("GoogleAuth already exists")
return -1, GoogleAuthAlreadyExistsError{GoogleAuth: googleAuth}
}
@@ -83,7 +83,7 @@ func (r *GoogleAuthRepository) getSelectColumns() []any {
}
func (r *GoogleAuthRepository) Read(userId int, id int) (GoogleAuth, error) {
ersteller_lib.Debug("Getting GoogleAuth by id ", id)
ersteller.Debug("Getting GoogleAuth by id ", id)
sql, args, _ := r.dialect.From("googleAuth").
Prepared(true).
Select(r.getSelectColumns()...).
@@ -95,7 +95,7 @@ func (r *GoogleAuthRepository) Read(userId int, id int) (GoogleAuth, error) {
rows, err := r.connPool.Query(context.Background(), sql, args...)
if err != nil {
ersteller_lib.Error("Failed to get GoogleAuth: ", err)
ersteller.Error("Failed to get GoogleAuth: ", err)
}
defer rows.Close()
if rows.Next() {
@@ -162,13 +162,13 @@ func (r *GoogleAuthRepository) Update(userId int, googleAuth GoogleAuth) error {
}).
ToSQL()
if err != nil {
ersteller_lib.LogError("error creating update GoogleAuth sql: %v", err)
ersteller.LogError("error creating update GoogleAuth sql: %v", err)
return err
}
_, err = r.connPool.Exec(context.Background(), sql, args...)
if err != nil {
ersteller_lib.LogError("error updating GoogleAuth: %v", err)
ersteller.LogError("error updating GoogleAuth: %v", err)
return err
}
@@ -184,13 +184,13 @@ func (r *GoogleAuthRepository) Delete(userId int, id int) error {
}).
ToSQL()
if err != nil {
ersteller_lib.LogError("error creating delete GoogleAuth sql: %v", err)
ersteller.LogError("error creating delete GoogleAuth sql: %v", err)
return err
}
_, err = r.connPool.Exec(context.Background(), sql, args...)
if err != nil {
ersteller_lib.LogError("error deleting GoogleAuth: %v", err)
ersteller.LogError("error deleting GoogleAuth: %v", err)
return err
}
@@ -266,7 +266,7 @@ func (r *GoogleAuthRepository) GetPage(params GoogleAuthPaginationParams) ([]Goo
rows, err := r.connPool.Query(context.Background(), sql, args...)
if err != nil {
ersteller_lib.LogError("failed to run sql query: %v", err)
ersteller.LogError("failed to run sql query: %v", err)
return nil, -1, err
}
defer rows.Close()