Find: order by primary key by default
This commit is contained in:
		
							parent
							
								
									dda88dd08c
								
							
						
					
					
						commit
						7afe504a13
					
				
							
								
								
									
										3
									
								
								main.go
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								main.go
									
									
									
									
									
								
							@ -253,7 +253,8 @@ func (s *DB) Last(out interface{}, where ...interface{}) *DB {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// Find find records that match given conditions
 | 
					// Find find records that match given conditions
 | 
				
			||||||
func (s *DB) Find(out interface{}, where ...interface{}) *DB {
 | 
					func (s *DB) Find(out interface{}, where ...interface{}) *DB {
 | 
				
			||||||
	return s.clone().NewScope(out).inlineCondition(where...).callCallbacks(s.parent.callbacks.queries).db
 | 
						newScope := s.clone().NewScope(out)
 | 
				
			||||||
 | 
						return newScope.Set("gorm:order_by_primary_key", "ASC").inlineCondition(where...).callCallbacks(s.parent.callbacks.queries).db
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Scan scan value to a struct
 | 
					// Scan scan value to a struct
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user