Skip to content

Commit 33b91aa

Browse files
committed
improvement(tables): rename TTL column to Expiration
1 parent f237416 commit 33b91aa

5 files changed

Lines changed: 7 additions & 7 deletions

File tree

apps/docs/content/docs/en/tables/index.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ Every column has a type, which decides how its values are stored and validated.
2424
| **Currency** | An amount in a currency you pick per column | `$1,234.56` |
2525
| **Boolean** | `true` or `false` | `true` |
2626
| **Date** | A date | `2026-03-16` |
27-
| **TTL** | An absolute row expiration time, stored as Unix epoch seconds (seconds since January 1, 1970 UTC) | `1773671400` |
27+
| **Expiration** | An absolute row expiration time, stored as Unix epoch seconds (seconds since January 1, 1970 UTC) | `1773671400` |
2828
| **JSON** | An object or array | `{ "tier": "pro" }` |
2929
| **Select** | One of a fixed set of options, or several | `Pro` |
3030

3131
Types are enforced as you enter values, so a Number column only takes numbers.
3232

3333
A Currency column stores a plain number and renders it in the currency you choose for that column, so filters, sorts, and exports all see the amount itself. Changing a column's currency relabels it — it does not convert the amounts.
3434

35-
A table can have one TTL column. Adding it enables row expiration; rows with a non-empty TTL value become eligible for deletion after that time passes. Cleanup runs periodically, so actual row removal may happen after the TTL timestamp rather than exactly at it. Deleting the TTL column disables expiration for the table. TTL cells use the date editor, while APIs and workflows read and write integer Unix epoch seconds.
35+
A table can have one Expiration column. Adding it enables row expiration; rows with a non-empty expiration value become eligible for deletion after that time passes. Cleanup runs periodically, so actual row removal may happen after the expiration timestamp rather than exactly at it. Deleting the Expiration column disables expiration for the table. Expiration cells use the date editor, while APIs and workflows read and write integer Unix epoch seconds.
3636

3737
## Editing a table
3838

apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/column-config-sidebar/column-types.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ describe('columnTypeOptionsForTable', () => {
1717
)
1818

1919
expect(availableTtl?.disabledReason).toBeUndefined()
20-
expect(unavailableTtl?.disabledReason).toBe('Only one TTL column allowed per table')
20+
expect(unavailableTtl?.disabledReason).toBe('Only one Expiration column allowed per table')
2121
})
2222

2323
it('keeps TTL enabled while editing the existing TTL column', () => {

apps/sim/lib/table/__tests__/validation.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ describe('Validation', () => {
204204
} as TableSchema)
205205

206206
expect(result.valid).toBe(false)
207-
expect(result.errors).toContain('A table can have at most 1 TTL column')
207+
expect(result.errors).toContain('A table can have at most 1 Expiration column')
208208
})
209209

210210
it('should reject null schema', () => {

apps/sim/lib/table/column-types/ttl.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ function epochSecondsToEditable(value: unknown, timeZone?: string): string | nul
6464

6565
export const ttlColumnType: ColumnTypeDefinition = {
6666
id: 'ttl',
67-
label: 'TTL',
67+
label: 'Expiration',
6868
maxPerTable: 1,
6969
icon: TypeTtl,
7070
jsonbCast: 'numeric',

apps/sim/lib/table/columns/ttl-limit.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,13 @@ describe('TTL column mutation limit', () => {
6262
it('rejects adding a second TTL column before persistence', async () => {
6363
await expect(
6464
addTableColumn('table-1', { name: 'another_expiry', type: 'ttl' }, 'request-1')
65-
).rejects.toThrow('A table can have at most 1 TTL column')
65+
).rejects.toThrow('A table can have at most 1 Expiration column')
6666
})
6767

6868
it('rejects retyping another column to TTL before scanning cells', async () => {
6969
await expect(
7070
updateColumnType({ tableId: 'table-1', columnName: 'name', newType: 'ttl' }, 'request-1')
71-
).rejects.toThrow('A table can have at most 1 TTL column')
71+
).rejects.toThrow('A table can have at most 1 Expiration column')
7272
expect(mockTimeoutExecute).toHaveBeenCalled()
7373
})
7474
})

0 commit comments

Comments
 (0)