How about trailing commas in SQL?
101–110 of 272 posts
Re: How about trailing commas in SQL?
#102Earlier quoted context omitted.
If Rust can only be used with Rust, then it's strange that the project lists a number of other languages in the docs: https://prql-lang.org/book/project/bindings/index.html
Alright, it supports four languages, but that’s still not much.
PRQL appears to be a rather small project... not some major corporate effort.
Re: How about trailing commas in SQL?
#103Re: How about trailing commas in SQL?
#104I feel the problem. When coding (not only in SQL) you often have to add something to the end of a list, and it is annoying that the end of the list is always special. You can't just copy some line and move it there. Also when moving things around you always have to take extra care at the end. So, my solution for this was always SELECT a , b , c FROM ... instead of: SELECT a, b, c, -- people want to allow trailing com…
I think the right answer is to fix the merge algorithm to handle some common cases where an inserted line logically includes the delimiter at the end of the previous line.
Re: How about trailing commas in SQL?
#105I feel the problem. When coding (not only in SQL) you often have to add something to the end of a list, and it is annoying that the end of the list is always special. You can't just copy some line and move it there. Also when moving things around you always have to take extra care at the end. So, my solution for this was always SELECT a , b , c FROM ... instead of: SELECT a, b, c, -- people want to allow trailing com…
SELECT ...
WHERE
foo = 1
AND bar = 2
I want to comment out a line (i.e. "--foo = 1"), but would break the syntax.The solution is to start with "WHERE true":
SELECT ...
WHERE true
--AND foo = 1
AND bar = 2
Now you can comment/comment anything.(Putting the AND at end of each line has the same problem, of course, and requires putting a "true" at the bottom instead.)
Re: How about trailing commas in SQL?
#106I feel like this ship has sailed. SQL has been around for more than 50 years and everyone who needs to generate it has already put that extra `if` statement in to suppress trailing commas. What annoys me far more often is the lack of support for trailing commas in JSON.
Re: How about trailing commas in SQL?
#107I reject any argument about how mature SQL is at this point. Just bump the version number (SQL 25) if necessary and make it so.
Re: How about trailing commas in SQL?
#108IIRC BigQuery started allowing trailing commas in queries around 2019. It all came as a very big surprise, out of thin air.
That's correct, and I absolutely love it. If I move to a new role where BigQuery is not the data warehouse of choice, I think this will be the thing I'll miss most.
Re: How about trailing commas in SQL?
#109Frequently I will be working on a query and have something like
SELECT
a
, b
, c
from foo
and then I want to comment out a column as I am working and exploring the data. But I cant comment out column a without also removing the comma on the next line.Re: How about trailing commas in SQL?
#110Earlier quoted context omitted.
Alright, it supports four languages, but that’s still not much.
The limitation is clearly not Rust. Any language that can bind to C libraries can bind to the functions PRQL exposes... the authors just haven't chosen to implement convenient SDKs for many languages. They also list 8 languages, not 4, just that they've had time to polish the libraries for 4 languages, apparently. PRQL appears to be a rather small project... not some major corporate effort.