| 123456789101112131415161718192021222324252627282930313233343536 |
- package raw_sql_tpl
- type TableRows struct {
- Rows []TableRow
- Err error
- }
- type TableRow struct {
- Column string
- Value string
- }
- func NewTableRows() *TableRows {
- return &TableRows{
- Rows: make([]TableRow, 0),
- }
- }
- func (tableRows *TableRows) Add(column string, value any) *TableRows {
- if tableRows.Err != nil {
- return tableRows
- }
- parsedValue, err := parseValue(value)
- if err != nil {
- tableRows.Err = err
- return tableRows
- }
- tableRows.Rows = append(tableRows.Rows, TableRow{
- Column: column,
- Value: parsedValue,
- })
- return tableRows
- }
|