client_cmd_request.go 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. package ports
  2. type AutoMigrateRequest struct {
  3. DatabaseID string
  4. TablePrefixWithSchema string
  5. Version string
  6. TableModelDescribe TableModelDescribe
  7. }
  8. // TODO 事务
  9. type InsertRequest struct {
  10. DatabaseID string
  11. TablePrefixWithSchema string
  12. Version string
  13. Keys []Key
  14. TableRow map[string]any
  15. UserID string
  16. }
  17. type InsertBatchRequest struct {
  18. DatabaseID string
  19. Items []*InsertItem
  20. }
  21. type InsertItem struct {
  22. TablePrefixWithSchema string
  23. Version string
  24. Keys []Key
  25. TableRow map[string]any
  26. UserID string
  27. }
  28. type DeleteRequest struct {
  29. DatabaseID string
  30. TablePrefixWithSchema string
  31. Version string
  32. Keys []Key
  33. UserID string
  34. }
  35. type DeleteBatchRequest struct {
  36. DatabaseID string
  37. Items []*DeleteTableItem
  38. UserID string
  39. }
  40. type DeleteTableItem struct {
  41. TablePrefixWithSchema string
  42. Version string
  43. Items []*DeleteItem
  44. }
  45. type DeleteItem struct {
  46. Keys []Key
  47. }
  48. type UpdateRequest struct {
  49. DatabaseID string
  50. TablePrefixWithSchema string
  51. Version string
  52. Keys []Key
  53. NewTableRow []map[string]any
  54. UserID string
  55. }
  56. type ReplayRequest struct {
  57. DatabaseID string
  58. TablePrefixWithSchema string
  59. Version string
  60. Keys []Key
  61. UserID string
  62. }
  63. type TableModelDescribe struct {
  64. Fields []TableModelField `json:"fields"`
  65. }
  66. type TableModelField struct {
  67. Name string `json:"name"`
  68. Tag string `json:"tag"`
  69. }