 
 		case .unary(let unary, let ex):
 			newSelf = .unary(try unary.visit(visitor), try ex.visit(visitor))
+
+		case .when(let whens, else: let e):
+			newSelf = .when(try whens.map {
+				return SQLWhen(when: try $0.when.visit(visitor), then: try $0.then.visit(visitor))
+			}, else: try e?.visit(visitor))
 		}
 
 		return try visitor.visit(expression: newSelf)


		case .unary(let unary, let ex):
			return unary.sql(expression: ex.sql(dialect: dialect), dialect: dialect)
		}
	}
}

	}
}

struct SQLWhen {
	var when: SQLExpression
	var then: SQLExpression
}

enum SQLExpression {
	case literalInteger(Int)
	case literalString(String)
