src/Pure/General/sql.scala
changeset 65774 1001fb86d7f7
parent 65748 1f4a80e80c88
child 65775 123f2c0995b8
--- a/src/Pure/General/sql.scala	Mon May 08 14:30:59 2017 +0200
+++ b/src/Pure/General/sql.scala	Mon May 08 15:13:40 2017 +0200
@@ -44,8 +44,9 @@
   def enclose(s: Source): Source = "(" + s + ")"
   def enclosure(ss: Iterable[Source]): Source = ss.mkString("(", ", ", ")")
 
-  def select(columns: List[Column], distinct: Boolean = false): Source =
-    "SELECT " + (if (distinct) "DISTINCT " else "") + commas(columns.map(_.ident)) + " FROM "
+  def select(columns: List[Column] = Nil, distinct: Boolean = false): Source =
+    "SELECT " + (if (distinct) "DISTINCT " else "") +
+    (if (columns.isEmpty) "*" else commas(columns.map(_.ident))) + " FROM "
 
 
   /* types */
@@ -157,7 +158,8 @@
       "DELETE FROM " + ident +
         (if (sql == "") "" else " " + sql)
 
-    def select(select_columns: List[Column], sql: Source = "", distinct: Boolean = false): Source =
+    def select(
+        select_columns: List[Column] = Nil, sql: Source = "", distinct: Boolean = false): Source =
       SQL.select(select_columns, distinct = distinct) + ident +
         (if (sql == "") "" else " " + sql)