Skip to content
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

with-columns should have escape hatch for capitalization #430

Closed
seancorfield opened this issue Sep 12, 2022 · 2 comments
Closed

with-columns should have escape hatch for capitalization #430

seancorfield opened this issue Sep 12, 2022 · 2 comments
Assignees
Labels
documentation I need to write something up!

Comments

@seancorfield
Copy link
Owner

The current logic -- that always capitalizes all but the first expression in a column spec -- is somewhat problematic and has no way to specify a literal type that should not be capitalized (see #428 for examples).

The sql-kw function allows for keywords that start with ' to be passed through exactly as-is which supports function usage (and a few other things) but format-var does not support that. Perhaps it should?

@seancorfield
Copy link
Owner Author

In addition to format-var needing to support that escape hatch, with-columns itself needs to be adjusted so it doesn't then reformat such an expression, removing the (upper-case) call in some as yet unspecified situations.

@seancorfield
Copy link
Owner Author

seancorfield commented Sep 12, 2022

Example:

user=> (-> (with-columns [:foo :'String] [:bar :int :'Not :quite :'Null :here]) (sql/format))
["(foo String, bar INT Not QUITE Null HERE)"]
user=>

I need to decide whether/where to document this since I think I deliberately left it undocumented when 2.2.868 was released.

@seancorfield seancorfield added documentation I need to write something up! and removed enhancement needs analysis I need to think about this! labels Sep 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation I need to write something up!
Projects
None yet
Development

No branches or pull requests

1 participant