30 lines
803 B
C#
30 lines
803 B
C#
using DbTools.Model;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
|
|
namespace DbTools {
|
|
internal static class DatabaseExtensions {
|
|
|
|
public static string ExportSql(this Database db) {
|
|
StringBuilder sb = new StringBuilder();
|
|
foreach (var table in db.Tables.GetTables()) {
|
|
sb.AppendLine(table.FullSql());
|
|
}
|
|
return sb.ToString();
|
|
}
|
|
|
|
public static void ImportFromSqlite(this Database db) {
|
|
|
|
}
|
|
|
|
public static string[] GetAllIndexes(this Database db) {
|
|
List<string> indexes = new List<string>();
|
|
foreach (var table in db.Tables.GetTables()) {
|
|
indexes.AddRange(table.Indexes.Keys);
|
|
}
|
|
return indexes.ToArray();
|
|
}
|
|
|
|
}
|
|
}
|