File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,12 +15,12 @@ import AdminJS from 'adminjs';
1515AdminJS .registerAdapter (Adapter );
1616```
1717
18- After registration, you should call ` Adapter.database (client, connectionOptions) ` to parse table information from running database.
18+ After registration, you should call ` Adapter.init (client, connectionOptions) ` to parse table information from running database.
1919
2020``` typescript
2121// import { Adapter } from 'adminjs-sql';
2222// ...
23- const db = await Adapter .database (' mysql2' , {
23+ const db = await Adapter .init (' mysql2' , {
2424 host: DB_HOST ,
2525 port: DB_PORT ,
2626 user: DB_USER ,
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ async function bootstrap() {
1010 const app = express ( ) ;
1111 AdminJS . registerAdapter ( Adapter ) ;
1212
13- const database = await Adapter . database ( 'mysql2' , {
13+ const database = await Adapter . init ( 'mysql2' , {
1414 host : DB_HOST ,
1515 port : DB_PORT ,
1616 user : DB_USER ,
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ import { Resource } from './Resource';
1313 */
1414export class Adapter {
1515 /**
16- * You don't need to access this property. Looking for {@link Adapter.database }?
16+ * You don't need to access this property. Looking for {@link Adapter.init }?
1717 */
1818 public static Database : any = Database ;
1919 public static Resource : any = Resource ;
@@ -25,14 +25,14 @@ export class Adapter {
2525 * @param client sql driver name.
2626 * @param connection connectionOptions.
2727 * @example
28- * const database = await Adapter.database ('mysql2', {
28+ * const database = await Adapter.init ('mysql2', {
2929 * host: DB_HOST,
3030 * user: DB_USER,
3131 * password: DB_PASSWORD,
3232 * database: DB_DATABASE,
3333 * })
3434 */
35- public static async database (
35+ public static async init (
3636 client : Client ,
3737 connection : ConnectionOptions
3838 ) : Promise < DatabaseInfo > {
You can’t perform that action at this time.
0 commit comments