This is a step by step guide to getting started with LibPQ, an illustrated version of "Installation and usage" section of the official documentation.

Installation

LibPQ source code

The source code of the library has to be present in each workbook that uses it.

Main module of LibPQ

Specifying modules location

After the previous step LibPQ doesn't know yet where it should get the modules' source code from. You can specify an unlimited number of local and web locations where the modules are saved:

LibPQ-Path

LibPQ will search for your modules first in local directories (in order they are listed), then in web locations. If the module is found, no further locations are checked.

It helps with the name collisions:

Reusable template

It is not necessary to repeat the installation steps every time you want to use LibPQ. You can add LibPQ to an empty workbook and save is as a template for future use.

Usage

Importing existing module

Import any available module with LibPQ("ModuleName") when writing your queries in Advanced editor. LibPQ will search for the file named ModuleName.pq in all locations that you've listed in LibPQPath. If the module is found, its source code will be evaluated and the result will be returned.

For example, let's import Date.Parse from standard LibPQ collection:

Date.Parse

That works because LibPQPath contains reference to https://raw.githubusercontent.com/sio/LibPQ/master/Modules/, where the source code for Date.Parse.pq is located.

Creating a new module

You can save any reusable Power Query function or query to be imported by LibPQ later:

If you have any further questions about LibPQ please create an issue on GitHub or contact me via e-mail.