diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-05-30 19:12:04 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-05-30 19:12:04 +0300 |
| commit | 9169a318121f8919e9b54cc076f63ef9a65d5b2b (patch) | |
| tree | 1dd46f263b835225a930255687583e3f2fd1e7f6 /Software/Visual_Studio/Utilities/Tango.SQLiteGenerator.CLI/Program.cs | |
| parent | cf5d8ed0f510792196e0153d9f9008cdce02d523 (diff) | |
| download | Tango-9169a318121f8919e9b54cc076f63ef9a65d5b2b.tar.gz Tango-9169a318121f8919e9b54cc076f63ef9a65d5b2b.zip | |
Implemented SQLite db on PPC.
Working on PPC.
Diffstat (limited to 'Software/Visual_Studio/Utilities/Tango.SQLiteGenerator.CLI/Program.cs')
| -rw-r--r-- | Software/Visual_Studio/Utilities/Tango.SQLiteGenerator.CLI/Program.cs | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/Software/Visual_Studio/Utilities/Tango.SQLiteGenerator.CLI/Program.cs b/Software/Visual_Studio/Utilities/Tango.SQLiteGenerator.CLI/Program.cs index 9c39eeac6..6acdc5ff5 100644 --- a/Software/Visual_Studio/Utilities/Tango.SQLiteGenerator.CLI/Program.cs +++ b/Software/Visual_Studio/Utilities/Tango.SQLiteGenerator.CLI/Program.cs @@ -12,11 +12,18 @@ using Tango.Synchronization.Conversion; namespace Tango.SQLiteGenerator.CLI { + public enum Config + { + Default, + CopyAll, + } + class Program { static void Main(string[] args) { String sqlitePath = args[0]; + Config conf = args.Length > 1 ? (Config)Enum.Parse(typeof(Config), args[1]) : Config.Default; sqlitePath = Path.GetFullPath(sqlitePath); @@ -60,14 +67,23 @@ namespace Tango.SQLiteGenerator.CLI { List<TableSchema> updated = schema.Where(x => x.TableName.ToLower() != "sysdiagrams").ToList(); - updated - .Where(table => sync_configurations.Where(config => (SyncConfiguration)config.SYNC_TYPE == SyncConfiguration.OverwriteLocal).ToList() - .Exists(config => config.TABLE_NAME == table.TableName)).ToList().ForEach(x => x.CopyData = true); + if (conf == Config.Default) + { + updated + .Where(table => sync_configurations.Where(config => (SyncConfiguration)config.SYNC_TYPE == SyncConfiguration.OverwriteLocal).ToList() + .Exists(config => config.TABLE_NAME == table.TableName)).ToList().ForEach(x => x.CopyData = true); + } + else if (conf == Config.CopyAll) + { + updated.ForEach(x => x.CopyData = true); + } return updated; }); SqlServerToSQLiteConverter converter = new SqlServerToSQLiteConverter(); + converter.GenerateForeignKeys = true; + converter.GenerateIndexes = true; converter.ConvertSqlServerToSQLiteDatabase(connectionString, sqlitePath, null, handler, selectionHandler, null, false, false); |
