SQL Server Connector
Note: ADO.NET is the supported connection string format for SQL Server for ndc-sqlserver in DDN. You can find the documentation for ADO.NET SQL Server connection strings here. This is a change from Hasura version 2, where ODBC connection strings were supported.
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.
Features
Below, you'll find a matrix of all supported features for the SQL Server connector:
Feature | Supported | Notes |
---|---|---|
Native Queries + Logical Models | ✅ | |
Native Mutations | ✅ | |
Simple Object Query | ✅ | |
Filter / Search | ✅ | |
Simple Aggregation | ✅ | The limit parameter does not work as expected when combined with aggregate functions. Currently, any limit value set in these cases will be disregarded. |
Sort | ✅ | |
Paginate | ✅ | |
Table Relationships | ✅ | |
Views | ✅ | |
Remote Relationships | ✅ | |
Stored Procedures | ✅ | |
Custom Fields | ❌ | |
Mutations | ❌ | Only native mutations are suppported |
Distinct | ✅ | |
Enums | ❌ | |
Naming Conventions | ❌ | |
Default Values | ❌ | |
User-defined Functions | ❌ |
Prerequisites
- Create a Hasura Cloud account
- Please ensure you have the DDN CLI and Docker installed
- Create a supergraph
The steps below explain how to initialize and configure a connector on your local machine (typically for development purposes).You can learn how to deploy a connector to Hasura DDN — after it's been configured — here.
Using the SQLServer connector
With the context set for an existing subgraph, initialize the connector:
ddn connector init -i
Note: The
CONNECTION_URI
is the connection string of the SQL Server database. You can find the documentation for ADO.NET SQL Server connection string formats here.
When the wizard runs, you'll be prompted to enter the following env vars necessary for your connector to function:
Name | Description | Required | Default |
---|---|---|---|
CONNECTION_URI | The connection string of the SQL Server database | Yes | N/A |
After the CLI initializes the connector, you'll need to:
- Introspect the source.
- Add your models, commands, and relationships.
- Create a new build.
- Test it by running your project along with the connector.
Documentation
View the full documentation for the ndc-sqlserver connector here.
Contributing
We're happy to receive any contributions from the community. Please refer to our development guide.
License
The Hasura SQL Server connector is available under the Apache License 2.0.