sqlFile file path wildcards?

Does the sqlFile change type allow for wildcards for the file path? Is there an example someone can point me at?

It would be useful for executing a very large number of SQL files with exactly the same set of options.

This sounds like a good use case for includeAll:

If I had 100+ SQL files to execute, using the includeAll attribute seems to shift from creating 100+ sqlFile sections in a single changelog to creating 100+ changelog files. I don’t see the benefit in terms of complexity. Why is it easier to create 100+ changelog files than it is to create 100+ sqlFile sections in a single change log file.

I understand it may be difficult for Liquibase to determine the execution order of the SQL files, but I think that could be managed via some sort of file naming, sorting or some other mechanism. It just seems there is unnecessary complexity and tedium.

If you have 100+ SQL files the only thing you need to do is create 1 changelog with the includeAll pointing at the directory where the SQL files are located, no changes are necessary to the SQL Files themselves. The only issue is naming the 100+ SQL files so they execute in the proper sequence.

The documentation I found says the includeAll points at a folder containing change logs. I don’t see the option for the sqlFile option. I suppose I’m having difficulty with the documentation. I’ll do more research. Thank you.

Sorry, let me clarify.

I’m suggesting you convert from using sqlFile to using includeAll. IncludeAll does not required “changelog formatting” it can run “raw” SQL files. It will assign the changeset ID and Author as “RAW” and “IncludeAll”.

This may not be exactly the functionality you are looking for. Someone from Liquibase would need to address your original question about adding wildcard functionality. Hope this helps.

Thanks for clarifying. It helped and I think I have a viable plan.

1 Like