mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-15 09:22:43 +03:00
Allow for columns without known types in MS SQL Server.
Sometimes, the `sys.types` table will not contain a type for a given column. PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10506 GitOrigin-RevId: 7407e715a75d196f1bc0408d05f00804f85cbc55
This commit is contained in:
parent
1b7f2451ca
commit
d39f30c38c
@ -95,7 +95,7 @@ data SysColumn = SysColumn
|
|||||||
scIsNullable :: Bool,
|
scIsNullable :: Bool,
|
||||||
scIsIdentity :: Bool,
|
scIsIdentity :: Bool,
|
||||||
scIsComputed :: Bool,
|
scIsComputed :: Bool,
|
||||||
scJoinedSysType :: SysType,
|
scJoinedSysType :: Maybe SysType,
|
||||||
scJoinedForeignKeyColumns :: [SysForeignKeyColumn]
|
scJoinedForeignKeyColumns :: [SysForeignKeyColumn]
|
||||||
}
|
}
|
||||||
deriving (Show, Generic)
|
deriving (Show, Generic)
|
||||||
@ -166,7 +166,7 @@ transformColumn sysCol =
|
|||||||
|
|
||||||
rciIsNullable = scIsNullable sysCol
|
rciIsNullable = scIsNullable sysCol
|
||||||
rciDescription = Nothing
|
rciDescription = Nothing
|
||||||
rciType = RawColumnTypeScalar $ parseScalarType $ styName $ scJoinedSysType sysCol
|
rciType = maybe (RawColumnTypeScalar (UnknownType (tshow (scUserTypeId sysCol)))) (RawColumnTypeScalar . parseScalarType . styName) $ scJoinedSysType sysCol
|
||||||
foreignKeys =
|
foreignKeys =
|
||||||
scJoinedForeignKeyColumns sysCol <&> \foreignKeyColumn ->
|
scJoinedForeignKeyColumns sysCol <&> \foreignKeyColumn ->
|
||||||
let _fkConstraint = Constraint (ConstraintName "fk_mssql") $ OID $ sfkcConstraintObjectId foreignKeyColumn
|
let _fkConstraint = Constraint (ConstraintName "fk_mssql") $ OID $ sfkcConstraintObjectId foreignKeyColumn
|
||||||
|
Loading…
Reference in New Issue
Block a user