server/mssql: belatedly address code review feedback

GitOrigin-RevId: faf3a646fd1067f2e0ed417b97871cd5173ca02e
This commit is contained in:
Abby Sassel 2021-03-19 16:39:37 +00:00 committed by hasura-bot
parent f1183b8ae3
commit 7a75a08dfa
4 changed files with 104 additions and 86 deletions

View File

@ -849,7 +849,7 @@ fromOpExpG expression op =
IR.AMatchesFulltext _ -> refute (pure (UnsupportedOpExpG op))
-- As of March 2021, only geometry/geography casts are supported
IR.ACast _casts -> refute (pure (UnsupportedOpExpG op)) -- mkCastsExp casts
-- https://docs.microsoft.com/en-us/sql/relational-databases/spatial/spatial-data-sql-server?view=sql-server-ver15
-- https://docs.microsoft.com/en-us/sql/relational-databases/spatial/spatial-data-sql-server
IR.ASTContains _val -> refute (pure (UnsupportedOpExpG op)) -- mkGeomOpBe "ST_Contains" val
IR.ASTCrosses _val -> refute (pure (UnsupportedOpExpG op)) -- mkGeomOpBe "ST_Crosses" val
IR.ASTEquals _val -> refute (pure (UnsupportedOpExpG op)) -- mkGeomOpBe "ST_Equals" val

View File

@ -1,7 +1,5 @@
type: bulk
args:
#Author table
- type: mssql_run_sql
args:
source: mssql
@ -18,11 +16,6 @@ args:
('Author 2'),
('Author 3');
#Article table
- type: mssql_run_sql
args:
source: mssql
sql: |
CREATE TABLE article (
id int identity NOT NULL PRIMARY KEY,
title TEXT,
@ -60,21 +53,21 @@ args:
1
);
#City table
- type: mssql_run_sql
args:
source: mssql
sql: |
CREATE TABLE city (
id int identity NOT NULL PRIMARY KEY,
name TEXT NOT NULL,
country TEXT NOT NULL
name_varchar varchar(30) NOT NULL,
name_char char(11) NOT NULL,
name_nvarchar nvarchar(30) NOT NULL,
name_nchar nchar(11) NOT NULL,
name_ntext ntext NOT NULL,
country TEXT
);
INSERT INTO
city ([name], country)
city ([name], name_varchar, name_char, name_nvarchar, name_nchar, name_ntext, country)
VALUES
('Durham', 'USA'),
('New York', 'USA'),
('Framlingham', 'UK'),
('New Orleans', 'USA');
('Durham', 'Durham','Durham','Durham','Durham','Durham', 'USA'),
('New York', 'New York','New York','New York','New York','New York', 'USA'),
('Framlingham', 'Framlingham','Framlingham','Framlingham','Framlingham','Framlingham', 'UK'),
('New Orleans', 'New Orleans','New Orleans','New Orleans','New Orleans','New Orleans', 'USA');

View File

@ -1,20 +1,45 @@
description: Select cities starting with any letter A-G
description: Select cities starting with any letter A-G. Query all types listed in `MSSQL.Types.stringTypes` to confirm they work with `like`
url: /v1/graphql
status: 200
response:
data:
city:
- name: Durham
name_varchar: Durham
name_char: "Durham "
name_nvarchar: Durham
name_nchar: "Durham "
name_ntext: Durham
country: USA
- name: Framlingham
name_varchar: Framlingham
name_char: "Framlingham"
name_nvarchar: Framlingham
name_nchar: "Framlingham"
name_ntext: Framlingham
country: UK
query:
query: |
query {
city (
where: {name: {_like: "[A-G]%" }}
where: { _and:
[
{name: {_like: "[A-G]%" }}
{name_varchar: {_like: "[A-G]%"}}
{name_char: {_like: "[A-G]%"}}
{name_nvarchar: {_like: "[A-G]%"}}
{name_nchar: {_like: "[A-G]%"}}
{name_ntext: {_like: "[A-G]%"}}
]
}
) {
name
name_varchar
name_char
name_nvarchar
name_nchar
name_ntext
country
}
}