-
Notifications
You must be signed in to change notification settings - Fork 0
Database Configuration
Shashank Patil edited this page Jul 26, 2026
·
1 revision
The Generic SQL API Framework uses a JSON-based configuration file to establish a connection with your database.
The database configuration is located at:
config/database.json
{
"driver": "ODBC Driver 18 for SQL Server",
"server": "localhost\\SQLEXPRESS",
"database": "AdventureWorks",
"username": "sa",
"password": "YourPassword",
"trustServerCertificate": true
}| Property | Description |
|---|---|
| driver | ODBC driver installed on the system |
| server | SQL Server instance name |
| database | Database to connect |
| username | SQL Server username |
| password | SQL Server password |
| trustServerCertificate | Trust the server certificate |
If you are using Windows Authentication:
{
"driver": "ODBC Driver 18 for SQL Server",
"server": "localhost\\SQLEXPRESS",
"database": "AdventureWorks",
"authentication": "windows"
}Example:
{
"driver": "ODBC Driver 18 for SQL Server",
"server": "192.168.1.100",
"database": "ProductionDB",
"username": "sa",
"password": "Password123"
}Recommended:
- ODBC Driver 18 for SQL Server
Also supported:
- ODBC Driver 17 for SQL Server
Use the database information endpoint to verify your configuration.
GET /api/database/info
Example response:
{
"success": true,
"server": "localhost\\SQLEXPRESS",
"database": "AdventureWorks",
"version": "Microsoft SQL Server"
}- Verify the username and password.
- Ensure SQL Server Authentication is enabled.
- Confirm the SQL Server instance name.
- Check firewall settings.
- Verify SQL Server is running.
Install the latest Microsoft ODBC Driver for SQL Server and restart your web server.
- Never commit database passwords to Git.
- Use environment variables for production deployments.
- Limit database permissions to only the required operations.
- Regularly rotate database credentials.
Now that your database is configured, continue with:
- Your First API
- JSON Request Format
- SQL Query Files
- Examples