-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add deleteExisting metadata tag #48
Conversation
testing.go
Outdated
@@ -70,6 +77,22 @@ func (eh ExpectationHelper) getUpdateDBColumns() []string { | |||
return tableMetadata.getColumnNamesForUpdate() | |||
} | |||
|
|||
/*func (eh ExpectationHelper) getDeletePrimaryKeyValue(object reflect.Value) interface{} { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need this?
picard.go
Outdated
|
||
// already exists in updates so delete the existing update that | ||
// matches the delete | ||
newUpdates := updates[:0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I understand why this last section is necessary. Let's talk about it when you're at the office.
picard.go
Outdated
if multitenancyKeyColumnName != "" { | ||
query = query.Where(fmt.Sprintf("%v.%v = $2", tableName, multitenancyKeyColumnName), p.multitenancyValue) | ||
arg := "$1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I may know of a way that we can avoid doing this. I'll see if I can get it to work.
@@ -28,6 +29,41 @@ func (p PersistenceORM) FilterModel(filterModel interface{}) ([]interface{}, err | |||
return p.FilterModelAssociations(filterModel, nil) | |||
} | |||
|
|||
// FilterModels returns models that match the provided struct, multiple models can be provided | |||
func (p PersistenceORM) FilterModels(filterModels interface{}, transaction *sql.Tx) ([]interface{}, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This basically lets you send multiple models into a "FilterModel" call, and will put their where clauses in parenthesis separated by ORs.
@@ -5,7 +5,6 @@ workspace: | |||
pipeline: | |||
test: | |||
image: golang:1.9-alpine | |||
pull: true | |||
environment: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this was helping any.
No description provided.