renderClientSchema method
Implementation
String renderClientSchema(parseTable pt) {
String fields = pt.typeFields
.map((field) =>
"${field.name} ${DBFieldTypeTransform[field.type]} ${field.pk ? "PRIMARY KEY" : ""} ${field.autoIncrement ? "AUTOINCREMENT" : ""} ${field.required ? "not null" : ""}")
.toList()
.join(",\n");
return '''
${renderClientFunc(pt)}
${pt.typeFields.map((e) => '''
static const ${e.name}Field="${e.name}";''').toList().join("\n")}
static const table = "${pt.table}";
static const schema = \'''
create table if not exists ${pt.table} (
$fields
);
${renderClientEdgeSchema(pt)}
\''';
''';
}