Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/delete and update #14

Merged
merged 159 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
159 commits
Select commit Hold shift + click to select a range
dc408d6
update mockery version
FrancoLiberali Jul 27, 2023
e2c0776
fix typos in Authentication, resource and constructor
FrancoLiberali Jul 27, 2023
83e1446
fix route for auth unit tests
FrancoLiberali Jul 27, 2023
33e371c
remove error that is always nil
FrancoLiberali Jul 27, 2023
03c876c
add TODO to the changes to be done in the session service
FrancoLiberali Jul 27, 2023
960f598
add error management to middlewareJSON
FrancoLiberali Jul 27, 2023
1f7761f
add CommandInitializer to init configuration keys
FrancoLiberali Jul 27, 2023
28e3ecb
init database configuration keys
FrancoLiberali Jul 27, 2023
63de335
init session configuration keys
FrancoLiberali Jul 27, 2023
807e598
init initialization configuration keys
FrancoLiberali Jul 27, 2023
2de14ef
init server configuration keys
FrancoLiberali Jul 27, 2023
2dc5907
init logger configuration keys
FrancoLiberali Jul 27, 2023
cbb6f5c
remove unused r.md file in commands
FrancoLiberali Jul 27, 2023
d165eec
move time to utils
FrancoLiberali Jul 27, 2023
b80f2e4
create super user when adding the auth controller
FrancoLiberali Jul 27, 2023
88db618
update info controller and routes creation
FrancoLiberali Jul 27, 2023
1730a33
change the way badaas server is created
FrancoLiberali Jul 27, 2023
25f8e57
move test e2e to test_e2e/ and docker to docker/
FrancoLiberali Jul 28, 2023
f1bed03
do not run auto migration on test e2e execution + automigration refactor
FrancoLiberali Jul 28, 2023
f523952
update docs and developers utils
FrancoLiberali Jul 27, 2023
227c9c2
remove unnecesary init.sh for cockroach and add health check
FrancoLiberali Jul 31, 2023
e51325e
move db connection to orm module and make automigration possible by fx
FrancoLiberali Jul 31, 2023
ff2318e
info and auth modules now also provide the corresponding services and…
FrancoLiberali Jul 31, 2023
8ccf49c
use gotestsum to run tests + create tests report + tool to install de…
FrancoLiberali Jul 31, 2023
e3da4cc
add base models to orm
FrancoLiberali Jul 31, 2023
d12b69e
add crud services and repositories in orm module
FrancoLiberali Jul 31, 2023
e61ac47
adapt existing services and controllers to use orm module
FrancoLiberali Jul 31, 2023
ef381b2
add integration tests
FrancoLiberali Jul 31, 2023
319dd73
update documentation
FrancoLiberali Jul 31, 2023
a9c3ead
update changelog
FrancoLiberali Jul 31, 2023
0d23c80
add support for operators in conditions
FrancoLiberali Aug 2, 2023
76ec3ad
add noteq
FrancoLiberali Aug 2, 2023
48acfb0
add lt
FrancoLiberali Aug 2, 2023
50c98cb
add ltoreq
FrancoLiberali Aug 2, 2023
5a1f2a9
add gt
FrancoLiberali Aug 2, 2023
2533e08
add gtoreq
FrancoLiberali Aug 2, 2023
7561db8
add isnull
FrancoLiberali Aug 2, 2023
29104e6
add isnotnull
FrancoLiberali Aug 2, 2023
4a75076
add is true
FrancoLiberali Aug 2, 2023
82e9158
add is not true
FrancoLiberali Aug 2, 2023
0a60e91
add is false
FrancoLiberali Aug 2, 2023
9b9395c
add is not false
FrancoLiberali Aug 2, 2023
e277f57
add is unknown
FrancoLiberali Aug 2, 2023
1b94fbb
add is not unknown
FrancoLiberali Aug 2, 2023
a3e17cf
add is distict
FrancoLiberali Aug 2, 2023
cc33e8d
add is not distict
FrancoLiberali Aug 2, 2023
6fbe12a
add array in
FrancoLiberali Aug 2, 2023
a9e92b5
add array not in
FrancoLiberali Aug 2, 2023
d05e0ad
add like
FrancoLiberali Aug 2, 2023
70954a3
add between
FrancoLiberali Aug 2, 2023
26b9a0a
add not between
FrancoLiberali Aug 2, 2023
db62750
add and
FrancoLiberali Aug 2, 2023
d91f446
add or
FrancoLiberali Aug 2, 2023
b1778eb
add not
FrancoLiberali Aug 2, 2023
4215ea3
add unsafe conditions
FrancoLiberali Aug 2, 2023
28f4d79
use all coverage files in sonar
FrancoLiberali Aug 2, 2023
23ea895
ignore all tests results
FrancoLiberali Aug 2, 2023
e7e8f45
update changelog
FrancoLiberali Aug 2, 2023
9107f17
create mocks for new types
FrancoLiberali Aug 2, 2023
6c6d117
replace inverse join generation by inverse reference in models
FrancoLiberali Aug 3, 2023
18b87e5
table class in place of strings for table name
FrancoLiberali Aug 3, 2023
32b8501
update to conditions generation that fix embedded names
FrancoLiberali Aug 3, 2023
3def06b
refactor: add field identifier
FrancoLiberali Aug 3, 2023
84460cc
add possibility to do preload
FrancoLiberali Aug 3, 2023
b353437
support nested preloads
FrancoLiberali Aug 3, 2023
7fa6b18
add a way to know if a relation was loaded or not
FrancoLiberali Aug 3, 2023
f95f61f
list and nested attributes preload
FrancoLiberali Jun 28, 2023
958f0be
update mocks
FrancoLiberali Aug 3, 2023
4a7beb3
update changelog
FrancoLiberali Aug 3, 2023
0d72fd4
refactor: replace gorm.db by query object
FrancoLiberali Aug 4, 2023
0236a7c
move table to the same file of query
FrancoLiberali Aug 4, 2023
2fc0219
move unsafe condition to unsafe package
FrancoLiberali Aug 4, 2023
95b0dbd
add details to errors
FrancoLiberali Aug 4, 2023
12b8255
add dynamic operators
FrancoLiberali Aug 4, 2023
e5e925e
add unsafe operators
FrancoLiberali Aug 4, 2023
745f13e
update chagelog
FrancoLiberali Aug 7, 2023
948a829
update mocks
FrancoLiberali Aug 7, 2023
6fc1481
add new linting configuration
FrancoLiberali Aug 7, 2023
58744db
fix new lint errors
FrancoLiberali Aug 7, 2023
5ebe2b7
add test e2e to linting
FrancoLiberali Aug 7, 2023
90829cf
fix new linting errors in test e2e
FrancoLiberali Aug 7, 2023
0edd34c
badaas-orm module reorganization
FrancoLiberali Aug 9, 2023
4d51366
add readthedocs files
FrancoLiberali Aug 7, 2023
ab7cca7
add golangci-lint to dependencies
FrancoLiberali Aug 7, 2023
19bd517
move validators to utils
FrancoLiberali Aug 7, 2023
2088aa2
move badaas docs to readthedocs
FrancoLiberali Aug 7, 2023
2205389
move badaas-orm docs to readthedocs
FrancoLiberali Aug 7, 2023
b5eb587
add code of conduct
FrancoLiberali Aug 7, 2023
1de698b
add readme badges
FrancoLiberali Aug 7, 2023
afb964c
move contributing docs to readthedocs
FrancoLiberali Aug 8, 2023
2536cb1
add new default logger and update gormzap
FrancoLiberali Aug 9, 2023
5338d60
add transaction trace
FrancoLiberali Aug 9, 2023
ad6043f
add logger config from config file
FrancoLiberali Aug 9, 2023
c1eb636
move gormdatabase to database and config new logger
FrancoLiberali Aug 9, 2023
f5b7682
update mocks
FrancoLiberali Aug 9, 2023
aaafd70
update docs
FrancoLiberali Aug 9, 2023
cc070a6
add support for other sql databases
FrancoLiberali Aug 10, 2023
34a2251
allow runing int tests over multiple databases
FrancoLiberali Aug 10, 2023
ab4927b
add database specific operators
FrancoLiberali Aug 10, 2023
019a7f2
update docs
FrancoLiberali Aug 10, 2023
2311133
update changelog
FrancoLiberali Aug 10, 2023
2ac2d9c
rename query to gormquery
FrancoLiberali Aug 23, 2023
78ab915
change crud repos to orm query api
FrancoLiberali Aug 23, 2023
e76268f
new conditions api
FrancoLiberali Aug 28, 2023
1f54467
adapt docs to new api
FrancoLiberali Aug 23, 2023
2ec2df2
move gormfx to a independient package
FrancoLiberali Aug 22, 2023
8f74308
add badaas integration tests
FrancoLiberali Aug 23, 2023
1e2dafa
add badaas-orm quickstart docs
FrancoLiberali Aug 16, 2023
83f5e8a
add badaas-orm tutorial docs
FrancoLiberali Aug 16, 2023
cad74b2
first, take and last
FrancoLiberali Aug 23, 2023
cfd9f38
order
FrancoLiberali Aug 23, 2023
b2cd247
limit and offset
FrancoLiberali Aug 23, 2023
355f894
add new methods doc
FrancoLiberali Aug 29, 2023
756ae12
add new tutorial for modifier methods
FrancoLiberali Aug 29, 2023
ffe2ffa
update docs dependencies
FrancoLiberali Aug 29, 2023
7f778cf
use constants for dialectors
FrancoLiberali Sep 7, 2023
11b18b7
primer tests de update que solo soportan un set
FrancoLiberali Sep 4, 2023
5d13acc
multi set + joins primer version a cambiar
FrancoLiberali Sep 5, 2023
320c104
terminar el update join para postgres
FrancoLiberali Sep 5, 2023
8e99c9f
tambien para sqlite que es igual que posgres
FrancoLiberali Sep 5, 2023
aa5528c
para mysql
FrancoLiberali Sep 5, 2023
fa9bf4b
primer for solo para posgre y sqlite
FrancoLiberali Sep 5, 2023
0caab46
poder usar el joinType del join
FrancoLiberali Sep 5, 2023
cfbf232
arreglar commit anterior
FrancoLiberali Sep 5, 2023
985c59f
remove repeted code
FrancoLiberali Sep 5, 2023
c87b412
add sqlserver
FrancoLiberali Sep 6, 2023
aeead8b
fix join from in gorm fork
FrancoLiberali Sep 6, 2023
cf7ffa7
replace gorm dialectors with forks
FrancoLiberali Sep 6, 2023
a3c129e
use gorm version that support update join
FrancoLiberali Sep 7, 2023
6c52a0c
fix updated_at para mysql
FrancoLiberali Sep 7, 2023
f789358
borrar comentarios
FrancoLiberali Sep 7, 2023
b42d734
comentario para update from
FrancoLiberali Sep 7, 2023
fd8ff3f
comentario para update join
FrancoLiberali Sep 7, 2023
3e3cf20
dynamic update
FrancoLiberali Sep 7, 2023
de15651
update unsafe
FrancoLiberali Sep 7, 2023
b08b7fc
remove TODO
FrancoLiberali Sep 7, 2023
24b9384
mysql update multiple tables
FrancoLiberali Sep 7, 2023
d344059
agregar error si queres usar mysql en otra base
FrancoLiberali Sep 7, 2023
d1b44ef
usar constantes para el dialector
FrancoLiberali Sep 7, 2023
8f21d69
agregar nombre del metodo a errores producidos en update
FrancoLiberali Sep 7, 2023
5d72f90
agregar join number al dynamic
FrancoLiberali Sep 7, 2023
77f2966
hacer el update multiple distinto
FrancoLiberali Sep 7, 2023
b5d5693
usar constantes para mysql
FrancoLiberali Sep 7, 2023
571ea5e
arreglar la nueva forma de hacerlo para mysql
FrancoLiberali Sep 7, 2023
c4e2dee
usar clauses en lugar de addcluase
FrancoLiberali Sep 7, 2023
5c3c64d
update returning
FrancoLiberali Sep 8, 2023
ce29146
update order by
FrancoLiberali Sep 8, 2023
ee0d24c
mover update a otra clase para que se puedan verificar los metodos en…
FrancoLiberali Sep 8, 2023
75c0358
fix returning preload para sqlite
FrancoLiberali Sep 8, 2023
8ae0fea
borrar codigo innecesario del anterior
FrancoLiberali Sep 8, 2023
99139f9
add support for sqlserver returning
FrancoLiberali Sep 8, 2023
f1509e6
nueva api comienzo y parte poner en pr anterior
FrancoLiberali Sep 9, 2023
1f69e6f
arreglar los problemas con compilacion de la nueva api
FrancoLiberali Sep 9, 2023
8236511
bool solo cosas de bool y todos los operadores son compatibles
FrancoLiberali Sep 9, 2023
7bb9888
nueva organizacion en carpetas
FrancoLiberali Sep 10, 2023
4b834e9
agregar el delete
FrancoLiberali Sep 11, 2023
ce048d3
agregar todas las funcionalidades de delete
FrancoLiberali Sep 12, 2023
a7dac4a
Merge branch 'main' into feature/delete_and_update
FrancoLiberali Dec 18, 2023
9577310
cli: delete and update
FrancoLiberali Dec 18, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,3 +167,21 @@ jobs:
with:
name: docker-compose-e2e-logs
path: app.log

sonarcloud:
name: SonarCloud
needs: [check-style, integration-tests]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Download line coverage reports
uses: actions/download-artifact@v3
with:
name: coverage
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
126 changes: 47 additions & 79 deletions cli/cmd/gen/conditions/condition.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,16 @@ import (
)

const (
// badaas/orm
badaasORMFieldIs = "FieldIs"
badaasORMBoolFieldIs = "BoolFieldIs"
badaasORMStringFieldIs = "StringFieldIs"
// badaas/orm/condition
conditionPath = badaasORMPath + "/condition"
// badaas/orm/cql
cqlPath = badaasORMPath + "/cql"
badaasORMCondition = "Condition"
badaasORMJoinCondition = "JoinCondition"
badaasORMNewJoinCondition = "NewJoinCondition"
badaasORMNewCollectionPreload = "NewCollectionPreloadCondition"
badaasORMNewPreloadCondition = "NewPreloadCondition"
// badaas/orm/query
queryPath = badaasORMPath + "/query"
badaasORMFieldIdentifier = "FieldIdentifier"
badaasORMField = "Field"
badaasORMBoolField = "BoolField"
badaasORMStringField = "StringField"
// badaas/orm/model
modelPath = badaasORMPath + "/model"
uIntID = "UIntID"
Expand Down Expand Up @@ -65,7 +61,7 @@ func (condition *Condition) generate(objectType Type, field Field) {
// the field is a basic type (string, int, etc)
// adapt param to that type and generate a WhereCondition
condition.param.ToBasicKind(fieldType)
condition.generateWhere(
condition.createField(
objectType,
field,
)
Expand Down Expand Up @@ -135,7 +131,7 @@ func (condition *Condition) generateForNamedType(objectType Type, field Field) {
case field.Type.IsSQLNullableType():
// field is a sql nullable type (sql.NullBool, sql.NullInt, etc.)
condition.param.SQLToBasicType(field.Type)
condition.generateWhere(
condition.createField(
objectType,
field,
)
Expand All @@ -144,7 +140,7 @@ func (condition *Condition) generateForNamedType(objectType Type, field Field) {
// or a named type supported by gorm (time.Time)
// or a badaas-orm id (uuid or uintid)
condition.param.ToCustomType(condition.destPkg, field.Type)
condition.generateWhere(
condition.createField(
objectType,
field,
)
Expand All @@ -171,54 +167,6 @@ func (condition *Condition) generateForBadaasModel(objectType Type, field Field)
}
}

// Generate a WhereCondition between object and field
func (condition *Condition) generateWhere(objectType Type, field Field) {
objectTypeQual := jen.Qual(
getRelativePackagePath(condition.destPkg, objectType),
objectType.Name(),
)

conditionName := getConditionName(field) + "Is"
log.Logger.Debugf("Generated %q", conditionName)

condition.createFieldIdentifier(
objectType.Name(), field,
)

fieldIs := jen.Qual(
badaasORMPath, badaasORMFieldIs,
).Types(
objectTypeQual,
condition.param.GenericType(),
)

fieldIsCreationValues := jen.Dict{
jen.Id("FieldID"): jen.Id(condition.modelType).Dot(field.CompleteName()),
}

if condition.param.isString {
fieldIsCreationValues = jen.Dict{
jen.Id("FieldIs"): fieldIs.Clone().Values(fieldIsCreationValues),
}
fieldIs = jen.Qual(
badaasORMPath, badaasORMStringFieldIs,
).Types(objectTypeQual)
} else if condition.param.isBool {
fieldIsCreationValues = jen.Dict{
jen.Id("FieldIs"): fieldIs.Clone().Values(fieldIsCreationValues),
}
fieldIs = jen.Qual(
badaasORMPath, badaasORMBoolFieldIs,
).Types(objectTypeQual)
}

condition.ConditionMethod = createMethod(condition.modelType, conditionName).Params().Add(
fieldIs,
).Block(
jen.Return(fieldIs.Clone().Values(fieldIsCreationValues)),
)
}

func createMethod(typeName, methodName string) *jen.Statement {
return jen.Func().Params(
jen.Id(typeName).Id(typeName),
Expand All @@ -227,34 +175,54 @@ func createMethod(typeName, methodName string) *jen.Statement {

// create a variable containing the definition of the field identifier
// to use it in the where condition and in the preload condition
func (condition *Condition) createFieldIdentifier(objectName string, field Field) {
fieldIdentifierValues := jen.Dict{
jen.Id("ModelType"): jen.Id(getObjectTypeName(objectName)),
jen.Id("Field"): jen.Lit(field.Name),
func (condition *Condition) createField(objectType Type, field Field) {
fieldValues := jen.Dict{
jen.Id("Name"): jen.Lit(field.Name),
}

columnName := field.getColumnName()

if columnName != "" {
fieldIdentifierValues[jen.Id("Column")] = jen.Lit(columnName)
fieldValues[jen.Id("Column")] = jen.Lit(columnName)
}

columnPrefix := field.ColumnPrefix
if columnPrefix != "" {
fieldIdentifierValues[jen.Id("ColumnPrefix")] = jen.Lit(columnPrefix)
fieldValues[jen.Id("ColumnPrefix")] = jen.Lit(columnPrefix)
}

condition.FieldType = jen.Id(condition.FieldName).Qual(
queryPath, badaasORMFieldIdentifier,
).Types(
condition.param.GenericType(),
objectTypeQual := jen.Qual(
getRelativePackagePath(condition.destPkg, objectType),
objectType.Name(),
)

condition.FieldDefinition = jen.Qual(
queryPath, badaasORMFieldIdentifier,
fieldQual := jen.Qual(
cqlPath, badaasORMField,
).Types(
objectTypeQual,
condition.param.GenericType(),
).Values(fieldIdentifierValues)
)
if condition.param.isString {
fieldValues = jen.Dict{
jen.Id("Field"): fieldQual.Clone().Values(fieldValues),
}
fieldQual = jen.Qual(
cqlPath, badaasORMStringField,
).Types(objectTypeQual)
} else if condition.param.isBool {
fieldValues = jen.Dict{
jen.Id("Field"): fieldQual.Clone().Values(fieldValues),
}
fieldQual = jen.Qual(
cqlPath, badaasORMBoolField,
).Types(objectTypeQual)
}

condition.FieldType = jen.Id(condition.FieldName).Add(
fieldQual,
)

condition.FieldDefinition = fieldQual.Clone().Values(fieldValues)
}

// Generate a JoinCondition between the object and field's object
Expand Down Expand Up @@ -296,13 +264,13 @@ func (condition *Condition) generateJoin(objectType Type, field Field, t1Field,
log.Logger.Debugf("Generated %q", conditionName)

ormT1IJoinCondition := jen.Qual(
conditionPath, badaasORMJoinCondition,
cqlPath, badaasORMJoinCondition,
).Types(t1)
ormT2Condition := jen.Qual(
conditionPath, badaasORMCondition,
cqlPath, badaasORMCondition,
).Types(t2)
ormJoinCondition := jen.Qual(
conditionPath, badaasORMNewJoinCondition,
cqlPath, badaasORMNewJoinCondition,
).Types(
t1, t2,
)
Expand Down Expand Up @@ -351,13 +319,13 @@ func (condition *Condition) generateCollectionPreload(objectType Type, field Fie
)

ormT1Condition := jen.Qual(
conditionPath, badaasORMCondition,
cqlPath, badaasORMCondition,
).Types(t1)
ormT2IJoinCondition := jen.Qual(
conditionPath, badaasORMJoinCondition,
cqlPath, badaasORMJoinCondition,
).Types(t2)
ormNewCollectionPreload := jen.Qual(
conditionPath, badaasORMNewCollectionPreload,
cqlPath, badaasORMNewCollectionPreload,
).Types(
t1, t2,
)
Expand Down
29 changes: 6 additions & 23 deletions cli/cmd/gen/conditions/conditionsGenerator.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ func (cg ConditionsGenerator) Into(file *File) error {
fieldIdentifiers := []jen.Code{}
relationPreloads := []jen.Code{}

addReflectTypeDefinition(file, objectName, objectQual)

conditionsModelType := getConditionsModelType(objectName)
conditionsModelAttributesDef := []jen.Code{}
conditionsModelAttributesIns := jen.Dict{}

for _, condition := range conditions {
file.Add(condition.ConditionMethod)
if condition.ConditionMethod != nil {
file.Add(condition.ConditionMethod)
}

// add all field names to the list of fields of the preload condition
if condition.FieldDefinition != nil {
Expand Down Expand Up @@ -84,7 +84,7 @@ func (cg ConditionsGenerator) Into(file *File) error {
func addPreloadRelationsMethod(file *File, objectName string, objectQual *jen.Statement, conditionsModelType string, relationPreloads []jen.Code) {
if len(relationPreloads) > 0 {
condition := jen.Index().Add(jen.Qual(
conditionPath, badaasORMCondition,
cqlPath, badaasORMCondition,
)).Types(
objectQual,
)
Expand All @@ -105,14 +105,14 @@ func addPreloadMethod(file *File, objectName string, objectQual *jen.Statement,
jen.Comment(fmt.Sprintf("Preload allows preloading the %s when doing a query", objectName)),
createMethod(conditionsModelType, preloadMethod).Params().Add(
jen.Qual(
conditionPath, badaasORMCondition,
cqlPath, badaasORMCondition,
).Types(
objectQual,
),
).Block(
jen.Return(
jen.Qual(
conditionPath, badaasORMNewPreloadCondition,
cqlPath, badaasORMNewPreloadCondition,
).Types(
objectQual,
).Call(fieldIdentifiers...),
Expand Down Expand Up @@ -143,27 +143,10 @@ func addConditionsModelDefinition(file *File, conditionsModelType string, condit
)
}

func addReflectTypeDefinition(file *File, objectName string, objectQual *jen.Statement) {
file.Add(
jen.Var().Id(
getObjectTypeName(objectName),
).Op("=").Add(
jen.Qual(
"reflect",
"TypeOf",
).Call(jen.Op("*").New(objectQual)),
),
)
}

func getConditionsModelType(objectName string) string {
return strcase.ToCamel(objectName) + "Conditions"
}

func getObjectTypeName(objectType string) string {
return strcase.ToCamel(objectType) + "Type"
}

// Generate the conditions for each of the object's fields
func (cg ConditionsGenerator) ForEachField(file *File, fields []Field) []Condition {
conditions := []Condition{}
Expand Down
4 changes: 2 additions & 2 deletions controllers/basicAuth.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"go.uber.org/zap"

"github.com/ditrit/badaas/httperrors"
badaasORMErrors "github.com/ditrit/badaas/orm/errors"
"github.com/ditrit/badaas/orm/cql"
"github.com/ditrit/badaas/persistence/models/dto"
"github.com/ditrit/badaas/services/sessionservice"
"github.com/ditrit/badaas/services/userservice"
Expand Down Expand Up @@ -65,7 +65,7 @@ func (basicAuthController *basicAuthenticationController) BasicLoginHandler(w ht

user, err := basicAuthController.userService.GetUser(loginJSONStruct)
if err != nil {
if errors.Is(err, badaasORMErrors.ErrObjectNotFound) {
if errors.Is(err, cql.ErrObjectNotFound) {
return nil, httperrors.NewErrorNotFound(
"user",
fmt.Sprintf("no user found with email %q", loginJSONStruct.Email),
Expand Down
4 changes: 0 additions & 4 deletions docs/badaas-orm/query.rst
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,4 @@ These operators can be found in <https://pkg.go.dev/github.com/ditrit/badaas/orm
<https://pkg.go.dev/github.com/ditrit/badaas/orm/sqlserver>,
<https://pkg.go.dev/github.com/ditrit/badaas/orm/psql>
and <https://pkg.go.dev/github.com/ditrit/badaas/orm/sqlite>.
<<<<<<< HEAD
To use them, use the Custom method of FieldIs type.
=======
To use them, use the Custom method of FieldIs type.
>>>>>>> main
12 changes: 11 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ require (
gorm.io/driver/postgres v1.5.2
gorm.io/driver/sqlite v1.5.2
gorm.io/driver/sqlserver v1.5.1
gorm.io/gorm v1.25.2-0.20230530020048-26663ab9bf55
gorm.io/gorm v1.25.2-0.20230610234218-206613868439
gotest.tools v2.2.0+incompatible
)

Expand Down Expand Up @@ -66,3 +66,13 @@ require (
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

// TODO agregar comentario de que los de los dialectors se pueden sacar cuando se mergeen los prs
// gorm por el contrario no porque el de los joins no se va a hacer pr porque es muy dificil hacer que ande en todos los casos
replace gorm.io/driver/postgres v1.5.2 => github.com/ditrit/postgres v0.0.0-20230906140800-b3d5f9d4b6ad

replace gorm.io/driver/sqlite v1.5.2 => github.com/ditrit/sqlite v0.0.0-20230906140046-2f37a3f972de

replace gorm.io/driver/sqlserver v1.5.1 => github.com/ditrit/sqlserver v0.0.0-20230908120642-af1820b994f4

replace gorm.io/gorm => github.com/ditrit/gorm v0.0.0-20230912092052-cfff75e01a3a
17 changes: 8 additions & 9 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@ github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46t
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/ditrit/gorm v0.0.0-20230907173046-bd1cee726740 h1:1pBsfGp4JYiw6PkYFV8h1Mf074Vvc9nc7mGx9zQ+lrk=
github.com/ditrit/gorm v0.0.0-20230907173046-bd1cee726740/go.mod h1:hbnx/Oo0ChWMn1BIhpy1oYozzpM15i4YPuHDmfYtwg8=
github.com/ditrit/postgres v0.0.0-20230906140800-b3d5f9d4b6ad h1:EMZ4BcMgh+yvTIZfFQh7A7LCmLVHmaCwUtavqLBWDlM=
github.com/ditrit/postgres v0.0.0-20230906140800-b3d5f9d4b6ad/go.mod h1:U1aH6CNEknanYTb+ViFuAA7SsPay4jBbaOpuwkyoh1k=
github.com/ditrit/sqlite v0.0.0-20230906140046-2f37a3f972de h1:s9G66wUSTOPtl3hSLOSWi6Y/THLwWXyJWk8XjhLDkDU=
github.com/ditrit/sqlite v0.0.0-20230906140046-2f37a3f972de/go.mod h1:qxAuCol+2r6PannQDpOP1FP6ag3mKi4esLnB/jHed+4=
github.com/ditrit/sqlserver v0.0.0-20230906142139-ffc300569d6d h1:BfOv/eDzJKsrcclEUdEF+bUg16EVnzMd8ahMrJcbYl8=
github.com/ditrit/sqlserver v0.0.0-20230906142139-ffc300569d6d/go.mod h1:nt+jwGhgDPKgeanqDCFeZHirOJhJsyK3ULeQUnJTuio=
github.com/ditrit/verdeter v0.4.0 h1:DzEOFauuXEGNQYP6OgYtHwEyb3w9riem99u0xE/l7+o=
github.com/ditrit/verdeter v0.4.0/go.mod h1:sKpWuOvYqNabLN4aNXqeBhcWpt7nf0frwqk0B5M6ax0=
github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko=
Expand Down Expand Up @@ -636,15 +644,6 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gorm.io/driver/mysql v1.5.1 h1:WUEH5VF9obL/lTtzjmML/5e6VfFR/788coz2uaVCAZw=
gorm.io/driver/mysql v1.5.1/go.mod h1:Jo3Xu7mMhCyj8dlrb3WoCaRd1FhsVh+yMXb1jUInf5o=
gorm.io/driver/postgres v1.5.2 h1:ytTDxxEv+MplXOfFe3Lzm7SjG09fcdb3Z/c056DTBx0=
gorm.io/driver/postgres v1.5.2/go.mod h1:fmpX0m2I1PKuR7mKZiEluwrP3hbs+ps7JIGMUBpCgl8=
gorm.io/driver/sqlite v1.5.2 h1:TpQ+/dqCY4uCigCFyrfnrJnrW9zjpelWVoEVNy5qJkc=
gorm.io/driver/sqlite v1.5.2/go.mod h1:qxAuCol+2r6PannQDpOP1FP6ag3mKi4esLnB/jHed+4=
gorm.io/driver/sqlserver v1.5.1 h1:wpyW/pR26U94uaujltiFGXY7fd2Jw5hC9PB1ZF/Y5s4=
gorm.io/driver/sqlserver v1.5.1/go.mod h1:AYHzzte2msKTmYBYsSIq8ZUsznLJwBdkB2wpI+kt0nM=
gorm.io/gorm v1.25.1/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k=
gorm.io/gorm v1.25.2-0.20230530020048-26663ab9bf55 h1:sC1Xj4TYrLqg1n3AN10w871An7wJM0gzgcm8jkIkECQ=
gorm.io/gorm v1.25.2-0.20230530020048-26663ab9bf55/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k=
gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo=
gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
Expand Down
Loading
Loading