Is it possible to do a coalesce with peewee?
Yep, it's possible.

e.g.:

``` python
SomeModel.select(fn.COALESCE(SomeModel.field_a, SomeModel.field_b).alias('the_value))
```
 Thanks, didn't see that in the documentation anywhere.
 It's described here:

http://docs.peewee-orm.com/en/latest/peewee/querying.html#sql-functions-subqueries-and-raw-expressions
 That doesn't actually mention coalesce only that you can _"use arbitrary SQL functions"_ but how do I know which functions are supported through PeeWee? Or do they _only_ map directly back to the database I have setup? For instance not every DB has ISNULL.

If the documentation was a little more clear either way it would be helpful. I think it would be nice to list all functions available across all databases versus what's available for individual ones. Or at least the verified working through PeeWee functions.
 Literally the third sentence:

> To use arbitrary SQL functions, use the special fn() object to construct queries:

You can call literally any function, whether it exists or not. It's just syntactic sugar, read the code to get an understanding of how it works. You can nest calls to functions, you can do whatever.

> I think it would be nice to list all functions available across all databases versus what's available for individual ones.

That's stupid. Why would I do that? Read your database documentation, no sense in duplicating it.
 > Literally the third sentence:

You and I both made reference to that passage and it doesn't address my specific statement so I'm not sure what you gain by reiterating a point we've both talked about. Regardless...

> That's stupid. Why would I do that?

So my comment already addressed the why. But if you think the suggestion is stupid I can't tell if you just ignored my 'whys' or you want other 'whys' without addressing my original ones. Regardless this doesn't sound like a productive conversation so no need to continue it.
 The word _arbitrary_ means _any_ in the sentence I referenced. Meaning there's no need to duplicate other database vendors documentation since Peewee can call literally any function. The `fn` object creates a `Function` instance that the query compiler turns into a function call in SQL. Peewee doesn't have to know any more than that.
 @KrisSiegel 

> I think it would be nice to list all functions available across all databases versus what's available for individual ones.

What about [personal functions](http://www.postgresql.org/docs/9.5/static/sql-createfunction.html)? ;-)
 FWIW I got here by googling "peewee coalesce".  I started developing using Peewee without reading the docs end-to-end, so this issue helped me. @skatenerd, interestingly, we're just exactly a month apart in using this issue to figure out how to use a `COALESCE` in Peewee.
I have 3 fields that I want to return as one field (2 of the 3 will _always_ be NULL so I only want the one with a value) but I haven't been able to find any documentation that shows a way to handle this in PeeWee. Am I missing something?
