perf: RelationshipsMap with foreign schema as key

This commit is contained in:
steve-chavez
2022-05-09 21:31:19 -05:00
committed by Steve Chavez
parent d88b16e5ab
commit c60380b5fc
5 changed files with 49 additions and 41 deletions
+3 -2
View File
@@ -13,7 +13,7 @@ import qualified Data.Aeson as JSON
import qualified Data.HashMap.Strict as M
import PostgREST.DbStructure.Identifiers (FieldName,
QualifiedIdentifier)
QualifiedIdentifier, Schema)
import Protolude
@@ -53,4 +53,5 @@ data Junction = Junction
isSelfReference :: Relationship -> Bool
isSelfReference r = relTable r == relForeignTable r
type RelationshipsMap = M.HashMap QualifiedIdentifier [Relationship]
-- | Key based on the source table and the foreign table schema
type RelationshipsMap = M.HashMap (QualifiedIdentifier, Schema) [Relationship]