Skip to content

Quick Start with Docker

Start the onesparse demo docker container, substitute suitable password and container name:

docker run -d -e POSTGRES_PASSWORD=password -it --name onesparse-demo onesparse/onesparse:demo

The container will start detached in the background, verify it's running with 'docker ps'. Now exec a psql process to interact with the container:

docker exec -u postgres -it onesparse-demo psql

postgres# create extension onesparse;
CREATE EXTENSION
postgres# select print(random_matrix(8, 8, 16, seed=>0.42, max=>42)) as random_matrix;
┌────────────────────────────────┐
│         random_matrix          │
├────────────────────────────────┤
│      0  1  2  3  4  5  6  7   ↵│
│    ────────────────────────   ↵│
│  0│              6 31         ↵│
│  1│                   12      ↵│
│  2│    26                     ↵│
│  3│                40         ↵│
│  4│    11    15           7   ↵│
│  5│ 20 12    22        1      ↵│
│  6│              1            ↵│
│  7│       17                  ↵│
│                                │
└────────────────────────────────┘
(1 row)

This matrix represents the following graph:

%3 0 0 4 4 0->4 6 5 5 0->5 31 1 1 4->1 11 3 3 4->3 15 7 7 4->7 7 5->0 20 5->1 12 6 6 5->6 1 5->3 22 1->6 12 6->4 1 2 2 2->1 26 3->5 40 7->2 17

Check out the Getting Started for some examples and the Matrix Documentation. You can verify the doctests with docker using:

$ docker exec -u postgres -it onesparse-demo-container make installcheck