package callbacks

import (
	
)

func ( *gorm.DB) {
	if .Error == nil {
		BuildQuerySQL()
		if .DryRun || .Error != nil {
			return
		}

		if ,  := .Get("rows");  && .(bool) {
			.Statement.Settings.Delete("rows")
			.Statement.Dest, .Error = .Statement.ConnPool.QueryContext(.Statement.Context, .Statement.SQL.String(), .Statement.Vars...)
		} else {
			.Statement.Dest = .Statement.ConnPool.QueryRowContext(.Statement.Context, .Statement.SQL.String(), .Statement.Vars...)
		}

		.RowsAffected = -1
	}
}