-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SQL coloration for Repo.query!
#67
Comments
There's also this form result = Ecto.Adapters.SQL.query!(MyRepo, "SELECT * FROM users", []) But harder to deal with since the query is at the second position. |
You're welcome! Thanks for the suggestion! I managed to implement it. Can you check out the v3.3.0 branch (PR #68)? |
Works almost like a charm! Looking at the PR it seems like it's trying to look at popping arguments for this case: Ecto.Adapters.SQL.query!(MyRepo, "SELECT * FROM users", []) ? This doesn't seem to work. For what it's worth, we also use the aliased version SQL.query!(MyRepo, "SELECT * FROM users", []) But |
(note, i'm only pointing it out because I thought your change was trying to handle that case, if that's not the case no worries, this must be a pain to handle I guess) |
I think I solved this now. 👍 Better late than never... 😅 |
Hello! thanks for the great package.
i'm trying to add
Repo.query!
as a valid way to start an SQL fragment.By just adding it to the list like so:
It kinda works, but it looses the function coloration, i.e. becomes white:
Before:
![image](https://private-user-images.githubusercontent.com/1615426/294161862-3dd2c346-109a-4d1e-a764-ceb213a2141e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ3ODA4MjksIm5iZiI6MTcyNDc4MDUyOSwicGF0aCI6Ii8xNjE1NDI2LzI5NDE2MTg2Mi0zZGQyYzM0Ni0xMDlhLTRkMWUtYTc2NC1jZWIyMTNhMjE0MWUucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgyNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURh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les better, but what am I missing? Adding only
query!
doesn't work at all.The text was updated successfully, but these errors were encountered: