Skip to content
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

refactor(sql): Dispatch for sql. Move resolver source to scope #1729

Merged
merged 2 commits into from
Mar 30, 2021

Commits on Mar 30, 2021

  1. refactor(sql): Dispatch for sql. Move resolver source to scope

    Use the Dispatch pattern for sql methods.
    
    Instead of source being a parameter that is passed down the callstack, until code calls LoadDataset or ParseAndResolveRef, attach source to the scope. This will let us remove the source from the interface, since the callsite of LoadDataset doesn't care about source, the concrete implementation of the Loader does. Clients of lib can configure the source just-in-time by using WithSource on the Instance.
    
    Also, discovered that the --offline flag for sql was broken, so resolution would never be local-only. The cause was ParseResolveFunc always using the defaultResolver. This type of cleanup should make these sorts of bugs much harder to cause.
    
    Finally, remove the ResolverForMode function from scope. Only lib.Save was using it, but in actually it only needs a localResolver, so it uses that instead now.
    dustmop committed Mar 30, 2021
    Configuration menu
    Copy the full SHA
    7d92e0c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d049958 View commit details
    Browse the repository at this point in the history