describe method

String describe({
  1. String spacer = "",
  2. bool isPrint = true,
})

print a description of the schema

Implementation

String describe({String spacer = "", bool isPrint = true}) {
  final lines = <String>[
    "${spacer}Column $name:",
    "$spacer - Type: $type",
    "$spacer - Unique: $unique",
    "$spacer - Nullable: $nullable",
    "$spacer - Default value: $defaultValue",
    "$spacer - Is foreign key: $isForeignKey",
    "$spacer - Reference: $reference",
    "$spacer - On delete: $onDelete",
  ];
  var s = "";
  switch (isPrint) {
    case false:
      s = lines.join("\n");
      break;
    default:
      print(lines.join("\n"));
  }
  return s;
}