@auth/typeorm-adapter
適用於 Auth.js / NextAuth.js 的官方 TypeORM 适配器。
安裝
npm install @auth/typeorm-adapter typeorm
TypeORMAdapterOptions
這是 TypeORM 适配器選項的介面。
屬性
entities?
optional entities: entities;
用於建立資料庫表格的 TypeORM 實體。
實體
type Entities: typeof entities;
entities
const entities: entities = defaultEntities;
TypeORMAdapter()
TypeORMAdapter(dataSource, options?): Adapter
參數
參數 | 類型 |
---|---|
dataSource | string | DataSourceOptions |
options ? | TypeORMAdapterOptions |
返回
getManager()
getManager(options): Promise<EntityManager>
參數
參數 | 類型 |
---|---|
options | 物件 |
options.dataSource | string | DataSourceOptions |
options.entities | 實體 |
返回
Promise
<EntityManager
>