From ab7df333f7edee414007d343abd915bdba51e696 Mon Sep 17 00:00:00 2001 From: py Date: Thu, 6 Feb 2025 16:06:57 +0530 Subject: [PATCH 01/10] wip: sql server --- .../connectors/sqlserver/_category_.json | 5 + .../connectors/sqlserver/configuration.mdx | 311 ++++++++++++++++++ docs/reference/connectors/sqlserver/index.mdx | 33 ++ 3 files changed, 349 insertions(+) create mode 100644 docs/reference/connectors/sqlserver/_category_.json create mode 100644 docs/reference/connectors/sqlserver/configuration.mdx create mode 100644 docs/reference/connectors/sqlserver/index.mdx diff --git a/docs/reference/connectors/sqlserver/_category_.json b/docs/reference/connectors/sqlserver/_category_.json new file mode 100644 index 000000000..880e583ce --- /dev/null +++ b/docs/reference/connectors/sqlserver/_category_.json @@ -0,0 +1,5 @@ +{ + "label": "SQLServer", + "position": 4 + } + \ No newline at end of file diff --git a/docs/reference/connectors/sqlserver/configuration.mdx b/docs/reference/connectors/sqlserver/configuration.mdx new file mode 100644 index 000000000..e7f94b23a --- /dev/null +++ b/docs/reference/connectors/sqlserver/configuration.mdx @@ -0,0 +1,311 @@ +--- +sidebar_position: 2 +sidebar_label: Configuration +description: + "Reference documentation for the setup process for the Hasura SQL Server connector, including connection URI details, and + native queries." +keywords: + - sqlserver + - configuration +--- + +# Configuration Reference + +## Introduction + +The configuration is a metadata object that lists all the database entities — such as tables — that the data connector +has to know about in order to serve queries. It never changes during the lifetime of the data connector service +instance. When your database schema changes you will have to update the configuration accordingly, see +[updating with introspection](#updating-with-introspection). + +## Structure + +The configuration object is a JSON object with the following fields: + +```json +{ + "version": 1, + "mssql_connection_string": { + "variable": "CONNECTION_URI" + }, + "metadata": { + "tables": {}, + "nativeQueries": {}, + "nativeMutations": {}, + "aggregateFunctions": {}, + "comparisonOperators": {}, + "storedProcedures": {} + } +} +``` + +### Property: Version + +Version of the configuration file used in the project. + +### Property: MSSQL Connection String + +The `connectionUri` field indicates the uri of the database which the connector will be querying. This can be given +either as a literal value, or sourced from an environment variable (to help with sound credentials storage for +instance). + +The SQL Server database URL should follow the [MSSQL connection URI form][libpq: Connection Strings] + +**Examples:** + +```yaml +"connectionUri": "Server=localhost,port;Uid=username;Database=databasename;Pwd=password;TrustServerCertificate=true" +``` + +```yaml +"connectionUri": { "variable": "CONNECTION_URI" } +``` +## Property: Metadata + +The metadata section collects declarations of all the database entities that are known to the data connector. + +### `tables` + +The `tables` field collects all the tables and views, and the collection name that will be used for each of them. + +Consult the [json schema reference][Configuration JSON Schema] for details. + +**Example** + +```yaml +"tables": + { + "Album": // Exposed collection name + { + "schemaName": "dbo", + "tableName": "Album", // The actual name of the table in the database + "columns": + { + "AlbumId": // The exposed field name + { + "name": "AlbumId", // The actual name of the column in the table + "type": "int", + "nullable": "nonNullable", + "description": null, + }, + "ArtistId": + { + "name": "ArtistId", + "type": "int", + "nullable": "nonNullable", + "description": null, + }, + "Title": + { + "name": "Title", + "type": "nvarchar", + "nullable": "nonNullable", + "description": null, + }, + }, + "uniquenessConstraints": { "PK_Album": ["AlbumId"] }, + "foreignRelations": + { + "FK_AlbumArtistId": + { + "foreignTable": "Artist", + "columnMapping": { + // Column of this table : Column of the referenced table + "ArtistId": "ArtistId" + } + }, + }, + "description": null, + }, + } +``` + +### `nativeQueries` + + + + + + + + + + + + + + + + + +### Property: JDBC Properties + +This is a JSON object containing key-value pairs of additional properties to be passed to the JDBC driver. For example, +with MySQL to enable running multiple statements in a given query: + +```json +{ + "jdbcProperties": { "allowMultiQueries": "true" } +} +``` + +### Property: Schemas + +This is an optional array of schema names to include in the introspection process. If not provided, all schemas will be +included. + +Example: + +```json +{ + "schemas": ["public", "other_schema"] +} +``` + +### Property: Tables + +This is an array of table definitions, generated automatically during introspection. + +Example: + +```json +{ + "tableName": "Album", + "tableType": "TABLE", + "description": "", + "columns": [ + { + "name": "AlbumId", + "description": "", + "type": "int", + "numeric_scale": 0, + "nullable": false, + "auto_increment": true, + "is_primarykey": true + }, + { + "name": "Title", + "description": "", + "type": "varchar", + "numeric_scale": null, + "nullable": false, + "auto_increment": false, + "is_primarykey": false + }, + { + "name": "ArtistId", + "description": "", + "type": "int", + "numeric_scale": 0, + "nullable": false, + "auto_increment": false, + "is_primarykey": false + } + ], + "pks": ["AlbumId"], + "fks": { + "FK_AlbumArtistId": { + "foreign_collection": "Artist", + "column_mapping": { + "ArtistId": "ArtistId" + } + } + } +} +``` + +### Property: Functions + +This is an array of function definitions. + +Example: + +```json +{ + "function_catalog": "public", + "function_schema": "public", + "function_name": "add", + "argument_signature": "(N NUMBER, M NUMBER)", + "data_type": "TABLE (N NUMBER, M NUMBER)", + "comment": "Adds two numbers" +} +``` + +### Property: Native Queries + +This is a JSON object containing key-value pairs of Native Queries to be used in the data connector. + +Two types of Native Queries are supported: **Inline** and **Parameterized**. + +Example: + +```json +{ + "native_query_inline": { + "sql": { + "parts": [ + { + "type": "text", + "value": "SELECT 1 AS result FROM DUAL" + } + ] + }, + "columns": { + "result": { + "type": "named", + "name": "INT" + } + }, + "arguments": {}, + "description": "" + }, + "ArtistById_parameterized": { + "sql": { + "parts": [ + { + "type": "text", + "value": "SELECT * FROM CHINOOK.ARTIST WHERE ARTISTID = " + }, + { + "type": "parameter", + "value": "ARTISTID" + } + ] + }, + "columns": { + "ARTISTID": { + "type": "named", + "name": "INT" + }, + "NAME": { + "type": "nullable", + "underlying_type": { + "type": "named", + "name": "STRING" + } + } + }, + "arguments": { + "ARTISTID": { + "description": null, + "type": { + "type": "named", + "name": "INT" + } + } + }, + "description": null, + "isProcedure": false + } +``` + +## Updating with introspection + +Whenever the schema of your database changes you will need to update your data connector configuration accordingly to +reflect those changes. + +Running `update` in a configuration directory will do the following: + +- Connect to the database with the specified `jdbcUrl`, and then overwrite all data in the `tables` field + +- Fill in default values for any fields absent from the configuration diff --git a/docs/reference/connectors/sqlserver/index.mdx b/docs/reference/connectors/sqlserver/index.mdx new file mode 100644 index 000000000..e6ad66640 --- /dev/null +++ b/docs/reference/connectors/sqlserver/index.mdx @@ -0,0 +1,33 @@ +--- +title: SQL Server +sidebar_position: 1 +description: + "Learn how to configure the SQL Server connector and utilize native operations to extend your API's capability." +sidebar_label: SQL Server +keywords: + - sqlserver + - configuration + - connector +seoFrontMatterUpdated: false +--- + +# SQLServer + +## Introduction + +The Native Data Connector for SQL Server supports all kinds of queries and mutations. In the sections below, we'll try +to give an overview of the features of the SQL Server connector and how to configure it in a Hasura DDN project. + +:::tip Looking to get started? + +If you've ended up here and aren't concerned about tweaking your configuration, and rather are looking to get started +with SQL Server and Hasura DDN as quickly as possible, check out our +[SQL Server tutorial](https://hasura.io/connectors/sqlserver) or +[learn how to connect](/data-sources/connect-to-a-source.mdx) to a SQL Server instance. + +::: + +## SQL Server docs + +- [Connector configuration](/reference/connectors/sqlserver/configuration.mdx) +- [Native operations](/reference/connectors/sqlserver/native-operations/index.mdx) From 43805b84572769275c7a20433bc9465f7a6cca90 Mon Sep 17 00:00:00 2001 From: py Date: Thu, 6 Feb 2025 19:02:22 +0530 Subject: [PATCH 02/10] update configuration docs --- .../connectors/sqlserver/configuration.mdx | 230 +++++++++--------- 1 file changed, 118 insertions(+), 112 deletions(-) diff --git a/docs/reference/connectors/sqlserver/configuration.mdx b/docs/reference/connectors/sqlserver/configuration.mdx index e7f94b23a..2a0ec1979 100644 --- a/docs/reference/connectors/sqlserver/configuration.mdx +++ b/docs/reference/connectors/sqlserver/configuration.mdx @@ -122,121 +122,12 @@ Consult the [json schema reference][Configuration JSON Schema] for details. ### `nativeQueries` - - - - - - - - - - - - - - - - -### Property: JDBC Properties - -This is a JSON object containing key-value pairs of additional properties to be passed to the JDBC driver. For example, -with MySQL to enable running multiple statements in a given query: - -```json -{ - "jdbcProperties": { "allowMultiQueries": "true" } -} -``` - -### Property: Schemas - -This is an optional array of schema names to include in the introspection process. If not provided, all schemas will be -included. - -Example: - -```json -{ - "schemas": ["public", "other_schema"] -} -``` - -### Property: Tables - -This is an array of table definitions, generated automatically during introspection. - -Example: - -```json -{ - "tableName": "Album", - "tableType": "TABLE", - "description": "", - "columns": [ - { - "name": "AlbumId", - "description": "", - "type": "int", - "numeric_scale": 0, - "nullable": false, - "auto_increment": true, - "is_primarykey": true - }, - { - "name": "Title", - "description": "", - "type": "varchar", - "numeric_scale": null, - "nullable": false, - "auto_increment": false, - "is_primarykey": false - }, - { - "name": "ArtistId", - "description": "", - "type": "int", - "numeric_scale": 0, - "nullable": false, - "auto_increment": false, - "is_primarykey": false - } - ], - "pks": ["AlbumId"], - "fks": { - "FK_AlbumArtistId": { - "foreign_collection": "Artist", - "column_mapping": { - "ArtistId": "ArtistId" - } - } - } -} -``` - -### Property: Functions - -This is an array of function definitions. - -Example: - -```json -{ - "function_catalog": "public", - "function_schema": "public", - "function_name": "add", - "argument_signature": "(N NUMBER, M NUMBER)", - "data_type": "TABLE (N NUMBER, M NUMBER)", - "comment": "Adds two numbers" -} -``` - -### Property: Native Queries - This is a JSON object containing key-value pairs of Native Queries to be used in the data connector. Two types of Native Queries are supported: **Inline** and **Parameterized**. +TODO: check if the info is correct + Example: ```json @@ -299,6 +190,121 @@ Example: } ``` +### `nativeMutations` + +This is a JSON object containing key-value pairs of Native Mutations to be used in the data connector. + +Examle and extra info TODO + +### `aggregateFunctions` + +The `aggregateFunctions` field captures the aggregate funtions associated with the scalar types present in the data connector schema. + +The introspection process will attempt to ensure that only relevant types that actually appear in collection fields or +input argument appear in the metadata. + +**Example** + +```yaml +"aggregateFunctions": + { + "bigint": { + "APPROX_COUNT_DISTINCT": { + "returnType": "bigint" + }, + "AVG": { + "returnType": "bigint" + }, + "COUNT": { + "returnType": "int" + }, + "COUNT_BIG": { + "returnType": "bigint" + }, + "MAX": { + "returnType": "bigint" + }, + "MIN": { + "returnType": "bigint" + }, + "STDEV": { + "returnType": "float" + }, + "STDEVP": { + "returnType": "float" + }, + "SUM": { + "returnType": "bigint" + }, + "VAR": { + "returnType": "float" + }, + "VARP": { + "returnType": "float" + } + } + } +``` + +### `comparisonOperators` + +The `comparisonOperators` field captures the comparision operators associated with the scalar types present in the data connector schema. + +The introspection process will attempt to ensure that only relevant types that actually appear in collection fields or +input argument appear in the metadata. + +**Example** + +```yaml +"comparisonOperators": + { + "bigint": { + "_eq": { + "operatorName": "=", + "argumentType": "bigint", + "operatorKind": "equal" + }, + "_gt": { + "operatorName": ">", + "argumentType": "bigint", + "operatorKind": "custom" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "bigint", + "operatorKind": "custom" + }, + "_in": { + "operatorName": "IN", + "argumentType": "bigint", + "operatorKind": "in" + }, + "_lt": { + "operatorName": "<", + "argumentType": "bigint", + "operatorKind": "custom" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "bigint", + "operatorKind": "custom" + }, + "_neq": { + "operatorName": "!=", + "argumentType": "bigint", + "operatorKind": "custom" + } + } + } +``` + +A comparison operator is any function that takes two arguments and returns a `bool` value. An operator is recorded under +the scalar type declaration of its first argument. + +### `storedProcedures` + +TODO + ## Updating with introspection Whenever the schema of your database changes you will need to update your data connector configuration accordingly to @@ -306,6 +312,6 @@ reflect those changes. Running `update` in a configuration directory will do the following: -- Connect to the database with the specified `jdbcUrl`, and then overwrite all data in the `tables` field +- Connect to the database with the specified `mssql_connection_string`, and then overwrite all data in the `tables` field - Fill in default values for any fields absent from the configuration From 1cf038223cc9d8dd7c926033507ee3f630407982 Mon Sep 17 00:00:00 2001 From: py Date: Thu, 6 Feb 2025 19:04:53 +0530 Subject: [PATCH 03/10] add base directory for native operations --- .../connectors/sqlserver/native-operations/_category_.json | 4 ++++ .../connectors/sqlserver/native-operations/index.mdx | 0 2 files changed, 4 insertions(+) create mode 100644 docs/reference/connectors/sqlserver/native-operations/_category_.json create mode 100644 docs/reference/connectors/sqlserver/native-operations/index.mdx diff --git a/docs/reference/connectors/sqlserver/native-operations/_category_.json b/docs/reference/connectors/sqlserver/native-operations/_category_.json new file mode 100644 index 000000000..7e927a5b4 --- /dev/null +++ b/docs/reference/connectors/sqlserver/native-operations/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "Native Operations", + "position": 2 + } \ No newline at end of file diff --git a/docs/reference/connectors/sqlserver/native-operations/index.mdx b/docs/reference/connectors/sqlserver/native-operations/index.mdx new file mode 100644 index 000000000..e69de29bb From 0824b1c260c162f6dbfb70ea262512e3c98aa4bc Mon Sep 17 00:00:00 2001 From: py Date: Thu, 6 Feb 2025 19:12:49 +0530 Subject: [PATCH 04/10] add index page for native operations --- .../sqlserver/native-operations/index.mdx | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/docs/reference/connectors/sqlserver/native-operations/index.mdx b/docs/reference/connectors/sqlserver/native-operations/index.mdx index e69de29bb..773186280 100644 --- a/docs/reference/connectors/sqlserver/native-operations/index.mdx +++ b/docs/reference/connectors/sqlserver/native-operations/index.mdx @@ -0,0 +1,22 @@ +--- +sidebar_position: 1 +sidebar_label: Native Operations +description: + "Native Operations allow you to run custom SQL queries on your SQL Server database. This allows you to run queries + that are not supported by Hasura's GraphQL engine. This page explains how to configure various types of native queries + in Hasura." +keywords: + - native operations +seoFrontMatterUpdated: false +--- + +# Native Operations + +## Introduction + +Native Operations allow you to run custom SQL queries on your SQL Server database. This allows you to run queries that +are not supported by Hasura DDN's GraphQL engine. This unlocks the full power of your database, allowing you to run +complex queries, mutations, and even vector searches — all directly from your Hasura GraphQL API. + +## Get started + From 1ebdd4befd60f1a46f02b3fbf295c462515cdb72 Mon Sep 17 00:00:00 2001 From: py Date: Thu, 6 Feb 2025 20:07:45 +0530 Subject: [PATCH 05/10] add base for how-to-build-with-ddn docs --- docs/how-to-build-with-ddn/with-others.mdx | 2 +- docs/how-to-build-with-ddn/with-sqlserver.mdx | 13 +++++++++++++ docs/reference/connectors/sqlserver/index.mdx | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 docs/how-to-build-with-ddn/with-sqlserver.mdx diff --git a/docs/how-to-build-with-ddn/with-others.mdx b/docs/how-to-build-with-ddn/with-others.mdx index df7821985..90f4b08ed 100644 --- a/docs/how-to-build-with-ddn/with-others.mdx +++ b/docs/how-to-build-with-ddn/with-others.mdx @@ -1,5 +1,5 @@ --- -sidebar_position: 6 +sidebar_position: 8 sidebar_label: With other sources description: "Learn the basics of Hasura DDN and how to get started with other sources." keywords: diff --git a/docs/how-to-build-with-ddn/with-sqlserver.mdx b/docs/how-to-build-with-ddn/with-sqlserver.mdx new file mode 100644 index 000000000..59b1b444c --- /dev/null +++ b/docs/how-to-build-with-ddn/with-sqlserver.mdx @@ -0,0 +1,13 @@ +--- +sidebar_position: 7 +sidebar_label: With SQL Server +description: "Learn the basics of Hasura DDN and how to get started with a SQL Server database." +keywords: + - hasura ddn + - graphql api + - getting started + - guide + - sqlserver +--- + +import Prereqs from "@site/docs/_prereqs.mdx"; \ No newline at end of file diff --git a/docs/reference/connectors/sqlserver/index.mdx b/docs/reference/connectors/sqlserver/index.mdx index e6ad66640..58c0ec0f0 100644 --- a/docs/reference/connectors/sqlserver/index.mdx +++ b/docs/reference/connectors/sqlserver/index.mdx @@ -22,7 +22,7 @@ to give an overview of the features of the SQL Server connector and how to confi If you've ended up here and aren't concerned about tweaking your configuration, and rather are looking to get started with SQL Server and Hasura DDN as quickly as possible, check out our -[SQL Server tutorial](https://hasura.io/connectors/sqlserver) or +[SQL Server tutorial](/how-to-build-with-ddn/with-sqlserver.mdx) or [learn how to connect](/data-sources/connect-to-a-source.mdx) to a SQL Server instance. ::: From 912c8e193e5b0f1fe13cb9a165b4ace65144c39d Mon Sep 17 00:00:00 2001 From: py Date: Fri, 7 Feb 2025 21:18:40 +0530 Subject: [PATCH 06/10] remove native operations docs --- docs/how-to-build-with-ddn/with-sqlserver.mdx | 13 --- docs/reference/connectors/index.mdx | 1 + .../connectors/sqlserver/_category_.json | 4 +- .../connectors/sqlserver/configuration.mdx | 100 ++++++++++++++++-- docs/reference/connectors/sqlserver/index.mdx | 13 +-- .../native-operations/_category_.json | 4 - .../sqlserver/native-operations/index.mdx | 22 ---- 7 files changed, 97 insertions(+), 60 deletions(-) delete mode 100644 docs/how-to-build-with-ddn/with-sqlserver.mdx delete mode 100644 docs/reference/connectors/sqlserver/native-operations/_category_.json delete mode 100644 docs/reference/connectors/sqlserver/native-operations/index.mdx diff --git a/docs/how-to-build-with-ddn/with-sqlserver.mdx b/docs/how-to-build-with-ddn/with-sqlserver.mdx deleted file mode 100644 index 59b1b444c..000000000 --- a/docs/how-to-build-with-ddn/with-sqlserver.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -sidebar_position: 7 -sidebar_label: With SQL Server -description: "Learn the basics of Hasura DDN and how to get started with a SQL Server database." -keywords: - - hasura ddn - - graphql api - - getting started - - guide - - sqlserver ---- - -import Prereqs from "@site/docs/_prereqs.mdx"; \ No newline at end of file diff --git a/docs/reference/connectors/index.mdx b/docs/reference/connectors/index.mdx index 2cb8e3340..62d116caa 100644 --- a/docs/reference/connectors/index.mdx +++ b/docs/reference/connectors/index.mdx @@ -30,3 +30,4 @@ If you're getting started with a connector and want to connect it to your data s - [MySQL](/reference/connectors/mysql/index.mdx) - [Oracle](/reference/connectors/oracle/index.mdx) - [PostgreSQL](/reference/connectors/postgresql/index.mdx) +- [SQL Server](/reference/connectors/sqlserver/index.mdx) diff --git a/docs/reference/connectors/sqlserver/_category_.json b/docs/reference/connectors/sqlserver/_category_.json index 880e583ce..b6074c81f 100644 --- a/docs/reference/connectors/sqlserver/_category_.json +++ b/docs/reference/connectors/sqlserver/_category_.json @@ -1,5 +1,5 @@ { - "label": "SQLServer", - "position": 4 + "label": "SQL Server", + "position": 6 } \ No newline at end of file diff --git a/docs/reference/connectors/sqlserver/configuration.mdx b/docs/reference/connectors/sqlserver/configuration.mdx index 2a0ec1979..9fe7a75ff 100644 --- a/docs/reference/connectors/sqlserver/configuration.mdx +++ b/docs/reference/connectors/sqlserver/configuration.mdx @@ -49,8 +49,6 @@ The `connectionUri` field indicates the uri of the database which the connector either as a literal value, or sourced from an environment variable (to help with sound credentials storage for instance). -The SQL Server database URL should follow the [MSSQL connection URI form][libpq: Connection Strings] - **Examples:** ```yaml @@ -110,8 +108,7 @@ Consult the [json schema reference][Configuration JSON Schema] for details. { "foreignTable": "Artist", "columnMapping": { - // Column of this table : Column of the referenced table - "ArtistId": "ArtistId" + "ArtistId": "ArtistId" // Column of this table : Column of the referenced table } }, }, @@ -122,11 +119,10 @@ Consult the [json schema reference][Configuration JSON Schema] for details. ### `nativeQueries` -This is a JSON object containing key-value pairs of Native Queries to be used in the data connector. - -Two types of Native Queries are supported: **Inline** and **Parameterized**. +Native Queries collect user-specified SQL queries that that may become either queryable collections in the generated +connector schema. -TODO: check if the info is correct +This is a JSON object containing key-value pairs of Native Queries to be used in the data connector. Example: @@ -188,13 +184,54 @@ Example: "description": null, "isProcedure": false } +} ``` ### `nativeMutations` +Native Mutations collect user-specified SQL queries that that may become mutations in the generated connector schema. + This is a JSON object containing key-value pairs of Native Mutations to be used in the data connector. -Examle and extra info TODO +``` +{ + "nativeMutations": { + "insert_artist_and_return_id": { + "sql": "INSERT INTO [dbo].[Artist] (ArtistId, Name) OUTPUT inserted.* VALUES ({{ArtistId}}, {{Name}})", + "columns": { + "ArtistId": { + "name": "ArtistId", + "type": "int", + "nullable": "nonNullable", + "description": null + }, + "Name": { + "name": "Name", + "type": "varchar", + "nullable": "nullable", + "description": null, + "castAs": "varchar(100)" + } + }, + "arguments": { + "ArtistId": { + "name": "ArtistId", + "type": "int", + "nullable": "nonNullable", + "description": null + }, + "Name": { + "name": "Name", + "type": "varchar", + "nullable": "nullable", + "description": null + } + }, + "description": null + } + } +} +``` ### `aggregateFunctions` @@ -303,7 +340,50 @@ the scalar type declaration of its first argument. ### `storedProcedures` -TODO +This is a JSON object containing key-value pairs of Stored Procedures to be used in the data connector. + +Example + +``` +{ + "storedProcedures": { + "GetArtistsByName": { + "name": "GetArtistsByName", + "schema": "dbo", + "arguments": { + "Name": { + "name": "Name", + "type": "varchar", + "nullable": "nullable", + "isOutput": false, + "description": null + } + }, + "returns": { + "CustomerId": { + "name": "CustomerId", + "type": "int", + "nullable": "nonNullable", + "description": null + }, + "Phone": { + "name": "Phone", + "type": "varchar", + "nullable": "nonNullable", + "description": null + }, + "TotalPurchases": { + "name": "TotalPurchases", + "type": "int", + "nullable": "nonNullable", + "description": null + } + }, + "description": null + } + } +} +``` ## Updating with introspection diff --git a/docs/reference/connectors/sqlserver/index.mdx b/docs/reference/connectors/sqlserver/index.mdx index 58c0ec0f0..2cb952ffe 100644 --- a/docs/reference/connectors/sqlserver/index.mdx +++ b/docs/reference/connectors/sqlserver/index.mdx @@ -18,16 +18,11 @@ seoFrontMatterUpdated: false The Native Data Connector for SQL Server supports all kinds of queries and mutations. In the sections below, we'll try to give an overview of the features of the SQL Server connector and how to configure it in a Hasura DDN project. -:::tip Looking to get started? - -If you've ended up here and aren't concerned about tweaking your configuration, and rather are looking to get started -with SQL Server and Hasura DDN as quickly as possible, check out our -[SQL Server tutorial](/how-to-build-with-ddn/with-sqlserver.mdx) or -[learn how to connect](/data-sources/connect-to-a-source.mdx) to a SQL Server instance. - -::: +Hasura DDN includes a Native Data Connector for SQL Server, providing integration with SQL Server databases. This connector +allows you to leverage SQL Server’s powerful relational database capabilities while taking advantage of Hasura’s +metadata-driven approach. Here, we’ll explore the key features of the SQL Server connector and walk through the +configuration process within a Hasura DDN project. ## SQL Server docs - [Connector configuration](/reference/connectors/sqlserver/configuration.mdx) -- [Native operations](/reference/connectors/sqlserver/native-operations/index.mdx) diff --git a/docs/reference/connectors/sqlserver/native-operations/_category_.json b/docs/reference/connectors/sqlserver/native-operations/_category_.json deleted file mode 100644 index 7e927a5b4..000000000 --- a/docs/reference/connectors/sqlserver/native-operations/_category_.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "label": "Native Operations", - "position": 2 - } \ No newline at end of file diff --git a/docs/reference/connectors/sqlserver/native-operations/index.mdx b/docs/reference/connectors/sqlserver/native-operations/index.mdx deleted file mode 100644 index 773186280..000000000 --- a/docs/reference/connectors/sqlserver/native-operations/index.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -sidebar_position: 1 -sidebar_label: Native Operations -description: - "Native Operations allow you to run custom SQL queries on your SQL Server database. This allows you to run queries - that are not supported by Hasura's GraphQL engine. This page explains how to configure various types of native queries - in Hasura." -keywords: - - native operations -seoFrontMatterUpdated: false ---- - -# Native Operations - -## Introduction - -Native Operations allow you to run custom SQL queries on your SQL Server database. This allows you to run queries that -are not supported by Hasura DDN's GraphQL engine. This unlocks the full power of your database, allowing you to run -complex queries, mutations, and even vector searches — all directly from your Hasura GraphQL API. - -## Get started - From f462d5cdd0e815eb125ecb7feebcd0caaa88080e Mon Sep 17 00:00:00 2001 From: py Date: Fri, 7 Feb 2025 21:26:00 +0530 Subject: [PATCH 07/10] update sidebar position --- docs/how-to-build-with-ddn/with-others.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/how-to-build-with-ddn/with-others.mdx b/docs/how-to-build-with-ddn/with-others.mdx index 90f4b08ed..df7821985 100644 --- a/docs/how-to-build-with-ddn/with-others.mdx +++ b/docs/how-to-build-with-ddn/with-others.mdx @@ -1,5 +1,5 @@ --- -sidebar_position: 8 +sidebar_position: 6 sidebar_label: With other sources description: "Learn the basics of Hasura DDN and how to get started with other sources." keywords: From 92e741af923fa4b56bd49dabfe732e8c2c718727 Mon Sep 17 00:00:00 2001 From: Rob Dominguez Date: Fri, 7 Feb 2025 10:40:46 -0600 Subject: [PATCH 08/10] Apply suggestions from code review --- docs/reference/connectors/sqlserver/index.mdx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/docs/reference/connectors/sqlserver/index.mdx b/docs/reference/connectors/sqlserver/index.mdx index 2cb952ffe..91c72f4c2 100644 --- a/docs/reference/connectors/sqlserver/index.mdx +++ b/docs/reference/connectors/sqlserver/index.mdx @@ -11,13 +11,10 @@ keywords: seoFrontMatterUpdated: false --- -# SQLServer +# SQL Server ## Introduction -The Native Data Connector for SQL Server supports all kinds of queries and mutations. In the sections below, we'll try -to give an overview of the features of the SQL Server connector and how to configure it in a Hasura DDN project. - Hasura DDN includes a Native Data Connector for SQL Server, providing integration with SQL Server databases. This connector allows you to leverage SQL Server’s powerful relational database capabilities while taking advantage of Hasura’s metadata-driven approach. Here, we’ll explore the key features of the SQL Server connector and walk through the From aeb30bcada8e102e12e1399792acc6ba3ae8741e Mon Sep 17 00:00:00 2001 From: py Date: Mon, 10 Feb 2025 12:44:55 +0530 Subject: [PATCH 09/10] address review comments --- docs/reference/connectors/sqlserver/configuration.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference/connectors/sqlserver/configuration.mdx b/docs/reference/connectors/sqlserver/configuration.mdx index 9fe7a75ff..0efa17b4e 100644 --- a/docs/reference/connectors/sqlserver/configuration.mdx +++ b/docs/reference/connectors/sqlserver/configuration.mdx @@ -52,7 +52,7 @@ instance). **Examples:** ```yaml -"connectionUri": "Server=localhost,port;Uid=username;Database=databasename;Pwd=password;TrustServerCertificate=true" +"connectionUri": "Server=,;Uid=;Database=;Pwd=" ``` ```yaml From 15766d6a0d8b595bb557ed8cf876412d19378fff Mon Sep 17 00:00:00 2001 From: py Date: Mon, 10 Feb 2025 12:49:21 +0530 Subject: [PATCH 10/10] update sidebar position of sql server --- docs/reference/connectors/sqlserver/_category_.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference/connectors/sqlserver/_category_.json b/docs/reference/connectors/sqlserver/_category_.json index b6074c81f..a738687c7 100644 --- a/docs/reference/connectors/sqlserver/_category_.json +++ b/docs/reference/connectors/sqlserver/_category_.json @@ -1,5 +1,5 @@ { "label": "SQL Server", - "position": 6 + "position": 7 } \ No newline at end of file