Semantics of new-line escaping in edgedb
See original GitHub issueCurrently, 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:
- Created 4 years ago
- Comments:11 (11 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yeah, I withdraw my objection as well.
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.