| 123456789101112131415161718192021222324252627282930313233343536 |
- package 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, opts ...AfterParsedStrValueOption) *TableRows {
- if tableRows.err != nil {
- return tableRows
- }
- parsedValue, err := parseValue(value, opts...)
- if err != nil {
- tableRows.err = err
- return tableRows
- }
- tableRows.Rows = append(tableRows.Rows, TableRow{
- Column: column,
- Value: parsedValue,
- })
- return tableRows
- }
|