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

Add the rest of backend sql packages #34

Merged
merged 2 commits into from
Nov 4, 2021
Merged

Conversation

andresmgot
Copy link
Contributor

Package for AWS SQL data sources that define common routes.

Epic at #28
Design doc
Closes #31

This PR implements, mainly, the AWSDatasource struct. The goal of this entity is to provide the methods to retrieve a database or an API instance, supporting multiple connections at the same time. The main concepts are:

  • Settings. This is the data source settings. It extends the basic AWS configuration (backend.DataSourceInstanceSettings) with settings specific to the data source.
  • API. An interface with the common methods to contact the data source API (implemented at Add pkg/sql/api package #29).
  • Driver. Abstraction on top the the upstream sql.Driver. Defined to handle multiple connections. It's main purpose is to return databases.
  • Database. Upstream sql.DB.

The key point here is that the data source using this library should only worry about defining methods to initialize settings, APIs, databases... and forget about how to handle multiple connections.

@andresmgot andresmgot requested review from sunker, a team and sarahzinger and removed request for a team November 3, 2021 12:57
Copy link
Member

@sarahzinger sarahzinger left a comment

Choose a reason for hiding this comment

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

This looks awesome to me!

"github.com/grafana/sqlds/v2"
)

// AWSDatasource stores a cache of:
Copy link
Member

Choose a reason for hiding this comment

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

love how well commented and well named this whole pr is! What would you think about a one sentence explanation for each of these terms, like "a driver is used xyz" just for folks new to these terms?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added more color to this comment.

@andresmgot andresmgot merged commit d9a6310 into main Nov 4, 2021
@fridgepoet fridgepoet deleted the pkg/sql/datasource branch January 25, 2023 11:12
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.

Common AWS SQL Datasource - Backend
2 participants