Executable that will resequence ids in all tables of a postgres database built with .netcore 8.0 Cross Platform Compatible
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

41 рядки
1.2 KiB

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Threading.Tasks;
  5. namespace resequence_pgsql
  6. {
  7. public class ArgHelper
  8. {
  9. public static ArgSimple GetArgs(string[] args)
  10. {
  11. ArgSimple a = new ArgSimple();
  12. foreach (string arg in args)
  13. {
  14. string[] pcs = arg.Split(':');
  15. switch (pcs[0])
  16. {
  17. case "-ip": a.ip = pcs[1]; break;
  18. case "-u": a.un = pcs[1]; break;
  19. case "-pwd": a.pwd = pcs[1]; break;
  20. case "-lip": a.lip = pcs[1]; break;
  21. case "-p": a.port = Convert.ToInt32(pcs[1]); break;
  22. case "-db": a.db = pcs[1]; break;
  23. }
  24. }
  25. return a;
  26. }
  27. }
  28. public class ArgSimple
  29. {
  30. public string ip { get; set; } = string.Empty;
  31. public string un { get; set; } = string.Empty;
  32. public string pwd { get; set; } = string.Empty;
  33. public string lip { get; set; } = string.Empty;
  34. public int? port { get; set; } = null;
  35. public string db { get; set; } = string.Empty;
  36. }
  37. }