Skip to content
This repository was archived by the owner on Feb 24, 2024. It is now read-only.

Commit a03c91d

Browse files
committed
Add PostgREST installation using package managers to tut0
1 parent e620ae5 commit a03c91d

File tree

3 files changed

+73
-51
lines changed

3 files changed

+73
-51
lines changed

docs/explanations/install.rst

Lines changed: 3 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -3,58 +3,12 @@
33
Installation
44
############
55

6-
The release page has `pre-compiled binaries for Mac OS X, Windows, Linux and FreeBSD <https://github.com/PostgREST/postgrest/releases/latest>`_ .
6+
The release page has `pre-compiled binaries for macOS, Windows, Linux and FreeBSD <https://github.com/PostgREST/postgrest/releases/latest>`_ .
77
The Linux binary is a static executable that can be run on any Linux distribution.
88

99
You can also use your OS package manager.
1010

11-
.. tabs::
12-
13-
.. group-tab:: Mac OSX
14-
15-
You can install PostgREST from the `Homebrew official repo <https://formulae.brew.sh/formula/postgrest>`_.
16-
17-
.. code:: bash
18-
19-
brew install postgrest
20-
21-
.. group-tab:: FreeBSD
22-
23-
You can install PostgREST from the `official ports <https://www.freshports.org/www/hs-postgrest>`_.
24-
25-
.. code:: bash
26-
27-
pkg install hs-postgrest
28-
29-
.. group-tab:: Linux
30-
31-
.. tabs::
32-
33-
.. tab:: Arch Linux
34-
35-
You can install PostgREST from the `community repo <https://archlinux.org/packages/extra/x86_64/postgrest/>`_.
36-
37-
.. code:: bash
38-
39-
pacman -S postgrest
40-
41-
.. tab:: Nix
42-
43-
You can install PostgREST from nixpkgs.
44-
45-
.. code:: bash
46-
47-
nix-env -i haskellPackages.postgrest
48-
49-
.. group-tab:: Windows
50-
51-
You can install PostgREST using `Chocolatey <https://community.chocolatey.org/packages/postgrest>`_ or `Scoop <https://github.com/ScoopInstaller/Scoop>`_.
52-
53-
.. code:: bash
54-
55-
choco install postgrest
56-
scoop install postgrest
57-
11+
.. include:: ../shared/installation.rst
5812

5913
.. _pg-dependency:
6014

@@ -242,7 +196,7 @@ You can build PostgREST from source with `Stack <https://github.com/commercialha
242196
Ubuntu/Debian libpq-dev, libgmp-dev, zlib1g-dev
243197
CentOS/Fedora/Red Hat postgresql-devel, zlib-devel, gmp-devel
244198
BSD postgresql12-client
245-
OS X libpq, gmp
199+
macOS libpq, gmp
246200
===================== =======================================
247201

248202
* Build and install binary

docs/shared/installation.rst

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
.. tabs::
2+
3+
.. group-tab:: macOS
4+
5+
You can install PostgREST from the `Homebrew official repo <https://formulae.brew.sh/formula/postgrest>`_.
6+
7+
.. code:: bash
8+
9+
brew install postgrest
10+
11+
.. group-tab:: FreeBSD
12+
13+
You can install PostgREST from the `official ports <https://www.freshports.org/www/hs-postgrest>`_.
14+
15+
.. code:: bash
16+
17+
pkg install hs-postgrest
18+
19+
.. group-tab:: Linux
20+
21+
.. tabs::
22+
23+
.. tab:: Arch Linux
24+
25+
You can install PostgREST from the `community repo <https://archlinux.org/packages/extra/x86_64/postgrest/>`_.
26+
27+
.. code:: bash
28+
29+
pacman -S postgrest
30+
31+
.. tab:: Nix
32+
33+
You can install PostgREST from nixpkgs.
34+
35+
.. code:: bash
36+
37+
nix-env -i haskellPackages.postgrest
38+
39+
.. group-tab:: Windows
40+
41+
You can install PostgREST using `Chocolatey <https://community.chocolatey.org/packages/postgrest>`_ or `Scoop <https://github.com/ScoopInstaller/Scoop>`_.
42+
43+
.. code:: bash
44+
45+
choco install postgrest
46+
scoop install postgrest

docs/tutorials/tut0.rst

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,25 @@ This will run the Docker instance as a daemon and expose port 5433 to the host s
3838
Step 3. Install PostgREST
3939
-------------------------
4040

41-
PostgREST is distributed as a single binary, with versions compiled for major distributions of Linux/BSD/Windows. Visit the `latest release <https://github.com/PostgREST/postgrest/releases/latest>`_ for a list of downloads. In the event that your platform is not among those already pre-built, see :ref:`build_source` for instructions how to build it yourself. Also let us know to add your platform in the next release.
41+
Using a Package Manager
42+
~~~~~~~~~~~~~~~~~~~~~~~
43+
44+
You can use your OS package manager to install PostgREST.
45+
46+
.. include:: ../shared/installation.rst
47+
48+
Then, try running it with
49+
50+
.. code-block:: bash
51+
52+
postgrest -h
53+
54+
It should print the help page with its version and the available options.
55+
56+
Downloading a Pre-Built Binary
57+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
58+
59+
PostgREST is also distributed as a single binary, with versions compiled for major distributions of macOS, Windows, Linux and FreeBSD. Visit the `latest release <https://github.com/PostgREST/postgrest/releases/latest>`_ for a list of downloads. In the event that your platform is not among those already pre-built, see :ref:`build_source` for instructions how to build it yourself. Also let us know to add your platform in the next release.
4260

4361
The pre-built binaries for download are :code:`.tar.xz` compressed files (except Windows which is a zip file). To extract the binary, go into the terminal and run
4462

@@ -76,7 +94,7 @@ If everything is working correctly it will print out its version and the availab
7694
</div></div>
7795
</details>
7896
<details>
79-
<summary>OS X</summary>
97+
<summary>macOS</summary>
8098
<div class="highlight-bash"><div class="highlight">
8199
<pre>brew install postgresql</pre>
82100
</div></div>
@@ -172,6 +190,10 @@ Now run the server:
172190

173191
.. code-block:: bash
174192
193+
# Using a package manager
194+
postgrest tutorial.conf
195+
196+
# Using a pre-built binary
175197
./postgrest tutorial.conf
176198
177199
You should see

0 commit comments

Comments
 (0)