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

Allow PHP object to act as query #84

Open
g105b opened this issue Mar 16, 2018 · 0 comments
Open

Allow PHP object to act as query #84

g105b opened this issue Mar 16, 2018 · 0 comments

Comments

@g105b
Copy link
Member

g105b commented Mar 16, 2018

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

@g105b g105b added this to the v3 milestone Mar 16, 2018
@g105b g105b modified the milestones: v3, v2 Apr 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant