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

About PDO JSON support #439

Open
fengqi opened this issue Nov 11, 2021 · 14 comments
Open

About PDO JSON support #439

fengqi opened this issue Nov 11, 2021 · 14 comments

Comments

@fengqi
Copy link
Contributor

fengqi commented Nov 11, 2021

I want to provide special support based on the drive name, for example, add json_support switch in the PDO config

different 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

@glensc
Copy link
Contributor

glensc commented Nov 11, 2021

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

@glensc
Copy link
Contributor

glensc commented Nov 11, 2021

also, depending on how invasive the changes are, maybe need another PdoRepository, like PdoJsonRepository...

@glensc
Copy link
Contributor

glensc commented Nov 11, 2021

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)

@fengqi
Copy link
Contributor Author

fengqi commented Nov 11, 2021

also, depending on how invasive the changes are, maybe need another PdoRepository, like PdoJsonRepository...

Yes, our internal current implementation is for mysql, there is a file PdoMySQLRepository that overrite the buildWhere and initSchema method

@fengqi
Copy link
Contributor Author

fengqi commented Nov 11, 2021

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)

ok

@glensc
Copy link
Contributor

glensc commented Nov 11, 2021

also, depending on how invasive the changes are, maybe need another PdoRepository, like PdoJsonRepository...

Yes, our internal current implementation is for mysql, there is a file PdoMySQLRepository that overrite the buildWhere and initSchema 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.

@fengqi
Copy link
Contributor Author

fengqi commented Nov 11, 2021

also, depending on how invasive the changes are, maybe need another PdoRepository, like PdoJsonRepository...

Yes, our internal current implementation is for mysql, there is a file PdoMySQLRepository that overrite the buildWhere and initSchema 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.

you mean like trait

@glensc
Copy link
Contributor

glensc commented Nov 11, 2021

you mean like trait

no. but don't bother if you don't understand, I'll take the refactoring on me.

@fengqi
Copy link
Contributor Author

fengqi commented Nov 11, 2021

you mean like trait

no. but don't bother if you don't understand, I'll take the refactoring on me.

ok

@glensc
Copy link
Contributor

glensc commented Dec 20, 2021

@fengqi seems you have not pushed your code yet

@fengqi
Copy link
Contributor Author

fengqi commented Dec 20, 2021

@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.

@glensc
Copy link
Contributor

glensc commented Dec 20, 2021

@fengqi but i only asked you push your code to some pull request, and can continue from there.

@fengqi
Copy link
Contributor Author

fengqi commented Dec 21, 2021

@fengqi but i only asked you push your code to some pull request, and can continue from there.

ok

@glensc
Copy link
Contributor

glensc commented Jan 16, 2022

@fengqi just push the changes and share the branch.

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

No branches or pull requests

2 participants