Skip to content
#

scalajs

Here are 558 public repositories matching this topic...

NeQuissimus
NeQuissimus commented Jan 7, 2019

I just came across the fact that a Show[Throwable] exists.

  1. It is not wired up into import Scalaz._, one needs to import scalaz.std.java.throwable._
  2. It discards the stack trace entirely.

What's going on with this? :D
Is it OK if I fix both of these (for 7.2 and 7.3)?

deusaquilus
deusaquilus commented Oct 26, 2021

The .forall pattern is a great way to create an optional filter for a field that could be defined or not:

case class Person(name: String, age: Int)
val nameOpt: Option[String] = Some("Joe")
run { query[Person].filter(p => lift(nameOpt).forall(_ == p.name)) }
// SELECT p.name, p.age FROM Person p WHERE ? IS NULL OR ? = p.name
// (i.e. when nameOpt := None then the `WHERE ? IS NULL`
izumi
indigo

Improve this page

Add a description, image, and links to the scalajs topic page so that developers can more easily learn about it.

Curate this topic

Add this topic to your repo

To associate your repository with the scalajs topic, visit your repo's landing page and select "manage topics."

Learn more