dawesi
08/13/2022, 4:34 PMzackster
08/13/2022, 4:39 PMdawesi
08/13/2022, 4:51 PMbdw429s
08/13/2022, 4:54 PMbdw429s
08/13/2022, 4:54 PMbdw429s
08/13/2022, 4:55 PMbdw429s
08/13/2022, 4:55 PMAdam Cameron
zackster
08/13/2022, 6:51 PMzackster
08/13/2022, 6:53 PMzackster
08/13/2022, 6:54 PMselect cf.listFirst(fullname, ' ' ) as firstname from users
etczackster
08/13/2022, 6:57 PMAdam Cameron
Query.map
for that?
My chief hesitation is that "passing a string to something to process" doesn't seem like a great wat to write code. I mean with a DB it makes sense cos SQL is the lingua franca, but doing it to Lucee itself? Not a great way of solving whatever the perceived problem is.Adam Cameron
Adam Cameron
zackster
08/13/2022, 7:00 PMzackster
08/13/2022, 7:01 PMAdam Cameron
UNION
might be something that QoQ does that has no one-expression equiv in native CFML? How might that be implemented I wonder?
My 30sec of thought on the topic didn't come up with anything else that can't already be done "better" using CFML these days (with the map / reduce / sort / filter methods)Adam Cameron
the rationale wasYeah, got it. But... are you in the business of writing an SQL dialect? No.
Adam Cameron
zackster
08/13/2022, 7:03 PMzackster
08/13/2022, 7:03 PMzackster
08/13/2022, 7:03 PMAdam Cameron
Also discussed but far more complex to implementSure. But that's what we need the Lucee Dev Team to do. Because the dev users of Lucee can't do that themselves already.
zackster
08/13/2022, 7:04 PMAdam Cameron
it's nice to have different ways to skin a catIf you have spare time on yer hands maybe. But I don't think it's a good use of the amount of time you have. YMMV obvs.
zackster
08/13/2022, 7:04 PMAdam Cameron
select cf.listFirst(fullname, ' ' ) as firstname from users
is compelling. I think Brad's client might be trying to solve their perceived issue in a subpar way.Adam Cameron
Adam Cameron
Adam Cameron
bdw429s
08/13/2022, 7:35 PMcf.refindNoCase( ".*foo$", col1 )
Then the thought became-- well why not add all the basic math/string/date functions that CFML has available via a cf. namespace in QoQ?
(Side note, I already did something similar in the CommandBox CLI)
CommandBox> #hash pass | #ucase | #reverse
which provides direct access to CFML functions from the command line via a command parsing syntaxbdw429s
08/13/2022, 7:36 PMbdw429s
08/13/2022, 7:37 PMbdw429s
08/13/2022, 7:41 PMSELECT listMap( colName, (i)=>ucase(i) ), anotherCol
from myQry
That would be confusing and much complicated to be directly mixing the different langauges. So I'd want to limit the integration to be functions operating on simple values (though I DO have some ideas about native JSON support...) which can have an analogous mapping from the generic func( arg, arg )
sql syntax to the same CFML syntax.bdw429s
08/13/2022, 7:42 PMbdw429s
08/13/2022, 7:45 PMvar customFunc = (s)=>rerverse(s);
queryExecute( "
select col1, col2, cfudf.customFunc( col3 ) as myAlias
", [], { dbType='query' } )
but I would be rather cautious about taking it that far. I think there's a balance of adding something incrementally useful to existing QoQ SQL and blurring the lines a bit between your CFML and SQL.bdw429s
08/13/2022, 7:51 PMINNER JOIN
syntax as well as the from tbl1, tb2
syntax as well as left, right, and full outer joins while I was at it. (It always annoyed me CF didn't have outer joins!) While I've thought a good deal about it, no one has offered to sponsor it so I need to have quite a bit of free time to drop on it (not all dev time is fungible) so it's been easier to pick at a few low hanging fruit that I can button up in a day or two thus far.Adam Cameron
I do have some apprehensions on the cf namespaceYeah. Because if you do that, you gotta support everything that CFML can do, in a SQL-ish sort of way. Yikes. How about you just raise tickets for adding in "have a date formatting function like how mysql does", and "have a regex replace function like how pgsql has". Or maybe settle on one SQL dialect to follow etc. Implement some stuff that solves some real pain points (re the dateformatting... I'd be going "no, fuck that... you can do that in yer presentation later, or whatever intermediary adapter you need to make a date into a string" etc etc). And I'd still err on the side of "look: just... no. The way you want do to this is just not how it should be done at a language level, even if it's convenient for the way you've written your code... do it in the DB or do it on the app code... don't try to do it halfway in between". Your clients might have the perfect sensible use case where
DATEFORMAT
makes sense to be done inside a QoQ. But you also need to look at the can of worms yer opening if you put it into Lucee. That's gonna be abused, and it's gonna make for a lot of shit CFML out there, which at some point you or I might need to maintain.
Every paid-for feature into Lucee should first and foremost benefit & be a good fit for Lucee. Not the paying client. And the paying client should also be paying enough that any future maintenance of said feature is covered. For the life of the product.bdw429s
08/13/2022, 7:54 PMI've been watching rugbyI'm watching an NFL preseason game 🙂
Adam Cameron
bdw429s
08/13/2022, 8:10 PMyou gotta support everything that CFML can doNot not necessarily true. We can implement whatever sub set makes sense and then clearly document it 🙂 Just because there exists a slippery slope doesn't mean we can't avoid it.
"look: just... no. The way you want do to this is just not how it should be done at a language level, even if it's convenient for the way you've written your code... do it in the DB or do it on the app code... don't try to do it halfway in between".I understand what you're saying, I just have a different perspective I think. I think T-SQL, P-SQL and the like have shown us there's great use cases and uptake on using SQL to not just select and aggregate, but also to manipulate data in a set-based syntax. I'm of the mind that QoQ has always been a bit of a red-head step child and there's no reason it should be. SQL syntax is a familiar and powerful way to transform set-based data and I'd like to make it kick butt by asking "_why not!?_" more often.
Not the paying clientI agree with you there, but paying clients have nothing to do with the motive for these features. I think there's an envelope that can be pushed here in a way that makes sense. I've entered in ticket to the Adobe bug base for every improvement I've made to Lucee's QoQ and I'd invite Adobe to follow here as well. Also, FWIW, the cf namespace wasn't entirely cooked up in a smokey backroom by Zac and myself. We had a large RCF thread back in Feb of this year about it with lots of examples and opinions shared. https://dev.lucee.org/t/request-for-comments-new-proposed-qoq-feature-for-cfml-bifs/9609
Adam Cameron
I just have a different perspective I think. I think T-SQL, P-SQL and the like have shown us there's great use cases [...]I'll go back to my earlier comment about basically "writing code in a string" here, I think. It just seems like a shit way of solving a problem. To me. IMO. etc. Other platforms / approaches have been to eschew the whole SQL string thing, instead using DSLs (LINQ etc). But here we're thinking of charging further in to using code in strings... (slightly different use case, I know; the metaphor stands though, I think) Also... almost all CFMLers are shit at CFML, and even worse @ SQL. I can see how this is gonna have minimal uptake by ppl who could actually use it properly, and fuck-load of questions here and on other Lucee forums of ppl not being able to maker their code^h^h^h^hstring work(\*). I see this as a kind of "just because you can, doesn't mean you should". But anyway... you've articulated yer opinion well and I get what yer saying. I don't agree it's a good feature, but... like... "me" and "disagreeing" isn't exactly a new concept around here 😉 (\*) error reporting on this is gonna need to be thought about as well. Because there will be errors to report on.
dswitzer
08/15/2022, 11:45 AMStill don't think stuff likeI think the useful comes more when trying to join values or filter on values. Or what if you're massaging the query for another process (like exporting to CSV/Excel/whatever). Yes, there are other ways you can approach it, but in some cases there's convience there and isn't the benefit of language like Lucee, having convience helpers? That said, I do agree it's a slipperly slope when it comes to support. Just because something can be added, doesn't always make it a good idea. The more things that are added, the more chance their are of bugs and there's more things to support. But I know the team working on Lucee is all to familiar with those concepts.is compelling. I think Brad's client might be trying to solve their perceived issue in a subpar way.select cf.listFirst(fullname, ' ' ) as firstname from users
Adam Cameron
I think the useful comes more when trying to join values or filter on values. Or what if you're massaging the query for another processI don't think "in a QoQ" is going to be the best place for either of those to happen, 99% of the time. TBH I don't think QoQ is the best place to do anything, 99% of the time 😉
dswitzer
08/15/2022, 11:56 AMAdam Cameron
evaluate()
call to me.
I think if back when the concept of record sets were added to CFML we also had the collection-manipulation higher-order functions added in and were robust, then the thought of QoQ never ever would have come about. Obvs I know the history of when things were added to CFML and how it evolved, so I know that was never viable, and I am not indicting anyone. I'm just wittering on about how I think QoQ are a bit of an odd one to start with.bdw429s
08/15/2022, 9:17 PMI don't think QoQ is the best place to do anything, 99% of the timeMicha, Gert, et al gave QoQ a bad name over the years (I've heard them disparage it several times at conferences) and I think it's rather unfortunate. It's a natural method of working with "sets" of data and a lot of people really like it. I can't help but think that much of the core Lucee teams dislike of QoQ stemmed far more from their specific implementation which performed VERY poorly and was full of bugs. It worth pointing out, that original implementation has been fully refactored, optimized, and improved. It's not fair for the concept to be sullied by the previous implementation quality, nor is someone's personal taste for the best way to solve a problem a very valid critique of whether an idea has merit. Otherwise, it's like me telling someone I think heated seats are a silly feature that shouldn't be installed in an automobile but then qualify it with the information that I don't actually have a drivers license and I don't even drive a car at all. I personally think QoQ is really one of the stand-out features of CFML and I've made Java developers jaws drop at how simple and easy basic manipulation of data can be done server-size using a familiar SQL syntax, which I still consider to be superior to the functional approach in many cases that require joining, aggregating, distincting, and unioning.
Adam Cameron
bdw429s
08/15/2022, 11:38 PMbdw429s
08/15/2022, 11:39 PMzackster
08/16/2022, 7:03 AMzackster
08/16/2022, 7:03 AM