Skip to content

[v1.0] Database should support raw statements for multiple methods #7

Open

Description

@marktopper

The Database component should support raw statements for multiple methods, example the where-method.

We use the where-method like this:

$db->table('table')->where('column', 'operator', 'value')->get();

However it needs support for adding raw statements like this:

$db->table('table')->whereRaw("strftime('%Y', `created_at`) = ?", ['2016'])->get();
$db->table('table')->where($db->raw("(SELECT count(id) FROM user_groups WHERE users.id = user_groups.user_id"), '>', 1)->get();

That is my idea on how this should work.

The functions that might require usage of raw statements:

  • where
  • select
  • orderBy
  • groupBy
  • join

Activity

  1. added this to the v1.0 milestone on Oct 3, 2016
  2. self-assigned this
    on Feb 13, 2017
  3. changed the title [-][master] Database should support raw statements for multiple methods[/-] [+][v1.0] Database should support raw statements for multiple methods[/+] on Feb 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions