Skip to content

getTableName

getTableName(table): string

Defined in: packages/permissions/src/types.ts:131

Extracts the table name string from a Drizzle table reference, or returns a string subject as-is.

Accepts both:

  • A Drizzle table object containing the drizzle:Name symbol — the symbol is read via Reflect.get.
  • A bare string (e.g., a table-name literal like "projects") — returned unchanged so callers can use the same key for grant matching whether the subject was declared as an object or a string.

A Drizzle table object or a string subject key.

string | object

string

The table name, the input string, or "unknown" if a symbol-less object was provided.