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 support sqlite #17

Merged
merged 4 commits into from
Oct 27, 2023
Merged

Add support sqlite #17

merged 4 commits into from
Oct 27, 2023

Conversation

prog-supdex
Copy link
Contributor

@prog-supdex prog-supdex commented Oct 19, 2023

What is the purpose of this pull request?

Added SQLite support

Is there anything you'd like reviewers to focus on?

SQLite supports all needed functions (ON CONFLICT, RETURNING), so we can use the same PgUpsertAdapter code.
I added to the method apply? checking SQLite db, too

Checklist

  • [ -] I've added tests for this change
  • [+] I've added a Changelog entry
  • [+] I've updated a documentation

@prog-supdex prog-supdex marked this pull request as draft October 20, 2023 17:53
@prog-supdex prog-supdex changed the title Add running CI with sqlite adapter Add support sqlite Oct 23, 2023
@prog-supdex prog-supdex marked this pull request as ready for review October 23, 2023 09:48
@@ -2,15 +2,19 @@

module ActiveRecordSlottedCounters
module Adapters
class PgUpsert
class PgSqliteUpsert
Copy link
Member

Choose a reason for hiding this comment

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

The adapter pattern means separating implementations, not mixing them up. Please, fix this. There should not be any changes to the existing PgUpsert class.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah
I just thought that SQLite adapter has the same functionality, and maybe the apply? method could resolve it

but I got it, fixed it
and in that case, the duplication is not bad, because we have two different implementations

thanks

@@ -3,7 +3,7 @@
module ActiveRecordSlottedCounters
module Adapters
class RailsUpsert
attr_reader :klass
attr_reader :klass, :current_adapter_name
Copy link
Member

Choose a reason for hiding this comment

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

Where do we use current_adapter_name?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, sorry, It was leaked from another branch
fixed

Copy link
Member

@palkan palkan left a comment

Choose a reason for hiding this comment

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

👍

@palkan palkan merged commit ed7ac52 into evilmartians:master Oct 27, 2023
7 checks passed
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.

2 participants