-
-
Notifications
You must be signed in to change notification settings - Fork 3
Allow PHP object to act as query #84
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
Labels
Milestone
Comments
|
g105b
added a commit
that referenced
this issue
May 8, 2025
g105b
added a commit
that referenced
this issue
May 11, 2025
g105b
added a commit
that referenced
this issue
May 19, 2025
* ci: upgrade workflow * feature: split query collection into directory/class subclasses for #84 * wip: break Query into SqlQuery and PhpQuery * feature: php object query for #84 * build: php 8.1 compatibility * tweak: remove non-existant test * tweak: import DateTimeInterface * tweak: remove superfluous typehint * tweak: ignore complexity of abstract query class
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A typical user table will have the following queries:
src/query/user/create.sql
src/query/user/delete.sql
src/query/user/getById.sql
src/query/user/update.sql
Allowing the ResultSet to be build programatically would replace the above files with one file:
src/query/User.php
Which would contain the following methods:
User::create
User::delete
User::getById
User::update
If there is a class and method present, use that. If not, fall back to SQL. This allows PHP to produce some
ResultSet
s that are not easy to produce in SQL, and allows the developer to skip using SQL at all.This will make it really easy to get a prototype going, without the need of a database. A mechanism needs to be created that defines where the data is stored. By default, this can simply be in the data directory, as files/directories in the filesystem. Really simple way to make a prototype, and uses a set template for upgrading when speed and scalability is required.
The text was updated successfully, but these errors were encountered: