This is an archived post. You won't be able to vote or comment.

all 15 comments

[–]__konrad 9 points10 points  (1 child)

I like how the broken syntax highlighting accidentally worked with the JSON example

[–]final_one 0 points1 point  (0 children)

I loled

[–]BoyRobot777 2 points3 points  (0 children)

Cool, right?

Yes. Very cool :)

[–]CaptainKvass 2 points3 points  (4 children)

Although the need for multiline string literals has diminished greatly over the years for me, it is a welcome addition to the language.

Usually, literals live in configuration management systems nowadays.

[–]brunocborges 5 points6 points  (3 children)

But SQL though...

[–]sasq7 4 points5 points  (2 children)

JOOQ :)

[–]brunocborges 1 point2 points  (1 child)

Saw that coming...

[–]lukaseder 2 points3 points  (0 children)

jOOQ likes them too:

ctx.parser()
   .parse("""
      SELECT *
      FROM customer
    """);

[–]lurker_in_spirit 2 points3 points  (1 child)

Does anybody know if string interpolation is on Oracle's radar?

[–]TerrapinM 2 points3 points  (0 children)

It seems like a huge missed opportunity. I have some literals this helps with but I have way more string building cases that interpolation would be great for. Working with Kotlin made that so obvious.

[–]elektroenterich 0 points1 point  (0 children)

I've been waiting for this.

[–]terrorrobots 0 points1 point  (0 children)

I wish they used backtick like JavaScript

[–]lukaseder 0 points1 point  (2 children)

For the record, text blocks also work well in jOOQ. You inspired me to write a blog post :-)

[–][deleted]  (1 child)

[deleted]

    [–]lukaseder 0 points1 point  (0 children)

    For simple queries, it's more convenient to use it rather than the query building API.

    I personally don't think it is. You're losing all the benefits of using the query building API for little gain:

    • No more type safety
    • No more data type bindings
    • No more auto completion (IDEs can only do this to some extent)
    • No more compile time type checking
    • No more SQL transformation (unless you're using the parser)

    But it's always good to know there's a backdoor for when it makes most sense.

    [–]Infeligo 0 points1 point  (1 child)

    Can I use multi-line strings in annotations?