Skip to content

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

@marktopper

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions