QueryMatcher is an SQL query string matcher interface, which can be used to customize validation of SQL query strings. As an example, external library could be used to build and validate SQL ast, columns selected. sqlmock can be customized to implement a different QueryMatcher configured through an
| 22 | // configured through an option when sqlmock.New or sqlmock.NewWithDSN |
| 23 | // is called, default QueryMatcher is QueryMatcherRegexp. |
| 24 | type QueryMatcher interface { |
| 25 | |
| 26 | // Match expected SQL query string without whitespace to |
| 27 | // actual SQL. |
| 28 | Match(expectedSQL, actualSQL string) error |
| 29 | } |
| 30 | |
| 31 | // QueryMatcherFunc type is an adapter to allow the use of |
| 32 | // ordinary functions as QueryMatcher. If f is a function |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…