Loading sql files from another assembly
Can you add a feature to load sql files from another assembly apart from the executor assembly? For example, if I have a asp net core project and a class library named Infrastructure, I want to load sql files from Infrastructure assembly. Is this possible?
You simply don't need to do that. If you have your sql files in another library, simply create a Directory.Build.props file that takes care of copying the sql files from the infrastructure project to the main host output directory.
Here is an example: https://github.com/MrDave1999/Capture-The-Flag/commit/9d2aa1bb915d0ca15e804585c8bcfaadfe9e3e04 https://github.com/MrDave1999/Capture-The-Flag/blob/4711c27e9ef19719589725bc796d945c327d0fc9/src/Persistence/Persistence.MariaDB/ServiceCollectionExtensions.cs#L27-L29
Is there no other way other than Directory.Build.props? I am using yesql in a client project and it is not possible to add Directory.Build.props
You can also use it in a client project. You only use Directory.Build.props when compiling your client application, so your SQL files should already be copied to the output directory.