The loadTableInfo function supports passing the context. #2297
loadTableInfo add context parameter
+++ func (engine *Engine) loadTableInfo(ctx context.Context, table *schemas.Table) error
--- func (engine *Engine) loadTableInfo(table *schemas.Table) error
After #2200, I built custom dialect to control the SQL. I find that everything else is fine, except when the
SYNC method executes with an exception.
The reason is that the
loadTableInfo method calls the
GetColumns methods with the dialect during execution. The context passed to these two methods are all
engine.defaultContext not the current session's context. So, I think the
loadTableInfo method should add the context parameter to ensure that the correct context is used during execution.
GetIndexesmethods are only used here, if the context here is incorrect, then the context parameter is invalid.
loadTableInfomethod is only used in
SYNCshould pass the session's context, while
DBMetashas no problem passing
All in all, I think this change should not affect other function.
No due date set.
No dependencies set.
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?