---
title: "collectColumns"
source: "https://github.com/remix-run/remix/blob/8905f3943706e1f53696ab83e70a84873cabfc90/packages/data-table/src/lib/sql-helpers.ts#L49"
---

# collectColumns

## Summary

Returns stable column order from the union of keys in the provided rows.

## Signature

```ts
function collectColumns(rows: Record<string, unknown>[]): string[]

```

## Parameters

### `rows`

Row objects to scan for keys.

## Returns

Deduplicated key list in encounter order.