Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: compile and run should be able to --!include fixtures #217

Open
FelixZY opened this issue Jun 15, 2024 · 2 comments
Open
Labels
enhancement New feature or request

Comments

@FelixZY
Copy link
Contributor

FelixZY commented Jun 15, 2024

Summary

I set up a current.sql like this:

--!include schemas/private.sql
--!include schemas/public.sql
--!include functions/uid.sql
--!include tables/accounts.sql
--!include types/jwt_token.sql
--!include functions/authenticate.sql

I then tried running graphile-migrate compile and graphile-migrate run against it but the fixtures do not appear to be substituted in:

$ graphile-migrate --config src/db/.gmrc compile  src/db/migrations/current.sql
--!include schemas/private.sql
--!include schemas/public.sql
--!include functions/uid.sql
--!include tables/accounts.sql
--!include types/jwt_token.sql
--!include functions/authenticate.sql
$ graphile-migrate --config src/db/.gmrc run  src/db/migrations/current.sql
┌───┐
│   │
├───┤
└───┘

The fixtures are substituted in correctly when running graphile-migrate --config src/db/.gmrc commit

Steps to reproduce

See above

Expected results

The fixtures should be substituted in when using compile and run

Actual results

The fixtures are not substituted in when using compile and run

Additional context

OS: dockerized mcr.microsoft.com/devcontainers/base:bookworm running on ubuntu 20.0.4
graphile-migrate: 2.0.0-rc.2
bun: 1.1.13

Possible Solution

Support fixture substitution in compile and run

@FelixZY
Copy link
Contributor Author

FelixZY commented Jun 15, 2024

The reason I noticed this is because I prefer graphile-migrate run ./migrations/current.sql over watch as I don't want to run semi-completed statements accidentally. I also don't want to mess with my editor (vscode) to disable auto-save for a single file in my repo.

@benjie
Copy link
Member

benjie commented Jun 15, 2024

You should use graphile-migrate watch --once rather than graphile-migrate run for your use case.

@benjie benjie added enhancement New feature or request and removed 🐛 bug labels Jun 15, 2024
@benjie benjie changed the title Fixtures do not appear to resolve when using graphile-migrate compile and graphile-migrate run Feature request: compile and run should be able to --!include fixtures Jun 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants