finisher_app.go Add ExecRaw Method.
it use Do no processing and execute the original sql
This commit is contained in:
		
							parent
							
								
									e5be7ba778
								
							
						
					
					
						commit
						0e25da906f
					
				@ -662,3 +662,16 @@ func (db *DB) Exec(sql string, values ...interface{}) (tx *DB) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	return tx.callbacks.Raw().Execute(tx)
 | 
						return tx.callbacks.Raw().Execute(tx)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// ExecRaw Do no processing and execute the original sql
 | 
				
			||||||
 | 
					func (db *DB) ExecRaw(sql string, values ...interface{}) (tx *DB) {
 | 
				
			||||||
 | 
						tx = db.getInstance()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						builder := strings.Builder{}
 | 
				
			||||||
 | 
						builder.WriteString(sql)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						tx.Statement.SQL = builder
 | 
				
			||||||
 | 
						tx.Statement.Vars = values
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return tx.callbacks.Raw().Execute(tx)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user