© 2026 Hedgehog Software, LLC
field
table
Type 'Field' cannot be used to index type 'TTable'
type GetColumnKeys<TTable extends Table> = keyof { [K in keyof TTable as K extends keyof TTable['_']['columns'] ? K : never]: true } async function getOptions< TTable extends Table, Field extends GetColumnKeys<TTable> >(table: TTable, field: Field) { const column = table[field] const result = await drizzleDb .selectDistinct({ option: column }) .from(table) .orderBy(column) return result.map((i) => String(i.option)) }