A NocoBase plugin that enables connecting to external Microsoft SQL Server databases as data sources.
-
Server-side Components:
MssqlExternalDataSourceclass that inherits fromDataSource- Initializes a NocoBase Database instance with the 'mssql' dialect
- Exposes
collectionManagerfor full Collection management - Controller with
testConnectionAPI endpoint
-
Client-side Components:
- React-based configuration form for MSSQL connection settings
- Support for connection testing before saving
- Fields: Host, Port, Database, Schema, Username, Password, SSL options
-
Full Integration:
- Complete Collection management capabilities
- CRUD operations compatibility within NocoBase ecosystem
- Seamless integration with NocoBase data source manager
npm install @nocobase/plugin-external-datasource-mssqlThe plugin requires the following connection parameters:
- Host: MSSQL server hostname or IP address
- Port: Server port (default: 1433)
- Database: Database name
- Schema: Database schema (default: dbo)
- Username: Database user
- Password: User password
- Encrypt: Enable SSL/TLS encryption (default: true)
- Trust Server Certificate: Trust self-signed certificates (default: true)
- Install and enable the plugin in your NocoBase application
- Navigate to the Data Sources management page
- Add a new data source and select "Microsoft SQL Server"
- Fill in the connection details
- Click "Test Connection" to verify the connection
- Save the data source configuration
- The external MSSQL database collections will be available for CRUD operations
Endpoint: POST /api/external-mssql:testConnection
Request Body:
{
"host": "localhost",
"port": 1433,
"username": "sa",
"password": "your_password",
"database": "your_database",
"schema": "dbo"
}Response:
{
"status": "success"
}# Install dependencies
npm install
# Build the plugin
npm run build
# Development mode with watch
npm run devMIT