docs: function serialize(val) {
  	if (val == null) {
  		return 'NULL'
  
  	} else if (typeof val == 'string') {
  		return "'" + val.replace(/(\\)/g, '\\$1').replace(/(')/g, '\\$1') + "'";
  	
  	} else if (typeof val == 'number') {
  		if (isNaN(val)) {
  			return 'NULL';
  		} else {
  			return val.toString();
  		}
  
  	} else if ([true, false].indexOf(val) != -1) {
  		return val.toString().toUpperCase();
  
  	} else if (val instanceof Date) {
  		return "'" + makeDateStr(val) + "'";
  
  	} else {
  		throw "Unable to serialize variable of type `" + typeof val + "`!";
  	}
  }