[postmodern-devel] S-SQL extension :if=
Hi All, If anyone's interested in using it, I made a little S-SQL extension (def-sql-op :=if (a b) `(,@(case a (:null (sql-expand `(:is-null ,b))) (nil (sql-expand t)) (otherwise (sql-expand `(:= ,a ,b)))))) I find it convenient when writing queries that take optional parameters where if the parameter is not specified, you want to return the row regardless of what value b takes. Does anyone else write little extensions like these? Should we collect them in a contrib? -- Andy Chambers Software Engineer (e) achambers@mcna.net (t) 954-682-0573 CONFIDENTIALITY NOTICE: This electronic mail may contain information that is privileged, confidential, and/or otherwise protected from disclosure to anyone other than its intended recipient(s). Any dissemination or use of this electronic mail or its contents by persons other than the intended recipient(s) is strictly prohibited. If you have received this communication in error, please notify the sender immediately by reply e-mail so that we may correct our internal records. Please then delete the original message. Thank you.
Hi Andy, If you want, you can create a wiki page on the Postmodern github wiki [1] for people to collect such snippets. There's not no huge community around Postmodern, so I'm not sure how much of a market there is for sharing snipptets, but it can't hurt to preserve them somewhere. [1]: https://github.com/marijnh/postmodern/wiki Best, Marijn
participants (2)
-
Andy Chambers
-
Marijn Haverbeke