-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
37a4d52
commit eba1051
Showing
5 changed files
with
86 additions
and
46 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
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
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,16 @@ | ||
package gorm | ||
|
||
import ( | ||
"testing" | ||
) | ||
|
||
func TestNewDB(t *testing.T) { | ||
//NewDB("a") | ||
//NewDB("b") | ||
//NewDB("c") | ||
|
||
// only example | ||
//Gorm().GetORM().Select("id").Where("id = ?", 1).First(nil) | ||
|
||
//Gorm().Close() | ||
} |
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,20 @@ | ||
package gorm | ||
|
||
import "github.com/jinzhu/gorm" | ||
|
||
const ( | ||
defaultName = "dbDefault" | ||
) | ||
|
||
var ( | ||
// ErrRecordNotFound record not found error, happens when haven't find any matched data when looking up with a struct | ||
ErrRecordNotFound = gorm.ErrRecordNotFound | ||
// ErrInvalidSQL invalid SQL error, happens when you passed invalid SQL | ||
ErrInvalidSQL = gorm.ErrInvalidSQL | ||
// ErrInvalidTransaction invalid transaction when you are trying to `Commit` or `Rollback` | ||
ErrInvalidTransaction = gorm.ErrInvalidTransaction | ||
// ErrCantStartTransaction can't start transaction when you are trying to start one with `Begin` | ||
ErrCantStartTransaction = gorm.ErrCantStartTransaction | ||
// ErrUnaddressable unaddressable value | ||
ErrUnaddressable = gorm.ErrUnaddressable | ||
) |
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