You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
using Connected.Data.Schema;
|
|
|
|
|
|
|
|
|
|
namespace Connected.ServiceModel.Client.Data.Schema;
|
|
|
|
|
internal sealed class ExistingSchema : ISchema
|
|
|
|
|
{
|
|
|
|
|
public ExistingSchema()
|
|
|
|
|
{
|
|
|
|
|
Columns = new();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<ISchemaColumn> Columns { get; }
|
|
|
|
|
|
|
|
|
|
public string? Schema => null;
|
|
|
|
|
|
|
|
|
|
public string? Name { get; set; }
|
|
|
|
|
|
|
|
|
|
public string? Type { get; set; }
|
|
|
|
|
|
|
|
|
|
public bool Ignore { get; set; }
|
|
|
|
|
|
|
|
|
|
public async Task Load(SchemaExecutionContext context)
|
|
|
|
|
{
|
|
|
|
|
Name = context.Schema.Name;
|
|
|
|
|
Type = context.Schema.Type;
|
|
|
|
|
|
|
|
|
|
if (!await context.Remote.TableExists(context.Schema.Name))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
var columns = await context.Remote.QueryColumns(context.Schema.Name);
|
|
|
|
|
|
|
|
|
|
foreach (var column in columns)
|
|
|
|
|
{
|
|
|
|
|
Columns.Add(new SchemaColumn
|
|
|
|
|
{
|
|
|
|
|
Name = column.Name,
|
|
|
|
|
//TODO:populate properties
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool Equals(ISchema? other)
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
}
|