-
Notifications
You must be signed in to change notification settings - Fork 24
chore: Refactor: write tests for the subject mapping db interface #87
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
Conversation
| return sq.StatementBuilder.PlaceholderFormat(sq.Dollar) | ||
| } | ||
|
|
||
| func tableName(table string) string { |
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.
we can probably get rid of these two package-level functions and rely on Table.Name and Table.Field if we want to keep those interfaces and the dynamic schema
| mapping := &subjectmapping.SubjectMappingCreateUpdate{ | ||
| AttributeValueId: attrValue.Id, | ||
| Operator: subjectmapping.SubjectMappingOperatorEnum_SUBJECT_MAPPING_OPERATOR_ENUM_IN, | ||
| SubjectAttribute: "subject_attribute--test", |
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.
is there a reason we don't want these other string values to come from fixtures as well?
| ## | ||
| # Attribute Values | ||
| ## | ||
| attribute_values: |
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.
Should every attribute definition have at least one value?
| # Namespaces | ||
| ## | ||
| namespaces: | ||
| metadata: |
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.
nit: maybe schema here?
internal/db/db_migration.go
Outdated
| applied int | ||
| ) | ||
|
|
||
| // create the schema |
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.
If the schema is now dynamic, does that make migrations down the road easier or harder? It seems like we could run into an edge case where we have made migration-worthy changes, a User sets config.RunMigrations to false, but we create the new schema anyway here because it's dynamic?
If we are doing this to support schema definitions specific to test suites for test isolation, maybe we could change how we read in a config and give the ability to overwrite aspects of it?
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 these statements should come after the if block below checking if migrations should run.
Closes #76