File tree 1 file changed +13
-0
lines changed
1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -287,6 +287,19 @@ func normalizeColName(s string) string {
287
287
"-" , "_" , - 1 )
288
288
}
289
289
290
+ // ParseSQLOutput parses a string into a `SQLOutputTable` in order to facilitate
291
+ // comparisons between different results.
292
+ // This has been introduced mainly for two different reasons:
293
+ // 1. handling ordering of rows (assuming that in equality checks the order is
294
+ // not important). This could be solved also by forcing the queries to have an
295
+ // 'ORDER BY' clause.
296
+ // 2. during the replacement of the SQL cli, there was a version using our custom
297
+ // SQL cli and another using the MySQL one. In one case the headers were all
298
+ // capitalized and in the other were not. Additionally, if the header is
299
+ // composed by multiple words, the separator in one case is the space and in
300
+ // the other is the dash. Moreover, in our SQL cli the newline was '\n' while on
301
+ // MySQL is '\r\n'. This latter thing is also a minimal problem as we can simply
302
+ // replace all the newlines of the buffer.
290
303
func ParseSQLOutput (raw string ) * SQLOutputTable {
291
304
splitted := strings .Split (normalizeNewLine (raw ), "\n " )
292
305
header := false
You can’t perform that action at this time.
0 commit comments