@@ -205,6 +205,7 @@ export default (async function PgIntrospectionPlugin(
205
205
pgThrowOnMissingSchema = false ,
206
206
pgIncludeExtensionResources = false ,
207
207
pgLegacyFunctionsOnly = false ,
208
+ pgSkipInstallingWatchFixtures = false ,
208
209
}
209
210
) {
210
211
async function introspect ( ) {
@@ -593,33 +594,35 @@ export default (async function PgIntrospectionPlugin(
593
594
) ;
594
595
}
595
596
// Install the watch fixtures.
596
- const watchSqlInner = await readFile ( WATCH_FIXTURES_PATH , "utf8" ) ;
597
- const sql = `begin; ${ watchSqlInner } ; commit;` ;
598
- try {
599
- await pgClient . query ( sql ) ;
600
- } catch ( error ) {
601
- /* eslint-disable no-console */
602
- console . warn (
603
- `${ chalk . bold . yellow (
604
- "Failed to setup watch fixtures in Postgres database"
605
- ) } ️️⚠️`
606
- ) ;
607
- console . warn (
608
- chalk . yellow (
609
- "This is likely because your Postgres user is not a superuser. If the"
610
- )
611
- ) ;
612
- console . warn (
613
- chalk . yellow (
614
- "fixtures already exist, the watch functionality may still work."
615
- )
616
- ) ;
617
- console . warn (
618
- chalk . yellow ( "Enable DEBUG='graphile-build-pg' to see the error" )
619
- ) ;
620
- debug ( error ) ;
621
- /* eslint-enable no-console */
622
- await pgClient . query ( "rollback" ) ;
597
+ if ( ! pgSkipInstallingWatchFixtures ) {
598
+ const watchSqlInner = await readFile ( WATCH_FIXTURES_PATH , "utf8" ) ;
599
+ const sql = `begin; ${ watchSqlInner } ; commit;` ;
600
+ try {
601
+ await pgClient . query ( sql ) ;
602
+ } catch ( error ) {
603
+ /* eslint-disable no-console */
604
+ console . warn (
605
+ `${ chalk . bold . yellow (
606
+ "Failed to setup watch fixtures in Postgres database"
607
+ ) } ️️⚠️`
608
+ ) ;
609
+ console . warn (
610
+ chalk . yellow (
611
+ "This is likely because your Postgres user is not a superuser. If the"
612
+ )
613
+ ) ;
614
+ console . warn (
615
+ chalk . yellow (
616
+ "fixtures already exist, the watch functionality may still work."
617
+ )
618
+ ) ;
619
+ console . warn (
620
+ chalk . yellow ( "Enable DEBUG='graphile-build-pg' to see the error" )
621
+ ) ;
622
+ debug ( error ) ;
623
+ /* eslint-enable no-console */
624
+ await pgClient . query ( "rollback" ) ;
625
+ }
623
626
}
624
627
625
628
await pgClient . query ( "listen postgraphile_watch" ) ;
0 commit comments