AlecKazakova / sql-psi

An extendable parsing environment for sql which outputs PSI
Apache License 2.0
94 stars 27 forks source link

Multiline SQL comments are not consistently supported #236

Open maybeYouShouldBeTheLawyer opened 3 years ago

maybeYouShouldBeTheLawyer commented 3 years ago

Dialect:

SQLite

Problem Multiline SQL comments (aka, C-style comments: /*...*/) are not consistently supported.

SQLite, MySQL, and PostgreSQL each permit multiline, C-style comments.

Context in which observed Issue noticed while using Sqldelight in connection with Sqldelight Issue 2166, where inclusion of C-style comments in an .sqm migration file resulted in a parsing failure.

@AlecStrong's comment there notes that single-line SQL comments (--) should be preferred. Filing this issue in case we want to reconsider permitting multi-line comments across the board, should others assume as I did that they're fair game. (But, of course, deferring to the wisdom of the spl-psi contributors.)

By my (perhaps overly artful) phrase 'not consistently supported,' I mean in particular that C-style comments are allowed in Sqldelight's .sq files but not in its .sqm files.

I've filed this issue under sql-psi as directed by the Sqldelight issue tracker.

Build Environment SQLDelight version: 1.4.5 (pre-release) OS: Android Gradle version: 6.8.2 Kotlin version: 1.4.21 AGP Version (if applicable): 4.1.0

AlecKazakova commented 3 years ago

TIL

if sql supports them, we definitely should :+1: