# |
Oct 12th 2017, 16:42 |
hmic |
why does the from need to be a tmp table? |
# |
Oct 12th 2017, 16:41 |
rrd564 |
no space between the _ and * just slack make the text bold... |
# |
Oct 12th 2017, 16:40 |
rrd564 |
yes, but than I get SELECT table.* AS table__* |
# |
Oct 12th 2017, 16:38 |
hmic |
you can select * |
# |
Oct 12th 2017, 16:38 |
rrd564 |
A temporary table |
# |
Oct 12th 2017, 16:37 |
rrd564 |
well i that case I would get an SQL like SELECT x,y,z FROM table, but what I need is not that but this: https://gist.github.com/rrd108/1c0f2688e5e867b5c388a2f723fe23ac |
# |
Oct 12th 2017, 16:33 |
hmic |
$this->find() on a table gives you a ORM\Query instance back |
# |
Oct 12th 2017, 16:32 |
hmic |
you use it from a table anyways, do you? |
# |
Oct 12th 2017, 16:32 |
hmic |
so? |
# |
Oct 12th 2017, 16:32 |
rrd564 |
I have started with that but the constructor of ORM\Query requires a table as the second argument |
# |
Oct 12th 2017, 16:31 |
hmic |
alecilla: you should stop useing action and use url instead, as action will stop working in the next release |
# |
Oct 12th 2017, 16:31 |
dereuromark |
use the documented "url" key. |
# |
Oct 12th 2017, 16:31 |
dereuromark |
exactly what it says. |
# |
Oct 12th 2017, 16:31 |
alecilla |
what mean Deprecated (16384): Using key `action` is deprecated, use `url` directly instead. [CORE/Cake/View/Helper/FormHelper.php, line 383] |
# |
Oct 12th 2017, 16:31 |
hmic |
so just start with a ORM\Query instead of a Database\Query and you should be fine |
# |
Oct 12th 2017, 16:30 |
hmic |
so you need to express your query with what ORM\Query gives you. It is a subclas of Database\Query, so you should be able to use the interface too |
# |
Oct 12th 2017, 16:30 |
rrd564 |
I want to use ORM/Query, just was not able to figure out how to build the same query with it |
# |
Oct 12th 2017, 16:29 |
hmic |
so you want to use Database\Query but use the ORM\Query interface? - thats not going to happen. the other way round is not problem though |
# |
Oct 12th 2017, 16:23 |
rrd564 |
and I guess I can not chain it |
# |
Oct 12th 2017, 16:23 |
rrd564 |
So for example I can not call ->first(), ->toArray() on the return value |
# |
Oct 12th 2017, 16:22 |
rrd564 |
I get the SQL what I want but I use the Database/Query builder not the ORM/Query |
# |
Oct 12th 2017, 16:22 |
alecilla |
ok |
# |
Oct 12th 2017, 16:22 |
hmic |
still not available outside slack |
# |
Oct 12th 2017, 16:21 |
alecilla |
no code |
# |
Oct 12th 2017, 16:21 |
alecilla |
its a image |
# |
Oct 12th 2017, 16:21 |
rrd564 |
still this is just a half of a union |
# |
Oct 12th 2017, 16:21 |
hmic |
!tell alecilla about gist |
# |
Oct 12th 2017, 16:21 |
rrd564 |
It took me time to cut out non relevant part |
# |
Oct 12th 2017, 16:21 |
alecilla |
File uploaded https://cakesf.slack.com/files/U70LAN9EE/F7JFCUGBH/selecci__n_001.png / https://slack-files.com/T053DPNCM-F7JFCUGBH-7a0f0e087f |
# |
Oct 12th 2017, 16:21 |
hmic |
at what part are you struggling |
# |
Oct 12th 2017, 16:20 |
rrd564 |
and this is my finder so far : https://gist.github.com/rrd108/2aedefdaf28bef2919321f8e36f98e68 |
# |
Oct 12th 2017, 16:20 |
hmic |
but you could have just continued. just wanted to say that i would be away. does not mean everybody is gone :p |
# |
Oct 12th 2017, 16:20 |
rrd564 |
this is the SQL part what I want to achieve: https://gist.github.com/rrd108/1c0f2688e5e867b5c388a2f723fe23ac |
# |
Oct 12th 2017, 16:20 |
hmic |
yes |
# |
Oct 12th 2017, 16:19 |
rrd564 |
@hmic are you back? |
# |
Oct 12th 2017, 16:13 |
inoas |
yeah I wish there was a way to inject abitrary SQL in before SELECT (for CTEs https://mariadb.com/kb/en/library/with/ ) |
# |
Oct 12th 2017, 16:13 |
happy |
->newExpr() may do it though, I'll report back! |
# |
Oct 12th 2017, 16:11 |
happy |
Thanks, @mail. epilogue wont work because it only appends raw text at the end of the query, but the IGNORE/USE statement must go before the WHERE statement |
# |
Oct 12th 2017, 16:09 |
happy |
Only official mention to use/ignore index was a few years ago, a closed github request due to lack of interest |
# |
Oct 12th 2017, 16:09 |
inoas |
(no, but maybe epilogue() helps) |
# |
Oct 12th 2017, 16:07 |
happy |
Anyone had any luck using IGNORE INDEX when selecting data from mysql in cake 3? |