Skip to content

Allow PHP object to act as query #84

@g105b

Description

@g105b

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions