Merge branch 'master' into v2_dev
This commit is contained in:
		
						commit
						586c503a4f
					
				
							
								
								
									
										33
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										33
									
								
								README.md
									
									
									
									
									
								
							@ -2,16 +2,19 @@
 | 
			
		||||
 | 
			
		||||
The fantastic ORM library for Golang, aims to be developer friendly.
 | 
			
		||||
 | 
			
		||||
[](https://gitter.im/jinzhu/gorm?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
 | 
			
		||||
[](https://goreportcard.com/report/github.com/jinzhu/gorm)
 | 
			
		||||
[](https://app.wercker.com/project/byKey/8596cace912c9947dd9c8542ecc8cb8b)
 | 
			
		||||
[](https://gitter.im/jinzhu/gorm?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
 | 
			
		||||
[](https://opencollective.com/gorm)
 | 
			
		||||
[](https://opencollective.com/gorm)
 | 
			
		||||
[](http://opensource.org/licenses/MIT)
 | 
			
		||||
[](https://godoc.org/github.com/jinzhu/gorm)
 | 
			
		||||
 | 
			
		||||
## Overview
 | 
			
		||||
 | 
			
		||||
* Full-Featured ORM (almost)
 | 
			
		||||
* Associations (Has One, Has Many, Belongs To, Many To Many, Polymorphism)
 | 
			
		||||
* Callbacks (Before/After Create/Save/Update/Delete/Find)
 | 
			
		||||
* Hooks (Before/After Create/Save/Update/Delete/Find)
 | 
			
		||||
* Preloading (eager loading)
 | 
			
		||||
* Transactions
 | 
			
		||||
* Composite Primary Key
 | 
			
		||||
@ -24,28 +27,14 @@ The fantastic ORM library for Golang, aims to be developer friendly.
 | 
			
		||||
 | 
			
		||||
## Getting Started
 | 
			
		||||
 | 
			
		||||
* GORM Guides [jinzhu.github.com/gorm](https://jinzhu.github.io/gorm)
 | 
			
		||||
* GORM Guides [http://gorm.io](http://gorm.io)
 | 
			
		||||
 | 
			
		||||
## Upgrading To V1.0
 | 
			
		||||
## Contributing
 | 
			
		||||
 | 
			
		||||
* [CHANGELOG](https://jinzhu.github.io/gorm/changelog.html)
 | 
			
		||||
 | 
			
		||||
## Supporting the project
 | 
			
		||||
 | 
			
		||||
[](http://patreon.com/jinzhu)
 | 
			
		||||
 | 
			
		||||
## Author
 | 
			
		||||
 | 
			
		||||
**jinzhu**
 | 
			
		||||
 | 
			
		||||
* <http://github.com/jinzhu>
 | 
			
		||||
* <wosmvp@gmail.com>
 | 
			
		||||
* <http://twitter.com/zhangjinzhu>
 | 
			
		||||
 | 
			
		||||
## Contributors
 | 
			
		||||
 | 
			
		||||
https://github.com/jinzhu/gorm/graphs/contributors
 | 
			
		||||
[You can help to deliver a better GORM, check out things you can do](http://gorm.io/contribute.html)
 | 
			
		||||
 | 
			
		||||
## License
 | 
			
		||||
 | 
			
		||||
Released under the [MIT License](https://github.com/jinzhu/gorm/blob/master/License).
 | 
			
		||||
© Jinzhu, 2013~time.Now
 | 
			
		||||
 | 
			
		||||
Released under the [MIT License](https://github.com/jinzhu/gorm/blob/master/License)
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										14
									
								
								dialect.go
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								dialect.go
									
									
									
									
									
								
							@ -94,14 +94,16 @@ var ParseFieldStructForDialect = func(field *StructField, dialect Dialect) (fiel
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// Get scanner's real value
 | 
			
		||||
	var getScannerValue func(reflect.Value)
 | 
			
		||||
	getScannerValue = func(value reflect.Value) {
 | 
			
		||||
		fieldValue = value
 | 
			
		||||
		if _, isScanner := reflect.New(fieldValue.Type()).Interface().(sql.Scanner); isScanner && fieldValue.Kind() == reflect.Struct {
 | 
			
		||||
			getScannerValue(fieldValue.Field(0))
 | 
			
		||||
	if dataType == "" {
 | 
			
		||||
		var getScannerValue func(reflect.Value)
 | 
			
		||||
		getScannerValue = func(value reflect.Value) {
 | 
			
		||||
			fieldValue = value
 | 
			
		||||
			if _, isScanner := reflect.New(fieldValue.Type()).Interface().(sql.Scanner); isScanner && fieldValue.Kind() == reflect.Struct {
 | 
			
		||||
				getScannerValue(fieldValue.Field(0))
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		getScannerValue(fieldValue)
 | 
			
		||||
	}
 | 
			
		||||
	getScannerValue(fieldValue)
 | 
			
		||||
 | 
			
		||||
	// Default Size
 | 
			
		||||
	if num, ok := field.TagSettings["SIZE"]; ok {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user