func recordExists(ctx context.Context, sql string) (bool, error) {
	rs, err := ctx.(sqlexec.RestrictedSQLExecutor).ExecRestrictedSQL(ctx, sql)
	if err != nil {
		return false, errors.Trace(err)
	}
	defer rs.Close()
	row, err := rs.Next()
	if err != nil {
		return false, errors.Trace(err)
	}
	return row != nil, nil
}
// Helper function to check if the sql returns any row.
Helper function to check if the sql returns any row.
// Helper function to check if the sql returns any row .
func recordExists(ctx context.Context, sql string) (bool, error) {
	rs, err := ctx.(sqlexec.RestrictedSQLExecutor).ExecRestrictedSQL(ctx, sql)
	if err != nil {
		return false, errors.Trace(err)
	}
	defer rs.Close()
	row, err := rs.Next()
	if err != nil {
		return false, errors.Trace(err)
	}
	return row != nil, nil
}
func recordExists ( ctx context . Context , sql string ) ( bool , error ) { rs , err := ctx . ( sqlexec . RestrictedSQLExecutor ) . ExecRestrictedSQL ( ctx , sql ) if err != nil { return false , errors . Trace ( err ) } defer rs . Close ( ) row , err := rs . Next ( ) if err != nil { return false , errors . Trace ( err ) } return row != nil , nil }
Helper function to check if the sql returns any row.
Helper function to check if the sql returns any row .