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

V2 Road Map #27

Closed
9 of 11 tasks
FaaPz opened this issue Feb 12, 2016 · 13 comments
Closed
9 of 11 tasks

V2 Road Map #27

FaaPz opened this issue Feb 12, 2016 · 13 comments
Assignees
Milestone

Comments

@FaaPz
Copy link
Owner

FaaPz commented Feb 12, 2016

V2 Road Map

  • Interfaces for all classes
  • No more private variables and functions, only protected
  • Correct use of getters & setters
  • Support for strings ('one, two'), arrays ([$one, $two]) and ... parameters
  • Nested queries
  • Field aliases AS in SELECT clauses
  • ON DUPLICATE KEY UPDATE (ON DUPLICATE KEY UPDATE #32)
  • Detect database driver (could be useful for e.g. Limit clause with sql server #29)
  • Required PHP version to 7.2
  • Rename on Packagist
  • Unit Tests

If anyone has any suggestions, let me know! 🙏

@FaaPz FaaPz self-assigned this Feb 12, 2016
@FaaPz FaaPz added this to the v2.0.0 milestone Feb 12, 2016
@FaaPz FaaPz changed the title V2 Roadmap V2 Road Map Feb 12, 2016
@kwhat
Copy link
Collaborator

kwhat commented Feb 12, 2016

Add a way to do WHERE X = 1 OR (Y = 2 AND Z = 3).

Also should think about things like nested queries.

I have some ideas about how to accomplish these, but I am probably not going to have time to look at them for another week or so.

@gromez
Copy link

gromez commented Feb 13, 2016

Maybe a way to do field aliases AS in a SELECT clause.
Useful when you join tables with same field names.

@Satwa
Copy link

Satwa commented Feb 13, 2016

@kwhat Well, I don't know what you want to do exactly, but what I understand from your question is possible by doing:

$array = $pdo->select()
                 ->from('friends')
                 ->where('friend_one', '=', $args['id'])
                 ->orWhere('friend_two', '=', $args['id'])
                 ->where('status', '=', 1)
                 ->orWhere('status', '=', 0)
                 ->execute()
                 ->fetchAll();

@gromez +1, I had the same problem not a long time ago, it would be really interesting!

@kwhat
Copy link
Collaborator

kwhat commented Feb 13, 2016

@gromez I believe there is a way to do that, but I would like to make it a little more intuitive. I need to relay more heavily on that that functionality for MsSQL.

@bubach
Copy link

bubach commented Feb 17, 2016

A way to accomplish this would be nice, "SELECT abc, def, MAX(ghj) FROM...", I tried this

->select(array('abc','def')) ->from('table') ->max('gjh')

But due to the $aggregate variable being set, it will trim of everything except the MAX(ghj). Maybe I'm missing something and it's possible?

@FaaPz
Copy link
Owner Author

FaaPz commented Feb 27, 2016

@bubach In v1.9.6 (5f766ca) I've fixed it. The $aggregate variable won't do anything (for) now. 😁

@jordikroon
Copy link

@FaaPz Will you rewrite the whole thing or patch v.1? And how about BC?
I think that it's also a good idea to bump the required PHP version to 5.5 or 5.6. Then we can use the newer array syntax.

@FaaPz
Copy link
Owner Author

FaaPz commented Mar 8, 2016

@jordi12100 V2 will be a whole rewrite, so it's easier extendable for all kinds of projects with different RDBMSs. There will be BC for fixes, not for (new) features. And yes, I'm thinking about using PHP 5.6. What do you prefer/recommend?

@Raistlfiren
Copy link

It would be nice if this library also included tests. :)

@EdwinHuijsing
Copy link

I wanted to use pdo, but there is only one thing missing that i really needed. The ability to work with stored procedures.
For now i have forked this repo and added stored produces. Its not completely ready but for me it works (should work for others).
Not yet tested by others.

Let me know if you are interested and what you think needs to be done.

@kwhat
Copy link
Collaborator

kwhat commented Sep 20, 2019

@EdwinHuijsing Stored procedures are fully supported in 2.x right now :)

@kwhat kwhat self-assigned this Sep 20, 2019
@FaaPz FaaPz pinned this issue Sep 24, 2019
@kwhat
Copy link
Collaborator

kwhat commented Dec 5, 2019

Hello Everyone,

I have tagged the 2.0 release. I am pleased with the number of issues addressed and goals met for this release. A couple of items didn't quite make it and should be pushed to a future 2.x release.

ON DUPLICATE KEY UPDATE (#32)

I still haven't come up with a way to handle this but I am shooting for 2.1 along with support for multiple insert statements.

Detect database driver (could be useful for e.g. #29)

This was a good idea, however, things fall apart as soon as you introduce ODBC. This could still be possible with a factory, but I think the better answer maybe to add extension projects that support the required database. For example, something to the effect of FaaPz/PDO-Postgres and FaaPz/PDO-Microsoft. Those requiring compatibility would add these package(s) and construct it's PDO object.

None of these decisions are final, ideas and comments are welcome. I will come back and update this ticket with new tickets to address the above features and then close this issue.

@kwhat
Copy link
Collaborator

kwhat commented Dec 18, 2019

Version 2.1 will address the remaining issues and a new branch has already been created.

For #29, I have created https://github.com/kwhat/PDO-SqlSrv as an experimental extension library. If everything works out, I will create another one for Postgres and any other databases we would like to support. @FaaPz I will be gifting this repo to you.

@kwhat kwhat closed this as completed Dec 18, 2019
@kwhat kwhat unpinned this issue Dec 18, 2019
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

8 participants