Closed josejuanmontiel closed 1 year ago
Hi @josejuanmontiel. Thanks for the inline comments on the PR, but could you please explain here in a few bullet points, what exactly is changing, why, and how it helps. The overall architecture.
Hi!
What exactly is changing? There is an interface for the backends (before now, only one) the change consider this backend as parent backend to others, that only need to override the methods they change for new functionaly of this "driver"...
why? Splitting the new functionality to connect new database in different backend, organize the code better to future loading dinamically.
and how it helps? It could lead to remove the "if postgres" in some places ... if split the sql backend in two .. for mysql and postgres.
The overall architecture. To reuse the code in other backend need a few minor changes
As bonus, need some extra configuration too... i include the comented option to run the jobber_test.go with testcontainer.
TODO:
Thanks for the update. Will try to review this some time soon.
The idea... include new driver reusing actual code... for later dinamically load by configuration.
With the two (three) actual driver ... use ifs inside actual backend... because new one of new drivers change the code more drastically, decide to implements new backend.
And to reuse actual code in backend that don't change... in this backend include the "parent" of sql backend (the actual one) and only reimplement those methods that didn't change.
The trick its done here
type csvqDBWriter struct { sqlDBWriter }
reusing the actual implementation ... and only change the method ... that realy change...