internal IDictionary <string, object> ExecuteSingletonQuery(string sql, params object[] values) { using (var connection = _adapter.CreateConnection()) { using (var command = CommandHelper.Create(connection, sql, values.ToArray())) { try { connection.Open(); using (var reader = command.ExecuteReader()) { if (reader.Read()) { return(reader.ToDictionary()); } } } catch (DbException ex) { throw new AdoAdapterException(ex.Message, command); } } } return(null); }
private IEnumerable <IDictionary <string, object> > ExecuteQuery(string sql, params object[] values) { var connection = _adapter.CreateConnection(); var command = CommandHelper.Create(connection, sql, values); return(command.ToAsyncEnumerable()); }
internal int Execute(string sql, params object[] values) { using (var connection = _adapter.CreateConnection()) { using (var command = CommandHelper.Create(connection, sql, values.ToArray())) { return(TryExecute(connection, command)); } } }