     // TODO: consider scale and such
     if allowsNull {
       if uType.hasPrefix("VARCHAR")        { return Optional<String>.self }
-      if uType.hasPrefix("INT")            { return Optional<Int>.self    }
+      if uType.hasPrefix("INT")            { return Optional<Int>   .self }
       if uType.hasPrefix("DOUBLE")         { return Optional<Double>.self }
-      if uType.hasPrefix("FLOAT")          { return Optional<Float>.self  }
+      if uType.hasPrefix("FLOAT")          { return Optional<Float> .self }
       if uType.hasPrefix("TEXT")           { return Optional<String>.self }
-      if uType.hasPrefix("TIMESTAMP")      { return Optional<Date>.self   }
-      if uType.hasPrefix("BLOB")           { return Optional<Data>.self   }
+      if uType.hasPrefix("TIMESTAMP")      { return Optional<Date>  .self }
+      if uType.hasPrefix("BLOB")           { return Optional<Data>  .self }
       if uType.hasPrefix("CLOB")           { return Optional<String>.self }
-      if uType.hasPrefix("BOOL")           { return Optional<Bool>.self   }
+      if uType.hasPrefix("BOOL")           { return Optional<Bool>  .self }
+      if uType.hasPrefix("BYTEA")          { return Optional<Data>  .self }
     }
     else {
       if uType.hasPrefix("VARCHAR")        { return String.self }
-      if uType.hasPrefix("INT")            { return Int.self    }
+      if uType.hasPrefix("INT")            { return Int   .self }
       if uType.hasPrefix("DOUBLE")         { return Double.self }
-      if uType.hasPrefix("FLOAT")          { return Float.self  }
+      if uType.hasPrefix("FLOAT")          { return Float .self }
       if uType.hasPrefix("TEXT")           { return String.self }
-      if uType.hasPrefix("TIMESTAMP")      { return Date.self   }
-      if uType.hasPrefix("BLOB")           { return Data.self   }
+      if uType.hasPrefix("TIMESTAMP")      { return Date  .self }
+      if uType.hasPrefix("BLOB")           { return Data  .self }
       if uType.hasPrefix("CLOB")           { return String.self }
-      if uType.hasPrefix("BOOL")           { return Bool.self   }
+      if uType.hasPrefix("BOOL")           { return Bool  .self }
+      if uType.hasPrefix("BYTEA")          { return Data  .self }
     }
     /* TBD: is there a calendar date? :-)
     if uType.hasPrefix("TIMESTAMP WITH") { return CalendarDate.self }

  {
    // Also used by ActiveRecord.reflectedEntity
    if includeConstraint {
      if swiftType == Int.self     { return "INT NOT NULL"       }
      if swiftType == String.self  { return "VARCHAR NOT NULL"   }
      if swiftType == Float.self   { return "FLOAT NOT NULL"     }
      if swiftType == Double.self  { return "DOUBLE NOT NULL"    }
      if swiftType == Data.self    { return "BLOB NOT NULL"      }
      if swiftType == Date.self    { return "TIMESTAMP NOT NULL" }
      if swiftType == Int.self     { return "INT NOT NULL"       }
      if swiftType == Bool.self    { return "BOOLEAN NOT NULL"   }
      
      if swiftType == Optional<Int>.self     { return "INT NULL"       }
      if swiftType == Optional<String>.self  { return "VARCHAR NULL"   }
      if swiftType == Optional<Float>.self   { return "FLOAT NULL"     }
      if swiftType == Optional<Double>.self  { return "DOUBLE NULL"    }
      if swiftType == Optional<Data>.self    { return "BLOB NULL"      }
      if swiftType == Optional<Date>.self    { return "TIMESTAMP NULL" }
      if swiftType == Optional<Int>.self     { return "INT NULL"       }
      if swiftType == Optional<Bool>.self    { return "BOOLEAN NULL"   }
    }
    else {
      if swiftType == Int.self     { return "INT"       }
      if swiftType == String.self  { return "VARCHAR"   }
      if swiftType == Float.self   { return "FLOAT"     }
      if swiftType == Double.self  { return "DOUBLE"    }
      if swiftType == Data.self    { return "BLOB"      }
      if swiftType == Date.self    { return "TIMESTAMP" }
      if swiftType == Int.self     { return "INT"       }
      if swiftType == Bool.self    { return "BOOLEAN"   }
      
      if swiftType == Optional<Int>.self     { return "INT"       }
      if swiftType == Optional<String>.self  { return "VARCHAR"   }
      if swiftType == Optional<Float>.self   { return "FLOAT"     }
      if swiftType == Optional<Double>.self  { return "DOUBLE"    }
      if swiftType == Optional<Data>.self    { return "BLOB"      }
      if swiftType == Optional<Date>.self    { return "TIMESTAMP" }
      if swiftType == Optional<Int>.self     { return "INT"       }
      if swiftType == Optional<Bool>.self    { return "BOOLEAN"   }
    }
    return nil
  }

//  ZeeQL3
//
//  Created by Helge Hess on 08.05.17.
//  Copyright © 2017-2019 ZeeZide GmbH. All rights reserved.
//

import struct Foundation.Date
