tt_AsNullable function

dynamic tt_AsNullable(
  1. dynamic value
)

tt_AsNullable(v): empty→NULL, otherwise quoted

Implementation

dynamic tt_AsNullable(dynamic value) {
  final s = varToStr(value);
  if (s.isEmpty || value == null) return 'NULL';
  return "'${s.replaceAll("'", "''")}'";
}