DataSource is an abstract class used to represent a type of data source, which can be a database, API, etc.
The CollectionManager instance for the data source, which must implement the ICollectionManager interface.
The resourceManager instance for the data source.
The ACL instance for the data source.
Constructor, creates a DataSource instance.
constructor(options: DataSourceOptions)Initialization function, called immediately after the constructor.
init(options: DataSourceOptions)get name()Returns the instance name of the data source.
Gets the middleware for the DataSource, used to mount to the Server to receive requests.
A static method called during the test connection operation. It can be used for parameter validation, and the specific logic is implemented by the subclass.
static testConnection(options?: any): Promise<boolean>async load(options: any = {})The load operation for the data source. The logic is implemented by the subclass.
abstract createCollectionManager(options?: any): ICollectionManagerCreates a CollectionManager instance for the data source. The logic is implemented by the subclass.
Creates a ResourceManager instance for the data source. Subclasses can override the implementation. By default, it creates the ResourceManager from @nocobase/resourcer.
ACL from @nocobase/acl.