With this connector, Hasura allows you to instantly create a real-time GraphQL API on top of your data models in Microsoft SQL Server. This connector supports SQL Server's functionalities listed in the table below, allowing for efficient and scalable data operations. Additionally, users benefit from all the powerful features of Hasura’s Data Delivery Network (DDN) platform, including query pushdown capabilities that delegate query operations to the database, thereby enhancing query optimization and performance.
This connector is built using the Rust Data Connector SDK and implements the Data Connector Spec.
Below, you'll find a matrix of all supported features for the SQL Server connector:
Feature | Supported | Notes |
---|---|---|
Native Queries + Logical Models | ✅ | |
Simple Object Query | ✅ | |
Filter / Search | ✅ | |
Simple Aggregation | ✅ | |
Sort | ✅ | |
Paginate | ✅ | |
Table Relationships | ✅ | |
Views | ✅ | |
Remote Relationships | ✅ | |
Custom Fields | ❌ | |
Mutations | ❌ | |
Distinct | ✅ | |
Enums | ❌ | |
Naming Conventions | ❌ | |
Default Values | ❌ | |
User-defined Functions | ❌ |
- Create a Hasura Cloud account
- Install the CLI
- Install the Hasura VS Code extension
- Create a project
To use the SQL Server connector, follow these steps in a Hasura project:
-
Add the connector:
ddn add connector-manifest sqlserver_connector --subgraph app --hub-connector hasura/sqlserver --type cloud
In the snippet above, we've used the subgraph
app
as it's available by default; however, you can change this value to match any subgraph which you've created in your project. -
Add your connection URI:
Open your project in your text editor and open the
/app/sqlserver_connector/connector/sqlserver_connector.build.hml
file of your project. Then, add theCONNECTION_URI
environment variable with the connection string:# other configuration above CONNECTION_URI: value: "<YOUR_CONNECTION_URI>"
-
Update the connector manifest and the connector link
These two steps will (1) allow Hasura to introspect your data source and complete the configuration and (2) deploy the connector to Hasura DDN:
ddn update connector-manifest sqlserver_connector
ddn update data-connector-link sqlserver_connector --add-all-resources
--add-all-resources
flag adds all the models and commands present in the database to the connector metadata. -
Create a build
ddn build supergraph-manifest
This will return information about the build:
Build Version bd96bb221a API URL https://<PROJECT_NAME>-bd96bb221a.ddn.hasura.app/graphql Console URL https://console.hasura.io/project/<PROJECT_NAME>/environment/default/build/bd96bb221a/graphql Project Name <PROJECT_NAME> Description Follow the project configuration build guide to apply other actions on the build.
-
Test the API
The console URL in the build information cna be used to open the GraphiQL console to test out the API
We're happy to receive any contributions from the community. Please refer to our development guide.
The Hasura SQL Server connector is available under the Apache License 2.0.