Download admin-bro/src/backend/adapters/database/base-database.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.25 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/f5071caa249115f3b590492f1c8eb471e02aae4b/admin-bro/src/backend/adapters/database/base-database.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@f5071caa249115f3b590492f1c8eb471e02aae4b/admin-bro/src/backend/adapters/database/base-database.ts
-
curl -L -o base-database.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/f5071caa249115f3b590492f1c8eb471e02aae4b/admin-bro/src/backend/adapters/database/base-database.ts
1.25 kB
| /* eslint-disable no-useless-constructor */ | |
| /* eslint-disable @typescript-eslint/no-unused-vars */ | |
| /* eslint-disable @typescript-eslint/no-empty-function */ | |
| /* eslint class-methods-use-this: 0 no-unused-vars: 0 */ | |
| import BaseResource from '../resource/base-resource.js' | |
| import NotImplementedError from '../../utils/errors/not-implemented-error.js' | |
| /** | |
| * Representation of an ORM database in AdminJS | |
| * @category Base | |
| * | |
| * @mermaid | |
| * graph LR | |
| * A[BaseDatabase] -->|has many| B(BaseResource) | |
| * B --> |has many|C(BaseRecord) | |
| * B --> |has many|D(BaseProperty) | |
| */ | |
| class BaseDatabase { | |
| constructor(database: any) {} | |
| /** | |
| * Checks if given adapter supports database provided by user | |
| * | |
| * @param {any} database database provided in AdminJSOptions#databases array | |
| * @return {Boolean} if given adapter supports this database - returns true | |
| */ | |
| static isAdapterFor(database: any): boolean { | |
| throw new NotImplementedError('BaseDatabase.isAdapterFor') | |
| } | |
| /** | |
| * returns array of all resources (collections/tables) in the database | |
| * | |
| * @return {BaseResource[]} | |
| */ | |
| resources(): Array<BaseResource> { | |
| throw new NotImplementedError('BaseDatabase#resources') | |
| } | |
| } | |
| export default BaseDatabase | |