question on dub and postgresql

Steven Schveighoffer schveiguy at
Tue Oct 6 00:02:40 UTC 2020

On 10/5/20 6:01 AM, Alaindevos wrote:
> On Monday, 5 October 2020 at 09:24:33 UTC, Mike Parker wrote:
>> On Monday, 5 October 2020 at 09:05:16 UTC, Alaindevos wrote:
>>> [...]
>> You don't need to install dpq2 if you are using dub to build your 
>> project. Add it as a dependency to your dub.json (or dub.sdl if you 
>> prefer that format). When you build your project, dub will download 
>> the version you configured as your dependency and compile it along 
>> with your project.
>> [...]
> Thanks for this clear explanation. I'll try first using the dub tooling.
> PS : Manual does not look easy with different versions in the 
> /home/myhome/.dub/packages directory.

dub will automatically download any version that is used as a 
dependency. You don't have to worry about it.

So let's say one project depends on version 2.0.0 of a package, and 
another depends on 1.0.0. Both will be downloaded, compiled, and used as 
the appropriate dependency that the project requests.

Compare to a build system where you need to install the dependencies 
manually, now you have to install the right one to get the right version.

However, keep in mind that dub only deals with D packages, not external 
dependencies (like libpq, which is required for dpq2).


More information about the Digitalmars-d-learn mailing list