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

AQL: add dbal sql processor #14

Merged
merged 1 commit into from
Apr 1, 2020
Merged

Conversation

alekitto
Copy link
Member

Add "raw" SQL processor based on doctrine DBAL query builder.
It is meant to be used if low-level data retrieval is needed (query a view, use of a custom db extension) or where an ORM should/could not be used.

Comparing to ORM and ODM ones, it has some few limitations:

  • There is no auto-mapping of fields, all the selected fields need to be selected with select method on query builder prior to the initialization of the Processor
  • $entry support is limited. Due to the lack of a schema, there's no support to an automatic join mechanism
  • To fully support pagination (with continuation token), the SQL built via query builder will be wrapped as a subquery in the FROM clause
  • Result iterator emits associative arrays instead of objects
  • Results are emitted as emitted from PDO. No conversion will be made on the returned result.

Copy link
Member

@massimilianobraglia massimilianobraglia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there @alekitto! Thanks for this great feature!
Just left some comments on it!

Sorry about the late reply 😓

src/Pagination/Doctrine/Dbal/PagerIterator.php Outdated Show resolved Hide resolved
src/Pagination/Doctrine/Dbal/PagerIterator.php Outdated Show resolved Hide resolved
src/Pagination/Doctrine/Dbal/PagerIterator.php Outdated Show resolved Hide resolved
src/QueryLanguage/Processor/Doctrine/Dbal/Column.php Outdated Show resolved Hide resolved
src/QueryLanguage/Processor/Doctrine/Dbal/Column.php Outdated Show resolved Hide resolved
src/QueryLanguage/Walker/Dbal/SqlWalker.php Outdated Show resolved Hide resolved
tests/Pagination/Doctrine/Dbal/PagerIteratorTest.php Outdated Show resolved Hide resolved
tests/QueryLanguage/Walker/SqlWalkerTest.php Outdated Show resolved Hide resolved
tests/QueryLanguage/Walker/SqlWalkerTest.php Outdated Show resolved Hide resolved
@alekitto
Copy link
Member Author

alekitto commented Apr 1, 2020

I've converted the Dbal namespaces to uppercase and left replies to the other comments.

@alekitto
Copy link
Member Author

alekitto commented Apr 1, 2020

👍 All done

@massimilianobraglia massimilianobraglia merged commit 8258ce1 into fazland:master Apr 1, 2020
@massimilianobraglia
Copy link
Member

Thank you, @alekitto!

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

Successfully merging this pull request may close these issues.

2 participants