-
Notifications
You must be signed in to change notification settings - Fork 0
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
updated initialization process #4
base: develop
Are you sure you want to change the base?
Conversation
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.
Add apache license header
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.
Added License header
} | ||
|
||
// Extract attributes from the table | ||
attributes := make(map[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.
Do we need to scan entire table? Should this be simply output.Table.AttributeDefinitions
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.
AttributeDefinitions does not specify the roles of these attributes (i.e., whether they are HASH or RANGE keys), it only contains the attribute names and their data types.
https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_TableDescription.html#DDB-Type-TableDescription-KeySchema
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 should add a config to limit number of rows being scanned here to infer attributes. This code without limit may scan whole table which may be very expensive in case of large databases.
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.
added dynamo_query_limit
config-files/init.go
Outdated
} | ||
|
||
func createTable(ctx context.Context, db, ddl string) error { | ||
adminClient, err := Admindatabase.NewDatabaseAdminClient(ctx) |
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.
Create adminClient once and reuse in createDatabase and createTables
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.
updated
api/v1/db.go
Outdated
@@ -59,7 +59,7 @@ func RouteRequest(c *gin.Context) { | |||
case "UpdateItem": | |||
Update(c) | |||
default: | |||
c.JSON(errors.New("ValidationException", "Invalid X-Amz-Target header value of" + amzTarget). | |||
c.JSON(errors.New("ValidationException", "Invalid X-Amz-Target header value of"+amzTarget). |
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.
space around + as well as after of
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.
It seems that spaces around + are being removed automatically when the code is saved due to linter. Added space after of.
} | ||
|
||
// Extract attributes from the table | ||
attributes := make(map[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 should add a config to limit number of rows being scanned here to infer attributes. This code without limit may scan whole table which may be very expensive in case of large databases.
@TanmayVartak All comments are resolve. please provide your approval to merge. |
Quality Gate failedFailed conditions |
Fixes #<issue_number_goes_here>