refactor: move schemaCacheDescription to SqlFragment

This doesn't belong in the schema cache module, as
it's unused there. It's only used on Query.hs.
This commit is contained in:
steve-chavez
2025-09-04 09:35:33 -05:00
committed by Steve Chavez
parent 96d2b69af4
commit 1ace298a1a
3 changed files with 20 additions and 13 deletions
-7
View File
@@ -23,7 +23,6 @@ module PostgREST.SchemaCache
, querySchemaCache
, accessibleTables
, accessibleFuncs
, schemaDescription
, showSummary
) where
@@ -475,12 +474,6 @@ funcsSqlQuery = encodeUtf8 [trimming|
AND prokind = 'f'
AND p.pronamespace = ANY($$1::regnamespace[]) |]
schemaDescription :: Bool -> SQL.Statement Schema (Maybe Text)
schemaDescription =
SQL.Statement sql (param HE.text) (join <$> HD.rowMaybe (nullableColumn HD.text))
where
sql = "SELECT pg_catalog.obj_description($1::regnamespace, 'pg_namespace')"
accessibleTables :: Bool -> SQL.Statement [Schema] AccessSet
accessibleTables =
SQL.Statement sql params decodeAccessibleIdentifiers