-
Notifications
You must be signed in to change notification settings - Fork 7
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
Conversation
5b2b036
to
39588a0
Compare
39588a0
to
1bfd302
Compare
1898270
to
9bfeeba
Compare
@@ -2,15 +2,19 @@ | |||
|
|||
module ActiveRecordSlottedCounters | |||
module Adapters | |||
class PgUpsert | |||
class PgSqliteUpsert |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
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, tooChecklist