question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Semantics of new-line escaping in edgedb

See original GitHub issue

Currently, all spaces are preserved, like in python:

edgedb>SELECT "hello \ 
.......       xxx";                    
{'hello       xxx'}

But I believe that’s legacy and I very much like rust’s semantics:

rust> println!("{:?}", "hello \
              world")
"hello world"

(i.e. stripping all whitespace at the start of the next line

This allows nicely indented long string phrases, and also allows breaking non-whitespace-separated texts:

WITH
    url := "http://example.com/\
            some/very/long/path"

(which is super-ugly with python semantics)

The downside is that you need to put whitespace before continuation:

second_line_indented := "def x():\n    \
                             return 'x'"

But with python’s semantics, inside and outside indentation typically do not match anyway.

What do you think?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
elpranscommented, Dec 3, 2019

Yeah, I withdraw my objection as well.

1reaction
vpetrovykhcommented, Dec 3, 2019

The zoom conversation clarified that actually the Rust semantics of \ are fine. All strings are white-space preserving in EdgeDB and the \ allows to opt out of that in specific cases. I got confused by the indentation example (which is easier to do by not using the unnecessary line continuation). So +1 on Rust semantics.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Lexical structure — EdgeQL | EdgeDB Docs
Tokens are normally separated by whitespace (space, tab, newline) or comments. ... Here's some examples of regular strings using escape sequences.
Read more >
Oracle® Big Data SQL - User's Guide
multiple lines, you must use a backslash to escape the new line characters. field_name. The name of the Hive field. Use only alphanumeric...
Read more >
Against SQL : r/programming - Reddit
Yeah the semantics are fine, but the syntax is incredibly awkward. ... (Query parameters are not a panacea for escaping - often you...
Read more >
Query Linguistics Meta - Stack Exchange Data Explorer
... 'ecmascript-2021', 'ecs-taskdefinition', 'eddsa', 'edgedb', 'edgeengine', ... 'tracemalloc', 'trailing-newline', 'trailing-whitespace', 'trainingloss', ...
Read more >
EdgeDB: A Next-generation Graph-relational Database. - Morioh
Schema is the foundation of your application. It should be something you can read, write, and understand. Forget foreign keys; tabular data modeling...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found