Open VladaHejda opened 8 years ago
Can you try to fix it?
Yeasterday, I tried fix it.
1) table()->select()
is easy fix.
2) Do you want it?
I expect api must support table()->insert()
, table()->update()
and table()->delete()
this is little more complex, because class Connection has logic how works with arguments. This update change api update('table', $data)
vs ->table('table')->update($data)
etc.
It would be nice, if I can start query with
FROM
part and then define columns to select.When I call
$dibi->command()->from('foo')->select('bar')
Dibi will produce queryFROM foo SELECT bar
which is obviously syntax error. If there is a requirement to know the type of query before call offrom()
, it would work like$dibi->select()->from('foo')->select('bar')
with no column definition at firstselect()
call (but now it reproduces querySELECT , bar FROM foo
- again error).This change let make more comfortable APIs in some cases.
(the only way to do this now is to call something like
$dibi->select('*')->removeClause('SELECT')
)