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

feat(sqlstore): add sqlstore package #6835

Merged
merged 14 commits into from
Jan 17, 2025
Merged

feat(sqlstore): add sqlstore package #6835

merged 14 commits into from
Jan 17, 2025

Conversation

grandwizard28
Copy link
Collaborator

@grandwizard28 grandwizard28 commented Jan 16, 2025

Summary

Add sqlstore package

Related Issues / PR's

Part of #6782


Important

Introduces sqlstore package with SQLite provider, implements factory pattern for configuration and provider management, and refactors instrumentation setup.

  • SQLStore Package:
    • Introduces sqlstore package with Config and SQLStore interface in sqlstore.go.
    • Implements SQLite provider in sqlitesqlstore/provider.go using sql.DB, bun.DB, and sqlx.DB.
    • Adds mock SQL store for testing in sqlstoretest/provider.go.
  • Factory Pattern:
    • Adds ConfigFactory and ProviderFactory interfaces in factory/config.go and factory/provider.go.
    • Implements NamedMap for managing named factories in factory/named.go.
    • Provides tests for factory components in factory/config_test.go, factory/named_test.go, and factory/provider_test.go.
  • Instrumentation:
    • Updates instrumentation package to use new factory pattern in config.go and sdk.go.
    • Provides noop implementations for testing in instrumentationtest/instrumentation.go.
  • Miscellaneous:
    • Removes instrumentation/logger.go, meter.go, and tracer.go as they are refactored into sdk.go.

This description was created by Ellipsis for c0bf5f5. It will automatically update as commits are pushed.

@github-actions github-actions bot added the enhancement New feature or request label Jan 16, 2025
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Reviewed everything up to f3f3157 in 1 minute and 21 seconds

More details
  • Looked at 1460 lines of code in 25 files
  • Skipped 0 files when reviewing.
  • Skipped posting 4 drafted comments based on config settings.
1. pkg/factory/servicetest/http.go:19
  • Draft comment:
    NewHttpService should be renamed to NewHTTPService to follow Go naming conventions for acronyms.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The NewHttpService function should follow Go naming conventions, which suggest using camel case for acronyms. Therefore, NewHttpService should be renamed to NewHTTPService. This change will improve code readability and maintain consistency with Go naming conventions.
2. pkg/factory/servicetest/http.go:26
  • Draft comment:
    Name method should return factory.MustNewName(service.name) to follow Go naming conventions for acronyms.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The NewHttpService function should follow Go naming conventions, which suggest using camel case for acronyms. Therefore, NewHttpService should be renamed to NewHTTPService. This change will improve code readability and maintain consistency with Go naming conventions.
3. pkg/factory/servicetest/http.go:13
  • Draft comment:
    httpService should be renamed to HTTPService to follow Go naming conventions for acronyms.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The NewHttpService function should follow Go naming conventions, which suggest using camel case for acronyms. Therefore, NewHttpService should be renamed to NewHTTPService. This change will improve code readability and maintain consistency with Go naming conventions.
4. pkg/factory/servicetest/http.go:1
  • Draft comment:
    Avoid using the component/index.tsx file structure approach, as it makes it difficult to debug and find components using global search tools like VS Code. This is applicable in pkg/factory/servicetest/http.go.
  • Reason this comment was not posted:
    Comment looked like it was already resolved.

Workflow ID: wflow_CzV5zkacbQ067KUY


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on 35ecd38 in 22 seconds

More details
  • Looked at 40 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. pkg/sqlstore/sqlstore.go:3
  • Draft comment:
    Remove the unused import of context to clean up the code.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The import of "context" is unnecessary since it's not used in the current code.
2. pkg/sqlstore/sqlstore.go:1
  • Draft comment:
    The code follows the specified rules correctly. No changes needed.
  • Reason this comment was not posted:
    Confidence changes required: 0%
    The code does not violate any of the specified rules. It defines an interface for SQLStore without any non-ClickHouse related functions.

Workflow ID: wflow_0LiPByMD5piuSoFL


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on c0bf5f5 in 19 seconds

More details
  • Looked at 58 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. pkg/sqlstore/config.go:43
  • Draft comment:
    The Validate function currently does not perform any validation. If this is intentional, consider adding a comment explaining why. Otherwise, implement necessary validation logic.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The Validate function is currently a no-op, which might be intentional, but it's worth noting that it doesn't perform any validation.

Workflow ID: wflow_oubdkaeqtWQ8KTBG


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@grandwizard28 grandwizard28 merged commit c574adc into main Jan 17, 2025
16 checks passed
@grandwizard28 grandwizard28 deleted the sqlstore branch January 17, 2025 10:24
amlannandy pushed a commit that referenced this pull request Jan 21, 2025
### Summary

Add `sqlstore` package
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants