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

Added an extension point for custom function providers #563

Merged
merged 30 commits into from Sep 24, 2021

Conversation

zachmu
Copy link
Member

@zachmu zachmu commented Sep 23, 2021

As part of this, embarked on a major refactor:

  • Extracted interfaces for sql.Catalog and sql.ProcessList
  • Moved existing sql.Catalog to analyzer package
  • Moved ProcessList and MemoryManager out of Catalog
  • Changed Analyzer and Engine to take a DatabaseProvider instead of a Catalog

Copy link
Contributor

@andy-wm-arthur andy-wm-arthur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
Now that we've extracted an interface for Catalog I wonder about having DatabaseProvider as a separate concept. Feels like we could combine these

driver/conn.go Outdated
@@ -23,17 +23,14 @@ import (

// Conn is a connection to a database.
type Conn struct {
options Options
options *Options
catalog *catalog
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

while you're here, type catalog on line 155 would benefit from having a new name

return func(ctx *sql.Context, e ...sql.Expression) (sql.Expression, error) {
return NewPad(ctx, pType, e...)
}
func NewLeftPad(ctx *sql.Context, e ...sql.Expression) (sql.Expression, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't break the internet Zach

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't ever tell me how to live my life

@zachmu
Copy link
Member Author

zachmu commented Sep 24, 2021

LGTM
Now that we've extracted an interface for Catalog I wonder about having DatabaseProvider as a separate concept. Feels like we could combine these

Yeah, I think we're moving in that direction.

If anything, the Catalog concept is a caching layer for the analyzer, not a public interface. Just didn't want to go quite that far in one push.

@zachmu zachmu merged commit 42614db into master Sep 24, 2021
@Hydrocharged Hydrocharged deleted the zachmu/catalog-refactor branch December 8, 2021 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants