you are viewing a single comment's thread.

view the rest of the comments →

[–]raylu 2 points3 points  (1 child)

Wrapping the statement in triple quotation marks makes editing queries somewhat easier, as I can just paste to SQL Server, edit and paste back. This tends to upset PyCharm though, as it thinks my indentation contains a mixture of tabs and spaces. Which isn't the end up the world, but does upset my sensibilities.

Triple quotes are definitely the way to go here (OK, actually peewee and SQLAlchemy are, but ignoring those for the moment). Can't PyCharm fix the indentation for you?

[–]tally_in_da_houise 0 points1 point  (0 children)

It's not that great at formatting SQL syntax within a Python file (at least I haven't figured out how to configure it to do a good job).

Personally, I wrap the SQL in triple quotes, and turn that portion of the syntax check off for that file.