-
Notifications
You must be signed in to change notification settings - Fork 274
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
Fix issue where schema extraction is broken for remote services. Closes #1497 #1502
Conversation
schemas := connectionSchemaMap.UniqueSchemas() | ||
query := c.buildSchemasQuery(schemas) | ||
|
||
acquireSessionResult := c.AcquireSession(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.
why do we need to acquire session here, but the base implementation just calls
connection, err := c.dbClient.Conn(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.
This is because dbClient
is not a public property in the DbClient
struct
db/db_local/local_db_client.go
Outdated
} | ||
} | ||
|
||
func (c *LocalDbClient) buildSchemasQuery(hintSchemas []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.
what are hintSchemas?
just call it schemas
} | ||
} | ||
} | ||
|
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.
function comment to explain why this is different from the base version
db/db_local/local_db_client.go
Outdated
@@ -194,6 +196,8 @@ func (c *LocalDbClient) GetSchemaFromDB(ctx context.Context) (*schema.Metadata, | |||
return metadata, nil | |||
} | |||
|
|||
// update schemaMetadata to add in all other schemas which have the same schemas as those we have loaded | |||
// NOTE: this mutates schemaMetadata |
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.
feel free to remove the extra spaces from my suggested comment
db/db_local/local_db_client.go
Outdated
} | ||
} | ||
|
||
func (c *LocalDbClient) buildSchemasQuery(exemplarSchemas []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.
just schemas
will be fine
No description provided.