-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(cmd/gf): add unit testing case generating dao/do/entity files fo…
…r sqlite in command `gen dao` (#3808)
- Loading branch information
Showing
7 changed files
with
238 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
83 changes: 83 additions & 0 deletions
83
cmd/gf/internal/cmd/testdata/gendao/generated_user_sqlite3/dao/internal/table_user.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
27 changes: 27 additions & 0 deletions
27
cmd/gf/internal/cmd/testdata/gendao/generated_user_sqlite3/dao/table_user.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// ================================================================================= | ||
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. | ||
// ================================================================================= | ||
|
||
package dao | ||
|
||
import ( | ||
"for-gendao-test/pkg/dao/internal" | ||
) | ||
|
||
// internalTableUserDao is internal type for wrapping internal DAO implements. | ||
type internalTableUserDao = *internal.TableUserDao | ||
|
||
// tableUserDao is the data access object for table table_user. | ||
// You can define custom methods on it to extend its functionality as you wish. | ||
type tableUserDao struct { | ||
internalTableUserDao | ||
} | ||
|
||
var ( | ||
// TableUser is globally public accessible object for table table_user operations. | ||
TableUser = tableUserDao{ | ||
internal.NewTableUserDao(), | ||
} | ||
) | ||
|
||
// Fill with you ideas below. |
21 changes: 21 additions & 0 deletions
21
cmd/gf/internal/cmd/testdata/gendao/generated_user_sqlite3/model/do/table_user.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
19 changes: 19 additions & 0 deletions
19
cmd/gf/internal/cmd/testdata/gendao/generated_user_sqlite3/model/entity/table_user.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
create table `%s`( | ||
id INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE, | ||
passport VARCHAR(45) NOT NULL DEFAULT passport, | ||
password VARCHAR(128) NOT NULL DEFAULT password, | ||
nickname VARCHAR(45), | ||
created_at TIMESTAMP, | ||
updated_at TIMESTAMP | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters