Executable that will resequence ids in all tables of a postgres database built with .netcore 8.0 Cross Platform Compatible
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

há 2 anos
há 2 anos
há 2 anos
1234567891011121314151617181920212223242526272829303132333435363738394041
  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. }