Open fengqi opened 2 years ago
I added the driver name to PdoRepository:
for this merge request:
(...but that author disappeared)
anyway, now driver-specific code is now possible.
this must be enabled in config:
"enable_json" => true // (or something similar)
as even if your db server supports json, you may still may have old schema in place
also, depending on how invasive the changes are, maybe need another PdoRepository
, like PdoJsonRepository
...
Also, when you start working on it, try to make atomic commits:
makes much easier to rebase, do codereview and apply fixes
(should put this to CONTRIBUTING.md)
also, depending on how invasive the changes are, maybe need another
PdoRepository
, likePdoJsonRepository
...
Yes, our internal current implementation is for mysql, there is a file PdoMySQLRepository
that overrite the buildWhere
and initSchema
method
Also, when you start working on it, try to make atomic commits:
- https://www.freshconsulting.com/insights/blog/atomic-commits/
- https://en.wikipedia.org/wiki/Atomic_commit#Atomic_commit_convention
makes much easier to rebase, do codereview and apply fixes
(should put this to CONTRIBUTING.md)
ok
also, depending on how invasive the changes are, maybe need another
PdoRepository
, likePdoJsonRepository
...Yes, our internal current implementation is for mysql, there is a file
PdoMySQLRepository
that overrite thebuildWhere
andinitSchema
method
I prefer composition over inheritance, but anyway, perhaps you submit your code and then I can then refactor to composition and provide fallback to other drivers.
also, depending on how invasive the changes are, maybe need another
PdoRepository
, likePdoJsonRepository
...Yes, our internal current implementation is for mysql, there is a file
PdoMySQLRepository
that overrite thebuildWhere
andinitSchema
methodI prefer composition over inheritance, but anyway, perhaps you submit your code and then I can then refactor to composition and provide fallback to other drivers.
you mean like trait
you mean like trait
no. but don't bother if you don't understand, I'll take the refactoring on me.
you mean like trait
no. but don't bother if you don't understand, I'll take the refactoring on me.
ok
@fengqi seems you have not pushed your code yet
@glensc sry, our focus is on migrating to the GoLang project recently, so i haven’t had time yet. maybe i can temporarily close this issue and open it again later.
@fengqi but i only asked you push your code to some pull request, and can continue from there.
@fengqi but i only asked you push your code to some pull request, and can continue from there.
ok
@fengqi just push the changes and share the branch.
I want to provide special support based on the drive name, for example, add
json_support
switch in the PDO configdifferent db JSON syntax will be different, sql may also need to write multiple
known and commonly used mysql >=5.7, postgresql >=9.2, sql server >=2016