Title: Remove need for --begin-sql comments by akdor1154 · Pull Request #4 · ptweir/python-string-sql · GitHub
Open Graph Title: Remove need for --begin-sql comments by akdor1154 · Pull Request #4 · ptweir/python-string-sql
X Title: Remove need for --begin-sql comments by akdor1154 · Pull Request #4 · ptweir/python-string-sql
Description: I've been stuffing around with this for ages, and I finally think I've managed to remove the need for --begin-sql and --end-sql or ; delimiters for the syntax block. The strategy is to detect "select", "with", or "--", and just mark from there to the end of the string as SQL. This fits my usage perfectly.. unsure if it is useful for everyone (e.g. you might want to add "INSERT", etc, or you might not like this approach at all..) I've updated demo.py|png to show this in action, along with the readme: Additionally I've set the name of the matched section to meta.embedded.SQL to set the language mode to SQL - this fixes some final highlight stuff, and makes VSCode's bracket matching and comment/uncomment features work properly as well. You might want to pinch this even if you don't like the rest of this PR. One drawback is that I can't force the string to start with select|with|--; it has to just find it at any point in the string (due to the single-line-context-only property of the highlighting system). So if you have something like str = """ I'd like to go and select some nice flowers """, ^^^ sql from here it will "mis-fire". I'm not aware of any way to prevent this. Cheers Jarrad
Open Graph Description: I've been stuffing around with this for ages, and I finally think I've managed to remove the need for --begin-sql and --end-sql or ; delimiters for the syntax block. The strategy is to dete...
X Description: I've been stuffing around with this for ages, and I finally think I've managed to remove the need for --begin-sql and --end-sql or ; delimiters for the syntax block. The strategy is...
Opengraph URL: https://github.com/ptweir/python-string-sql/pull/4
X: @github
Domain: patch-diff.githubusercontent.com
| route-pattern | /:user_id/:repository/pull/:id/checks(.:format) |
| route-controller | pull_requests |
| route-action | checks |
| fetch-nonce | v2:1481d504-6e0a-b1a1-888d-833565991837 |
| current-catalog-service-hash | 87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a |
| request-id | EC14:127F38:23D5B6E:2D86A57:6975E91F |
| html-safe-nonce | b6e21be9cf0d30eca74c7db6a5505b0a9eb14a63e6b6fe6ade67d085e068dae4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQzE0OjEyN0YzODoyM0Q1QjZFOjJEODZBNTc6Njk3NUU5MUYiLCJ2aXNpdG9yX2lkIjoiMzE5MzA4MDMwODI2NTUxMTE5OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 73e5b7f44958349631301a539fa00934bc8b016144a8b6cfffde16e839f2df20 |
| hovercard-subject-tag | pull_request:592274921 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,checks,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/ptweir/python-string-sql/pull/4/checks |
| twitter:image | https://avatars.githubusercontent.com/u/6732831?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/6732831?s=400&v=4 |
| og:image:alt | I've been stuffing around with this for ages, and I finally think I've managed to remove the need for --begin-sql and --end-sql or ; delimiters for the syntax block. The strategy is to dete... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2bce766e7450b03e00b2fc5badd417927ce33a860e78cda3e4ecb9bbd1374cc6 |
| turbo-cache-control | no-preview |
| go-import | github.com/ptweir/python-string-sql git https://github.com/ptweir/python-string-sql.git |
| octolytics-dimension-user_id | 165875 |
| octolytics-dimension-user_login | ptweir |
| octolytics-dimension-repository_id | 147387233 |
| octolytics-dimension-repository_nwo | ptweir/python-string-sql |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | true |
| octolytics-dimension-repository_parent_id | 119871378 |
| octolytics-dimension-repository_parent_nwo | 0x00000001A/es6-string-html |
| octolytics-dimension-repository_network_root_id | 119871378 |
| octolytics-dimension-repository_network_root_nwo | 0x00000001A/es6-string-html |
| turbo-body-classes | logged-out env-production page-responsive full-width full-width-p-0 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | fcca2b8ef702b5f7f91427a6e920fa44446fe312 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width