4 ms·
> > Strings may be single quoted. Hmmm... It's super convenient that SQL uses single quotes for string literals while JSON uses double quotes. Changing that
by cryptonector 3y ago
> > Strings may be single quoted.
Hmmm... It's super convenient that SQL uses single quotes for string literals while JSON uses double quotes. Changing that is going to cause pain.
> > Strings may span multiple lines by escaping new line characters.
I really can't recommend this. Yeah it's annoying to have to write \n, but still.
- masklinn 3y ago> Hmmm... It's super convenient that SQL uses single quotes for string literals while JSON uses double quotes. Changing that is going to cause pain. Surely you're not constructing queries by concatenating JSON to text? > I really can't recommend this. Yeah it's annoying to have to write \n, but still. I can only disagree, the ability to just put newlines in a string literal in languages like rust is refreshing.
- cryptonector 3y ago> Surely you're not constructing queries by concatenating JSON to text? Of course not, but I do have code that generates SQL and which uses JSON. (And no, the code in question is not subject to SQL injection.)
- masklinn 3y agoI fail to see how this is relevant. Your code feeds JSON to SQL, that remains supported. Or your code fetches SQL-generated value from SQL, in which case as literally stated before the JSON5 listing: > JSON text generated by [JSON] routines will always be strictly conforming to the canonical definition of JSON.