You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`go-mysql-mocker(gmm)` was created to provide developers with a reliable and straightforward tool for mocking MySQL interactions in Go applications, particularly for automated testing environments. By simulating a MySQL server, `go-mysql-mocker` allows developers to conduct unit tests without the overhead of setting up a real database, thus speeding up test cycles and reducing external dependencies. This is especially useful in continuous integration (CI) environments where test reliability and speed are paramount.
11
10
12
11

@@ -24,7 +23,8 @@
24
23
25
24
## Requirements
26
25
27
-
- Go 1.20 (or later versions)
26
+
- Go 1.20 (<=v1.0.6)
27
+
- Go 1.24 (>=v1.0.7)
28
28
29
29
## Installation
30
30
@@ -41,10 +41,10 @@ go get -u github.com/hedon954/go-mysql-mocker
41
41
-`SQLFiles(files)`: Reads SQL statements from specified files and executes them to generate test data. This method is useful for initializing the database with a larger set of pre-defined SQL operations.
42
42
-`Build()`: Initializes and starts the MySQL server with all specified configurations and initializes the data. This method must be called to execute the configurations set up by the preceding methods.
43
43
44
-
45
44
## Quick Start
46
45
47
46
### prepare a data model and implement `TableName()` interface
47
+
48
48
```go
49
49
typeUserStatestruct {
50
50
UIDstring`gorm:"primaryKey;column:uid"`
@@ -57,6 +57,7 @@ func (u UserState) TableName() string {
0 commit comments