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:Namesymbol — the symbol is read viaReflect.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.
Parameters
Section titled “Parameters”A Drizzle table object or a string subject key.
string | object
Returns
Section titled “Returns”string
The table name, the input string, or "unknown" if a symbol-less
object was provided.