Skip to content

SqlNameOf

SqlNameOf<T> = T extends TableWithSqlName ? T["_"]["name"] extends string ? T["_"]["name"] : never : never

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

Extracts the SQL table name literal from a Drizzle table reference, or never when the argument is not a Drizzle table with a _.name field.

T

const postVersions = sqliteTable("post_versions", { ... });
type N = SqlNameOf<typeof postVersions>; // "post_versions"