Commit | Line | Data |
92b6fb5f |
1 | mo: ribasushi: are you pro or con wrt the extended join conditions? |
2 | [18:22] ribasushi: totally pro, but con scalarrefs |
3 | [18:22] ribasushi: and I'm a horrible designer |
4 | [18:23] ribasushi: so I say "tell me what to write and I'll write it better than you would" |
5 | [18:23] mo: and what about a second hashref which is parsed like search()? |
6 | [18:24] ribasushi: mo: show me what you mean |
7 | [18:25] mst: join => { 'foo' => { -attrs => { ... } } |
8 | [18:25] mo: has_many(accessor => 'CLASS', { foreign,self stuff }, { 'me.foo' => { '>' => 'accessor.bla' } } |
9 | [18:26] mst: and -attrs can then override the rel's defaults |
10 | [18:26] ash: mo: there's already a 4th arg to rels |
11 | [18:26] mo: mst: where would you put that in the has_many call? |
12 | [18:26] mst: mo: that's for search() syntax |
13 | [18:26] mo: ok so add another method next to has_many |
14 | [18:26] mst: no |
15 | [18:27] mst: I'm talking about overriding the join stuff in search() |
16 | [18:27] mo: I'm talking about extended join conditions |
17 | [18:27] mst: I am aware of that. I'm saying "we should do this at the same time" |
18 | [18:27] pktm hat den Chatroom betreten. |
19 | [18:28] ribasushi: I'm talking about both - it should be just like attrs - specifiable both on relationship and on searches |
20 | [18:28] mo: mst: what would you propose? |
21 | [18:28] ribasushi: and overridable accordingly of course |
22 | [18:28] mo: syntax I mean |
23 | [18:28] mst: does SQL::Abstract have a { -ident => 'foo.bar' } yet? |
24 | [18:29] ribasushi: explain? |
25 | [18:29] pktm: How do I (efficently) select the complement of a relation? I have products and categories, and I want to know the products, that are not assigned to a specific category. So what is complement( $category->products() )? |
26 | [18:29] mst: pktm: er |
27 | [18:29] mst: pktm: you mean not assigned to category X |
28 | [18:29] mst: pktm: or not assigned to -any- category ? |
29 | [18:29] pktm: not assigned to category X |
30 | [18:29] robkinyon: mst: I think I have a solution |
31 | [18:30] robkinyon: it's completely backwards INcompatible |
32 | [18:30] robkinyon: |
33 | [18:30] ribasushi: robkinyon: not interested |
34 | [18:30] robkinyon: but it solves all problems |
35 | [18:30] robkinyon: (including world peace) |
36 | [18:30] mo: ribasushi++ # who cares about backwards compat |
37 | [18:31] robkinyon: why don't we just allow the full search() syntax? |
38 | [18:31] ribasushi: mo: I don't give a fuck frankly, I just want *my* code to work |
39 | [18:31] robkinyon: it's being used to build a search() anyways |
40 | [18:31] arcanez: mst++ # being done |
41 | [18:31] mst: robkinyon: that would be -exactly- my plan |
42 | [18:31] mo: robkinyon++ |
43 | [18:31] mst: we add an extra relationship attribute |
44 | [18:31] mo: what about self and foreign? |
45 | [18:31] mst: that's a subref |
46 | [18:31] mst: that's supplied @_ of ($rs, $lhs_alias, $rhs_alias) |
47 | [18:32] mst: and is expected to return a chunk of search() params |
48 | [18:32] dhoss: arcanez: get your GSoC stuff figured out yet? |
49 | [18:32] robkinyon: and we implement the current code in terms of that? |
50 | [18:32] ribasushi: mst: *this* I love |
51 | [18:33] robkinyon: i can get behind this |
52 | [18:33] robkinyon: regardless of use-case need |
53 | [18:33] robkinyon: because this is a sane API |
54 | [18:33] mst: it eliminates the "deep finding of self/foreign in SQLA" problem |
55 | [18:33] mst: which was why I didn't want to do it before |
56 | [18:33] zamolxes hat den Chatroom verlassen. (Quit: leaving) |
57 | [18:33] mst: if the user wants to be clever, they get to handle that themselves |
58 | [18:33] robkinyon: it also eliminates the need for two SQL specification languages |
59 | [18:33] ribasushi: add_relationship receives two modes - either foreign./self. (for backcompat) or a regular search |
60 | [18:33] robkinyon: and standardizes on the one that we're actually working on |
61 | [18:33] ribasushi: and the helpers get adjusted to produce new code |
62 | [18:33] ribasushi: and then join_cond can override all that |
63 | [18:34] ribasushi: mst: that's what you mean? |
64 | [18:34] mst: sub { my ($rs, $self, $foreign) = @_; { "${self}.foo" => { '>', "${foreign}.bar" } }; } |
65 | [18:34] nigel hat den Chatroom verlassen. (Quit: nigel) |
66 | [18:34] mst: add_relationship can DWIm based on if it gets a hashref or a subref in the join position |
67 | [18:34] robkinyon: what about \{ ... } ? |
68 | [18:34] mst: robkinyon: stop. think. |
69 | [18:34] robkinyon: if it receives HREFREF, then it's just a search() args? |
70 | [18:34] mo: what about an object |
71 | [18:35] robkinyon: and that maps closely in terms of how things work right now to pass through |
72 | [18:35] mst: wtf |
73 | [18:35] mst: no. |
74 | [18:36] mst: we can't just provide raw search args |
75 | [18:36] mst: otherwise we have to recurse the full SQLA tree to substitute aliases |
76 | [18:36] mst: which is a horrible job |
77 | [18:36] mst: part of the reason for SQLA2 is to have somewhere we can do non horrible AQT comprehensions |
78 | [18:36] mst: hence: subref |
79 | [18:36] ribasushi: hear hear |
80 | [18:36] mst: which delegates the problem to the user |
81 | [18:36] arcanez: dhoss: plan to work on it once I watch a rather subdued mst |
82 | [18:36] robkinyon: ok |
83 | [18:37] dhoss: subdued mst? that's not fun... |
84 | [18:37] robkinyon: subref it is |
85 | [18:37] mst: we don't need to modify the helpers though |
86 | [18:37] mst: well |
87 | [18:37] arcanez: his dbix::class talk, wasn't it at 8am? |
88 | [18:37] mst: resolve_join should switch to generating basic SQLA |
89 | [18:37] mst: the only reason it ever didn't |
90 | [18:37] mst: was SQLA had no way to represent identifiers on the RHS |
91 | [18:37] mst: and the subref should just return SQLA |
92 | [18:38] fade hat den Chatroom verlassen. (Quit: Leaving.) |
93 | [18:38] ribasushi: these are implementation details which do not matter much |
94 | [18:39] ribasushi: sqla does not support FROM at all, it is all done in Hacks anyway |
95 | [18:39] ribasushi: talking about 1.5 of course |
96 | [18:39] robkinyon: so, we agreed on a design? |
97 | [18:40] solar_ant hat den Chatroom betreten. |
98 | [18:40] mst: robkinyon: right, but this cleanup |
99 | [18:40] mst: ribasushi: |
100 | [18:40] mst: moves us towards being able to move it to SQLA |
101 | [18:40] Psyche^ hat den Chatroom betreten. |
102 | [18:40] mst: we didn't yet becaue ldami pointed out, quite rightly, that the DBIC interface was inconsistent |
103 | [18:40] mst: we're about to fix that |
104 | [18:40] Patterner hat den Chatroom verlassen. (Read error: Connection reset by peer) |
105 | [18:40] Psyche^ heißt jetzt Patterner. |
106 | [18:40] ribasushi: mst: of course, I do try to isolate chunks as I go |
107 | [18:41] robkinyon: which means that ash and i better beat up SQLA2 quickly |
108 | [18:41] ribasushi: but anyway - can someone type up an actual example for me |
109 | [18:41] ribasushi: one for add_relationship |
110 | [18:41] ribasushi: and one for search() |
111 | [18:41] ribasushi: something I can turn into a test (or if someone submits an is_same_sql test - that'd be golden) |
112 | [18:41] robkinyon: search() doesn't change here, does it? |
113 | [18:41] ribasushi: sigh |
114 | [18:42] ribasushi: of course it does - there's no point to do it otherwise |
115 | [18:42] robkinyon: i thought the point was to unfuck add_relationship()? |
116 | [18:42] ribasushi: i.e. not "changes" but supports an extra attribute |
117 | [18:42] robkinyon: no .... |
118 | [18:42] robkinyon: mst? |
119 | [18:42] purl: i guess mst is wrong it is a hard way to write handles => qr/.*/ or a young whippersnapper from nigel's exalted position or planning to port the world to moose or working on serializable meta with another approach or simply a wanker or a bot or really a peach or a blunt or faster than light or a bitter betty or ~13 times better than sex |
120 | [18:42] ribasushi: robkinyon: how do you supply bind values to a join if you set it on the relationship in stone |
121 | [18:43] robkinyon: Scalar::Alias? |
122 | [18:44] robkinyon: Scalar::Defer |
123 | [18:44] purl: i heard Scalar::Defer was one of them, is a nice module, does nice stuff |
124 | [18:44] ribasushi: robkinyon: Rainbow::Pony ? |
125 | [18:44] ribasushi: be practical |
126 | [18:44] arcanez: "are we fucked" "no because we didn't get to the pub in time to pull" |
127 | [18:44] arcanez: hahahahaha |
128 | [18:44] purl: LOLCON 5 reached. |
129 | [18:44] robkinyon: ribasushi: Scalar::Defer is practical |
130 | [18:45] robkinyon: at least mst has thought so in the past |
131 | [18:45] mst: I like Data::Thunk better but nothingmuch is convinced it can't be 100% fixed and won't explain why well enough for me to try and prove him wrong |
132 | [18:45] robkinyon: ribasushi: the point is that we want to defer resolution of the bindvars |
133 | [18:46] mst: that's easy |
134 | [18:46] robkinyon: that way, it becomes purely an add_relationship problem |
135 | [18:46] mst: no rob, it doesn't |
136 | [18:46] robkinyon: and search() is unaffected |
137 | [18:46] mst: searhch needs extending as well |
138 | [18:46] robkinyon: to do what? |
139 | [18:46] mst: { join => { 'foo' => { -attrs => { join_args => [ 3 ] } } } |
140 | [18:47] arcanez: mst: who's writing HashMap for moose? |
141 | [18:47] ribasushi: mst: how about overrides on the spot? or that's too much foo? |
142 | [18:47] ribasushi: I mean search to override the entire relship construction, only self. foreign. remain static |
143 | [18:48] robkinyon: either way, have fun |
144 | [18:48] • robkinyon & # errands |
145 | [18:48] ribasushi: or hell - join without a relationship altogether |
146 | [18:48] ribasushi: as in the case of self-join to figure out "last row" |
147 | [18:48] mst: has_many('foo', $f_class, sub { my ($rs, $self, $foreign, $arg) = @_; { "${self}.id" => "${foreign}.bar_id", "${foreign}.weight" => { '>', $arg } }, ...); |
148 | [18:48] mst: so you get |
149 | [18:48] ribasushi: mst: I get that part |
150 | [18:48] mst: LEFT JOIN foo ON me.id = foo.bar_id AND foo.weight > 3 |
151 | [18:49] ribasushi: I'm saying how do you feel about search ({}, { join => { a definition that is not a relationship, but which will produce a join nevertheless } }); |
152 | [18:50] ribasushi: example here: http://lists.scsys.co.uk/pipermail/dbix-class/2009-June/008095.html |
153 | [18:50] ribasushi: I don't need anything from the right side, I just need the join to limit the left side properly |
154 | [18:51] mst: anonymous joins will discourage re-use and completely fuck us introspection wise |
155 | [18:51] mst: I don't want to do that yet |
156 | [18:51] mst: we -will- |
157 | [18:51] ribasushi: fair enough |
158 | [18:51] mst: but I don't want to add too much stuff at once |
159 | [18:51] ribasushi: mst++ #conservatism |
160 | [18:53] mst: mo: so, you up for writing tests for this? |
161 | [18:54] mo: I think David Ihnen is up to it, I was just trying to bring this to _your_ attention |
162 | [18:54] ribasushi: except david ihnen is not reading this |
163 | [18:55] mo: so you have to convince him by mail |
164 | [18:55] mst: mo: so write up the conversation to an outline |
165 | [18:55] mst: and reply to the list saying "if somebody writes spec tests we can make it happen" |
166 | [18:55] mst: you don't have to be me to shout well volunteered |
167 | [18:55] mst: you just have to look them in the eye and have them believe you already know they'll say yes |
168 | [18:56] mo: I didn't get that add_relationship part |
169 | [18:56] mo: does it even matter? |
170 | [18:56] mst: yes |
171 | [18:57] mst: without the add_relationship part none of this will work at all |
172 | [18:57] mo: but is it required for the tests? |
173 | [18:57] mst: yes |
174 | [18:57] mst: how can you write tests for something that can't work? |
175 | [18:57] mo: so I have to call add_relationship in my test? |
176 | [18:57] mst: what? |
177 | [18:57] mst: what the fuck are you talking about? |
178 | [18:57] mo: has_many calls add_relationship right? |
179 | [18:57] mst: this is the DBIC test suite |
180 | [18:57] mst: it's got a fucktonne of rels |
181 | [18:57] mst: just add another one |
182 | [18:58] pktm hat den Chatroom verlassen. |
183 | [18:58] mo: can you tell me your weight so I can add it to the actors result class? |
184 | [18:58] pktm hat den Chatroom betreten. |
185 | [18:58] mst: I haven't weighed myself in ten years |
186 | [18:59] pktm hat den Chatroom verlassen. |
187 | [18:59] dnm: mst weight is made up of 90% human, 10% pure unadulterated rage. |
188 | [18:59] • ilmari guesses about 75kg |
189 | [18:59] dnm: s/mst/mst's/ |
190 | [18:59] dhoss: mo i'm 165, kthx |
191 | [18:59] mst: I'm probably 14 stone ish? maybe a bit less |
192 | [18:59] ilmari: judging by the fact that he's slightly taller and slightly skinnier than me |
193 | [18:59] mst: I dunno |
194 | [18:59] dhoss: dnm: you forget the beer part |
195 | [19:00] ilmari: convert 75 kg to stone |
196 | [19:00] purl: 75 kg is 11.8105 stone. |
197 | [19:00] mst: hmm. I was 12 stone ish many years back |
198 | [19:00] mo: convert 14 stine to kg |
199 | [19:00] purl: I don't know how to convert 14 stine to kg. |
200 | [19:00] dhoss: purl: convert 11.8105 stone to pounds |
201 | [19:00] purl: 11.8105 stone is 165.347 pounds. |
202 | [19:00] ribasushi: dhoss: he does evacuate occasionally...? |
203 | [19:00] mst: I think you're ignoring the beer gut. |
204 | [19:00] mo: convert 14 stone to kg |
205 | [19:00] purl: 14 stone is 88.9041 kg. |
206 | [19:00] • ilmari is somewhere between 75-80kg |
207 | [19:00] dhoss: ribasushi: i figured it couldn't hurt to average |
208 | [19:00] ribasushi: convert 82kg to stone |
209 | [19:00] purl: 82kg is 12.9128 stone. |
210 | [19:00] ribasushi: convert 82kg to lb |
211 | [19:00] purl: 82kg is 180.779 lb. |
212 | [19:00] • ribasushi 's a fatass |
213 | [19:01] dhoss: mst: you're what, 6'2" |
214 | [19:01] mo: convert 6'" to meters |
215 | [19:01] purl: I don't know how to convert 6'" to meters. |
216 | [19:01] dhoss: ribasushi: how tall? |
217 | [19:01] mst: huh |
218 | [19:01] mst: 71kg |
219 | [19:01] mo: convert 6'2" to meters |
220 | [19:01] purl: I don't know how to convert 6'2" to meters. |
221 | [19:01] ilmari: purl: convert 6ft+2in to m |
222 | [19:01] purl: Syntax error |
223 | [19:01] ilmari: purl: convert 6.333ft to m |
224 | [19:01] purl: 6.333ft is 1.9303 m. |
225 | [19:01] mst: and I'm 6' |
226 | [19:01] ribasushi: dhoss: 194cm, but I'm rather skinny, was at 75 up until 2yrs ago |
227 | [19:01] mst: if my back was straight I'd be taller |
228 | [19:01] ilmari: purl: convert 6.16ft to m |
229 | [19:01] purl: 6.16ft is 1.87757 m. |
230 | [19:02] mst: but I've spent too long slouching so my spine is curved |
231 | [19:02] ribasushi: now I am still mostly skinny |
232 | [19:02] dhoss: purl: convert 194cm to feet |
233 | [19:02] purl: 194cm is 6.36483 feet. |
234 | [19:02] dhoss: ribasushi: tall guy |
235 | [19:02] • dhoss is short apparently |
236 | [19:02] ribasushi: well if we're factoring spine curvature |
237 | [19:02] ribasushi: I'm normally 191-2 |
238 | [19:03] mst: I literally can't stand up straighter than that |
239 | [19:03] dhoss: ribasushi: still, i'm only 5'10" |
240 | [19:03] mo: ok guys please fill out that form with your weight and size so I can include it with the dbic test suite and do an extended relationship on it: http://etherpad.com/jeAQjdub7M |
241 | [19:03] arcanez: I'm 6'1", 190lbs |
242 | [19:03] mst: mo: why not just use the year field on cds? |
243 | [19:03] mo: it's more fun this way |
244 | [19:03] dnm: I'm 6'0", a lot lbs. |
245 | [19:04] dhoss: huh. i haven't felt this short since middle school haha. |
246 | [19:04] arcanez: so yeah, don't bother trying to understand http://www.shadowcat.co.uk/archive/conference-video/yapc-na-2009/lightning/ |
247 | [19:04] dnm: But, I am 15lbs lighter than I was 1 month ago. |
248 | [19:04] arcanez: oh, he apologizes at the beginning |
249 | [19:04] • dhoss actually gained 10lbs |
250 | [19:05] arcanez: dhoss: p90x? |
251 | [19:05] ribasushi: that pad thingy is nifty |
252 | [19:05] dhoss: arcanez: no, before that, i'm not sure what caused it |
253 | [19:06] mo: wtf is using chrome? |
254 | [19:06] • arcanez raises hand |
255 | [19:07] mst: I'm waiting for them to learn how to write desktop code |
256 | [19:07] arcanez: convert 190 pounds to stone |
257 | [19:07] purl: 190 pounds is 13.5714 stone. |
258 | [19:07] arcanez: convert 190 pounds to kg |
259 | [19:07] purl: 190 pounds is 86.1826 kg. |
260 | [19:08] mo: we should start coding in that editor |
261 | [19:08] arcanez: convert 6.1 ft to m |
262 | [19:08] purl: 6.1 ft is 1.85928 m. |
263 | [19:08] frew: ribasushi: ok, I've reviewed most of this. I'll read through the rest tomorrow and then commence testing |
264 | [19:08] ribasushi: frew++ |
265 | [19:09] frew: in other news: Firefox 3.5! |
266 | [19:09] • ilmari has been using it happily on karmic since beta4, waiting for jaunty backport |
267 | [19:10] arcanez: ilmari: jaunty uses amarok2 huh |
268 | [19:10] frew: amarok2-- |
269 | [19:10] arcanez: frew: there aren't enough -- for that |
270 | [19:10] frew: amarok2-- for (1..10**10); |
271 | [19:10] ilmari: arcanez: I don't use amarok |
272 | [19:10] arcanez: |
273 | [19:10] frew: ok maybe that's a little harsh |
274 | [19:10] ilmari: jaunty has amarok 2.1 |
275 | [19:10] frew: I really like amarok |
276 | [19:11] ilmari: s/jaunty/karmic/ |
277 | [19:11] frew: and 2 is good; but it's got bugs that make me cry |
278 | [19:11] ilmari: kde4.2 is annoying |
279 | [19:11] arcanez: I <3 amarok1 |
280 | [19:11] ilmari: less so after I switched off compositing, which is just buggy beyond belief |
281 | [19:11] ribasushi: frew: don/t forget t/42toplimit.t - it needs a massive rewrite to set the new query syntax in stone |
282 | [19:11] arcanez: I use iTunes on Windows 7 at home though |
283 | [19:11] arcanez: ilmari: I'm a gnome guy |
284 | [19:11] arcanez: perhaps I'd like E |
285 | [19:11] • ilmari ponders trying awseome |
286 | [19:11] frew: ribasushi: we'll burn that bridge tomorrow |
287 | [19:12] ribasushi: yup, just re-nagging |
288 | [19:12] arcanez: someone buy me a mac mini |
289 | [19:12] ilmari: arcanez: I use gnome on karmic at home, but at work I like the ability to grow and pack windows with the keyboard |
290 | [19:12] mo: how do I create a branch? |
291 | [19:12] arcanez: is karmic the next ubuntu release name? |
292 | [19:12] mo: ribasushi: can you branch it for me? |
293 | [19:12] arcanez: mo: svn cp |
294 | [19:12] ilmari: arcanez: yeh, 9.10 LTS aka karmic koala |
295 | [19:12] ribasushi: mo: sv[kn] cp <what> <where> |
296 | [19:13] ilmari: 10.04 hasn't been named yet |
297 | [19:13] mo: dbic svn? |
298 | [19:13] purl: dbic svn is probably http://dev.catalyst.perl.org/repos/bast/DBIx-Class |
299 | [19:13] arcanez: ilmari: what # whas jaunty |
300 | [19:13] • ilmari hopes for leaping llama |
301 | [19:13] ilmari: arcanez: 9.04 |
302 | [19:13] ilmari: it's <year>.<month> |
303 | [19:13] • dhoss still needs to update |
304 | [19:13] ilmari: rather, <year-2000>.<month> |
305 | [19:14] ilmari: which works nicely for such a young distro |
306 | [19:14] mo: arcanez: ribasushi thanks |
307 | [19:14] ribasushi: we should switch dbic versions to that <Y-2000>.0MM0DD |
308 | [19:14] arcanez: ribasushi: that wouldn't get confusing |
309 | [19:15] mst: ribasushi: VOM |
310 | [19:15] arcanez: purl, vom? |
311 | [19:15] purl: vom is, like, volt-ohm-meter |
312 | [19:15] mo: ribasushi: Y-2000.DDD |
313 | [19:15] ribasushi: mst: vom? |
314 | [19:15] purl: i think vom is volt-ohm-meter |
315 | [19:16] ribasushi: hm |