mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-13 19:33:55 +03:00
feature(server): add Logical Models support for CockroachDB
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8500 GitOrigin-RevId: 0205bd207843f50ad4fa12ad6e6c07d1f2740912
This commit is contained in:
parent
26bb2b4030
commit
305eebb3ab
@ -81,7 +81,7 @@ services:
|
||||
healthcheck:
|
||||
test:
|
||||
- CMD-SHELL
|
||||
- cockroach sql --insecure < /dev/null
|
||||
- cockroach sql --insecure --execute "select 1;"
|
||||
start_period: 5s
|
||||
interval: 5s
|
||||
timeout: 10s
|
||||
|
@ -38,7 +38,7 @@ services:
|
||||
ports:
|
||||
- "65008:26257"
|
||||
environment:
|
||||
COCKROACH_USER: "root"
|
||||
COCKROACH_USER: "hasura"
|
||||
COCKROACH_DATABASE: "hasura"
|
||||
volumes:
|
||||
- cockroach-data:/cockroach/cockroach-data
|
||||
|
@ -2,6 +2,7 @@ module Test.API.Metadata.LogicalModels.ValidationSpec where
|
||||
|
||||
import Data.List.NonEmpty qualified as NE
|
||||
import Harness.Backend.Citus qualified as Citus
|
||||
import Harness.Backend.Cockroach qualified as Cockroach
|
||||
import Harness.Backend.Postgres qualified as Postgres
|
||||
import Harness.GraphqlEngine qualified as GraphqlEngine
|
||||
import Harness.Quoter.Yaml (yaml)
|
||||
@ -30,6 +31,11 @@ spec = do
|
||||
{ Fixture.setupTeardown = \(testEnv, _) ->
|
||||
[ Citus.setupTablesAction schema testEnv
|
||||
]
|
||||
},
|
||||
(Fixture.fixture $ Fixture.Backend Cockroach.backendTypeMetadata)
|
||||
{ Fixture.setupTeardown = \(testEnv, _) ->
|
||||
[ Cockroach.setupTablesAction schema testEnv
|
||||
]
|
||||
}
|
||||
]
|
||||
)
|
||||
|
@ -6,6 +6,7 @@ module Test.API.Metadata.LogicalModelsSpec (spec) where
|
||||
import Data.List.NonEmpty qualified as NE
|
||||
import Harness.Backend.BigQuery qualified as BigQuery
|
||||
import Harness.Backend.Citus qualified as Citus
|
||||
import Harness.Backend.Cockroach qualified as Cockroach
|
||||
import Harness.Backend.Postgres qualified as Postgres
|
||||
import Harness.Backend.Sqlserver qualified as Sqlserver
|
||||
import Harness.GraphqlEngine qualified as GraphqlEngine
|
||||
@ -46,6 +47,11 @@ spec = do
|
||||
[ Citus.setupTablesAction schema testEnv
|
||||
]
|
||||
},
|
||||
(Fixture.fixture $ Fixture.Backend Cockroach.backendTypeMetadata)
|
||||
{ Fixture.setupTeardown = \(testEnv, _) ->
|
||||
[ Cockroach.setupTablesAction schema testEnv
|
||||
]
|
||||
},
|
||||
(Fixture.fixture $ Fixture.Backend Sqlserver.backendTypeMetadata)
|
||||
{ Fixture.setupTeardown = \(testEnv, _) ->
|
||||
[ Sqlserver.setupTablesAction schema testEnv
|
||||
|
@ -9,6 +9,7 @@ import Data.Time.Calendar.OrdinalDate
|
||||
import Data.Time.Clock
|
||||
import Database.PG.Query qualified as PG
|
||||
import Harness.Backend.Citus qualified as Citus
|
||||
import Harness.Backend.Cockroach qualified as Cockroach
|
||||
import Harness.Backend.Postgres qualified as Postgres
|
||||
import Harness.GraphqlEngine qualified as GraphqlEngine
|
||||
import Harness.Quoter.Graphql
|
||||
@ -37,6 +38,11 @@ spec =
|
||||
[ Postgres.setupTablesAction schema testEnvironment
|
||||
]
|
||||
},
|
||||
(Fixture.fixture $ Fixture.Backend Cockroach.backendTypeMetadata)
|
||||
{ Fixture.setupTeardown = \(testEnvironment, _) ->
|
||||
[ Cockroach.setupTablesAction schema testEnvironment
|
||||
]
|
||||
},
|
||||
(Fixture.fixture $ Fixture.Backend Citus.backendTypeMetadata)
|
||||
{ Fixture.setupTeardown = \(testEnvironment, _) ->
|
||||
[ Citus.setupTablesAction schema testEnvironment
|
||||
|
@ -6,6 +6,7 @@ module Test.Queries.LogicalModels.LogicalModelsQueriesSpec (spec) where
|
||||
import Data.Aeson (Value)
|
||||
import Data.List.NonEmpty qualified as NE
|
||||
import Harness.Backend.Citus qualified as Citus
|
||||
import Harness.Backend.Cockroach qualified as Cockroach
|
||||
import Harness.Backend.Postgres qualified as Postgres
|
||||
import Harness.GraphqlEngine qualified as GraphqlEngine
|
||||
import Harness.Quoter.Graphql
|
||||
@ -34,6 +35,11 @@ spec =
|
||||
[ Postgres.setupTablesAction schema testEnvironment
|
||||
]
|
||||
},
|
||||
(Fixture.fixture $ Fixture.Backend Cockroach.backendTypeMetadata)
|
||||
{ Fixture.setupTeardown = \(testEnvironment, _) ->
|
||||
[ Cockroach.setupTablesAction schema testEnvironment
|
||||
]
|
||||
},
|
||||
(Fixture.fixture $ Fixture.Backend Citus.backendTypeMetadata)
|
||||
{ Fixture.setupTeardown = \(testEnvironment, _) ->
|
||||
[ Citus.setupTablesAction schema testEnvironment
|
||||
|
@ -9,6 +9,7 @@ import Data.Time.Calendar.OrdinalDate
|
||||
import Data.Time.Clock
|
||||
import Database.PG.Query qualified as PG
|
||||
import Harness.Backend.Citus qualified as Citus
|
||||
import Harness.Backend.Cockroach qualified as Cockroach
|
||||
import Harness.Backend.Postgres qualified as Postgres
|
||||
import Harness.GraphqlEngine qualified as GraphqlEngine
|
||||
import Harness.Quoter.Graphql
|
||||
@ -38,6 +39,11 @@ spec =
|
||||
[ Postgres.setupTablesAction schema testEnvironment
|
||||
]
|
||||
},
|
||||
(Fixture.fixture $ Fixture.Backend Cockroach.backendTypeMetadata)
|
||||
{ Fixture.setupTeardown = \(testEnvironment, _) ->
|
||||
[ Cockroach.setupTablesAction schema testEnvironment
|
||||
]
|
||||
},
|
||||
(Fixture.fixture $ Fixture.Backend Citus.backendTypeMetadata)
|
||||
{ Fixture.setupTeardown = \(testEnvironment, _) ->
|
||||
[ Citus.setupTablesAction schema testEnvironment
|
||||
|
@ -169,7 +169,7 @@ defaultCitusConnectionString =
|
||||
-- * Cockroach
|
||||
|
||||
cockroachUser :: Text
|
||||
cockroachUser = "root"
|
||||
cockroachUser = "hasura"
|
||||
|
||||
cockroachDb :: Text
|
||||
cockroachDb = "hasura"
|
||||
|
@ -61,5 +61,6 @@ instance BackendAPI ('Postgres 'Cockroach) where
|
||||
. mkAnyBackend @('Postgres 'Cockroach)
|
||||
)
|
||||
],
|
||||
connectionTemplateCommands @('Postgres 'Cockroach)
|
||||
connectionTemplateCommands @('Postgres 'Cockroach),
|
||||
logicalModelsCommands @('Postgres 'Cockroach)
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user