# |
Sep 4th 2019, 19:36 |
rightscoreanalysis |
is anyone familiar with TinyAuth |
# |
Sep 4th 2019, 17:45 |
ricksaccous |
actually you wouldn't need to define the schema since cake can use cake magic to know the schema |
# |
Sep 4th 2019, 17:44 |
ricksaccous |
maybe write a behavior/class that you can feed the table name, where it defines the schema and that you can also feed the connection name to, maybe that would work? |
# |
Sep 4th 2019, 17:43 |
itmpls |
(I think . mark storys sharding articlel isn't exactly what I'm looking for) |
# |
Sep 4th 2019, 17:42 |
itmpls |
has anyone have experience with writing an abstraction . layer to pull data from multiple databases based on the table name? the schema is the same, think of it as pulling . from shards |
# |
Sep 4th 2019, 17:39 |
neon1024 |
It’s one of those things where I think I know, but when I consider it I’m unsure of myself ;) |
# |
Sep 4th 2019, 17:38 |
neon1024 |
I guess an example might be searching for a person, you may union Customers and Users |
# |
Sep 4th 2019, 17:38 |
neon1024 |
At least, that’s my understanding! |
# |
Sep 4th 2019, 17:37 |
ricksaccous |
i seee |
# |
Sep 4th 2019, 17:37 |
neon1024 |
That would work if there is an association, often a union might not contain data from associated tables. Such as in a global search, but for that usually you’d use something like Elasticsearch |
# |
Sep 4th 2019, 17:36 |
ricksaccous |
on whatever you need to be unique |
# |
Sep 4th 2019, 17:36 |
ricksaccous |
you could just do innerjoinwith can't you and then use the proper distinct/groupBy |
# |
Sep 4th 2019, 17:36 |
neon1024 |
I’ve never found a need to use it, ever, which is why I was curious that @lilhermit would want to use it |
# |
Sep 4th 2019, 17:36 |
ricksaccous |
oh |
# |
Sep 4th 2019, 17:35 |
neon1024 |
Rather like a cross join would |
# |
Sep 4th 2019, 17:35 |
neon1024 |
@ricksaccous Union will join the results of two queries into a single resultset |
# |
Sep 4th 2019, 17:13 |
ricksaccous |
why don't you just innerjoinwith and distinct, what does union even do, man i'm so bad at sql |
# |
Sep 4th 2019, 16:39 |
jotpe |
@alexdd55976 I don't know if this helps you, but for my purpose it is working : https://gist.github.com/julianpollmann/bd2dc4c8092d3d416f5a7bdc8ea68342 |
# |
Sep 4th 2019, 16:20 |
lilhermit |
I need to wrap that `$query` but for the life of me I can't get it to work |
# |
Sep 4th 2019, 16:20 |
lilhermit |
https://pastebin.com/4SNWVG8V |
# |
Sep 4th 2019, 16:16 |
lilhermit |
lol |
# |
Sep 4th 2019, 16:12 |
neon1024 |
I certainly wouldn’t have appreciated a large flood of code in a PM |
# |
Sep 4th 2019, 16:12 |
neon1024 |
You could share your code using a Gist or Pastebin and share the link |
# |
Sep 4th 2019, 16:11 |
lilhermit |
I didn't want to flood the channel with my complex explanation and code. Was going to post my solution after |
# |
Sep 4th 2019, 16:09 |
neon1024 |
Limiting your support to one person when you have 3,235 other people who might help you seems unwise |
# |
Sep 4th 2019, 16:09 |
neon1024 |
:man-shrugging: |
# |
Sep 4th 2019, 16:07 |
lilhermit |
@neon1024 I've dm'ed you |
# |
Sep 4th 2019, 16:04 |
neon1024 |
Or make a branch in Git or similar to save time reverting |
# |
Sep 4th 2019, 16:04 |
neon1024 |
Well perhaps just write a new method in the controller and see what it looks like |
# |
Sep 4th 2019, 16:03 |
slackebot |
Action: lilhermit tries to adapt |
# |
Sep 4th 2019, 15:55 |
neon1024 |
Does this kind of thing not work then? |
# |
Sep 4th 2019, 15:55 |
slackebot |
<neon1024> |
# |
Sep 4th 2019, 15:53 |
lilhermit |
OK I'll take a look |
# |
Sep 4th 2019, 15:53 |
neon1024 |
https://book.cakephp.org/3.0/en/orm/query-builder.html#unions |
# |
Sep 4th 2019, 15:53 |
lilhermit |
I'm trying to do that |
# |
Sep 4th 2019, 15:52 |
neon1024 |
There is a whole bit in the book about sub-queries |
# |
Sep 4th 2019, 15:52 |
neon1024 |
So you’re doing `SELECT * FROM (SELECT x,y FROM..` query? |
# |
Sep 4th 2019, 15:45 |
neon1024 |
No idea then, I’m afraid. |
# |
Sep 4th 2019, 15:45 |
neon1024 |
I would question the need for a Union, but I’m sure there is a reason |
# |
Sep 4th 2019, 15:44 |
lilhermit |
yes I have a union and my understanding is I need to wrap it so that paginator LIMITs are not added to the first query |
# |
Sep 4th 2019, 15:43 |
lilhermit |
yes `->select('*')` adds table name and `as` |