|
| 1 | +package dto |
| 2 | + |
| 3 | +// Pure data transfer objects (no dependencies on server/backend code). |
| 4 | + |
| 5 | +// GreetDTO carries a simple greeting payload. |
| 6 | +type GreetDTO struct { |
| 7 | + Greeting string `json:"greeting"` |
| 8 | +} |
| 9 | + |
| 10 | +// ServerInfoDTO provides static server/environment information. |
| 11 | +type ServerInfoDTO struct { |
| 12 | + Name string `json:"name"` |
| 13 | + Info string `json:"info"` |
| 14 | + IsReadOnly bool `json:"is_read_only"` |
| 15 | +} |
| 16 | + |
| 17 | +// DBIdentityDTO represents the current database identity. |
| 18 | +type DBIdentityDTO struct { |
| 19 | + Identity string `json:"identity"` |
| 20 | +} |
| 21 | + |
| 22 | +// QueryResultDTO represents a query response; Rows only populated for JSON format. |
| 23 | +// Raw contains original textual result when not parsed; Warnings may include advisory messages |
| 24 | +// (e.g. URL encode slashes in hierarchical resource keys). |
| 25 | +type QueryResultDTO struct { |
| 26 | + Rows []map[string]any `json:"rows,omitempty"` |
| 27 | + RowCount int `json:"row_count"` |
| 28 | + Format string `json:"format"` |
| 29 | + Raw string `json:"raw,omitempty"` |
| 30 | + Warnings []string `json:"warnings,omitempty"` |
| 31 | +} |
| 32 | + |
| 33 | +// SimpleRowsDTO wraps a plain rows array. |
| 34 | +type SimpleRowsDTO struct { |
| 35 | + Rows []map[string]any `json:"rows"` |
| 36 | +} |
| 37 | + |
| 38 | +// SimpleTextDTO wraps a single text payload. |
| 39 | +type SimpleTextDTO struct { |
| 40 | + Text string `json:"text"` |
| 41 | +} |
0 commit comments