-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
k/bugSomething isn't workingSomething isn't working
Description
Version Information
Server Version:
CLI Version (for CLI related issue): v2.4.0-beta.1
Environment
Docker: hasura/graphql-engine:v2.2.0
What is the expected behaviour?
I added an extisting MSSQL Server Database to Hasura. This Database contains a table named Article:
CREATE TABLE [dbo].[Article](
[Customer UUID] [uniqueidentifier] NOT NULL,
[Number] [int] NOT NULL,
[Name] [nvarchar](max) NULL,
[Comparison Article] [int] NULL,
[ABC-Category] [nchar](1) NULL,
[Shelf Life] [int] NULL,
[Article Group] [int] NULL,
[Is Forecast Article] [bit] NOT NULL,
[Cooling Type] [nvarchar](6) NULL,
CONSTRAINT [PK_Article] PRIMARY KEY CLUSTERED
(
[Customer UUID] ASC,
[Number] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GOThe table is tracked within hasura resulting in the following metadata:
table:
name: Article
schema: dbo
configuration:
custom_column_names:
ABC-Category: ABC_Category
Article Group: Article_Group
Comparison Article: Comparison_Article
Cooling Type: Cooling_Type
Customer UUID: Customer_UUID
Is Forecast Article: Is_Forecast_Article
Shelf Life: Shelf_Life
custom_root_fields: {}
I expect to be able to run this migration:
mutation MyMutation {
insert_Article(objects: {Is_Forecast_Article: false, Customer_UUID: "1", Number: 12}) {
returning {
Customer_UUID
}
}
}Keywords
- custom_column_names
- invalid characters in this identifier
- underscores
What is the current behaviour?
It seams that the custom_column_names are not applied "backwards", resulting in the following error:
{
"errors": [
{
"extensions": {
"internal": {
"exception": {
"tag": "unsuccessful_return_code",
"contents": [
"odbc_SQLExecDirectW",
-1,
"[Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Invalid column name 'Cooling_Type'."
]
},
"query": "SELECT [Cooling_Type], [ABC_Category], [Comparison_Article], [Article_Group], [Name], [Shelf_Life], [Is_Forecast_Article], [Number], [Customer_UUID] INTO #inserted FROM [dbo].[Article] WHERE (1<>1) UNION ALL SELECT [Cooling_Type], [ABC_Category], [Comparison_Article], [Article_Group], [Name], [Shelf_Life], [Is_Forecast_Article], [Number], [Customer_UUID] FROM [dbo].[Article] WHERE (1<>1)"
},
"path": "$",
"code": "unexpected"
},
"message": "database query error"
}
]
}
How to reproduce the issue?
- add the table as described before
- track table
- run graphql mutation in GraphiQL
Screenshots or Screencast
Please provide any traces or logs that could help here.
What kind of logs could I provide?
Any possible solutions?
If the bug is confirmed, would you be willing to submit a PR?
Yes, I would like to help fix this bug.
Metadata
Metadata
Assignees
Labels
k/bugSomething isn't workingSomething isn't working