get_source_tables API call, don't fold table names.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5837
GitOrigin-RevId: 9f785793a279c4016d8ed88374d2442019489252
This commit is contained in:
Solomon 2022-09-12 19:05:17 -07:00 committed by hasura-bot
parent 8729301ad6
commit fb3ba23a44
2 changed files with 12 additions and 14 deletions

View File

@ -40,7 +40,6 @@ import Data.Has
import Data.HashMap.Strict qualified as HM
import Data.HashMap.Strict.InsOrd qualified as InsOrdHashMap
import Data.HashMap.Strict.InsOrd qualified as OMap
import Data.List.NonEmpty qualified as NonEmpty
import Data.Text.Extended
import Data.Text.Extended qualified as Text.E
import Hasura.Backends.DataConnector.API qualified as API
@ -368,8 +367,7 @@ runGetSourceTables GetSourceTables {..} = do
$ (Servant.Client.genericClient // API._schema) (Text.E.toTxt _gstSourceName) apiConfig
let fullyQualifiedTableNames = fmap API.dtiName $ API.srTables schemaResponse
tableNames = fmap (fold . NonEmpty.intersperse "." . API.unTableName) fullyQualifiedTableNames
pure $ EncJSON.encJFromJValue tableNames
pure $ EncJSON.encJFromJValue fullyQualifiedTableNames
backend -> Error.throw500 ("Schema fetching is not supported for '" <> Text.E.toTxt backend <> "'")
--------------------------------------------------------------------------------

View File

@ -79,17 +79,17 @@ schemaInspectionTests opts = describe "Schema and Source Inspection" $ do
|]
)
[yaml|
- Artist
- Album
- Customer
- Employee
- Genre
- Invoice
- InvoiceLine
- MediaType
- Playlist
- PlaylistTrack
- Track
- - Artist
- - Album
- - Customer
- - Employee
- - Genre
- - Invoice
- - InvoiceLine
- - MediaType
- - Playlist
- - PlaylistTrack
- - Track
|]
describe "get_table_info" $ do