db.ts 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. export type DBOption = {
  2. label: string;
  3. value: DBType;
  4. disabled?: boolean;
  5. isFileDb?: boolean;
  6. icon: string;
  7. desc?: string;
  8. };
  9. export type DBType =
  10. | 'mysql'
  11. | 'duckdb'
  12. | 'sqlite'
  13. | 'mssql'
  14. | 'clickhouse'
  15. | 'oracle'
  16. | 'postgresql'
  17. | 'vertica'
  18. | 'db2'
  19. | 'access'
  20. | 'mongodb'
  21. | 'starrocks'
  22. | 'hbase'
  23. | 'redis'
  24. | 'cassandra'
  25. | 'couchbase'
  26. | (string & {});
  27. export type IChatDbSchema = {
  28. comment: string;
  29. db_host: string;
  30. db_name: string;
  31. db_path: string;
  32. db_port: number;
  33. db_pwd: string;
  34. db_type: DBType;
  35. db_user: string;
  36. };
  37. export type DbListResponse = IChatDbSchema[];
  38. export type IChatDbSupportTypeSchema = {
  39. db_type: DBType;
  40. is_file_db: boolean;
  41. };
  42. export type DbSupportTypeResponse = IChatDbSupportTypeSchema[];
  43. export type PostDbParams = Partial<DbListResponse[0] & { file_path: string }>;
  44. export type ChatFeedBackSchema = {
  45. conv_uid: string;
  46. conv_index: number;
  47. question: string;
  48. knowledge_space: string;
  49. score: number;
  50. ques_type: string;
  51. messages: string;
  52. };
  53. export type PromptProps = {
  54. id: number;
  55. chat_scene: string;
  56. sub_chat_scene: string;
  57. prompt_type: string;
  58. content: string;
  59. user_name: string;
  60. prompt_name: string;
  61. gmt_created: string;
  62. gmt_modified: string;
  63. };
  64. export type PostDbRefreshParams = {
  65. db_name: string;
  66. db_type: DBType;
  67. };