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

Add PostgREST installation using package managers to tut0 #706

Merged
merged 3 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', 'shared/*.rst']

# The reST default role (used for this markup: `text`) to use for all
# documents.
Expand Down
52 changes: 3 additions & 49 deletions docs/explanations/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,58 +3,12 @@
Installation
############

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

You can also use your OS package manager.

.. tabs::

.. group-tab:: Mac OSX

You can install PostgREST from the `Homebrew official repo <https://formulae.brew.sh/formula/postgrest>`_.

.. code:: bash

brew install postgrest

.. group-tab:: FreeBSD

You can install PostgREST from the `official ports <https://www.freshports.org/www/hs-postgrest>`_.

.. code:: bash

pkg install hs-postgrest

.. group-tab:: Linux

.. tabs::

.. tab:: Arch Linux

You can install PostgREST from the `community repo <https://archlinux.org/packages/extra/x86_64/postgrest/>`_.

.. code:: bash

pacman -S postgrest

.. tab:: Nix

You can install PostgREST from nixpkgs.

.. code:: bash

nix-env -i haskellPackages.postgrest

.. group-tab:: Windows

You can install PostgREST using `Chocolatey <https://community.chocolatey.org/packages/postgrest>`_ or `Scoop <https://github.com/ScoopInstaller/Scoop>`_.

.. code:: bash

choco install postgrest
scoop install postgrest

.. include:: ../shared/installation.rst

.. _pg-dependency:

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

* Build and install binary
Expand Down
46 changes: 46 additions & 0 deletions docs/shared/installation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
.. tabs::

.. group-tab:: macOS

You can install PostgREST from the `Homebrew official repo <https://formulae.brew.sh/formula/postgrest>`_.

.. code:: bash

brew install postgrest

.. group-tab:: FreeBSD

You can install PostgREST from the `official ports <https://www.freshports.org/www/hs-postgrest>`_.

.. code:: bash

pkg install hs-postgrest

.. group-tab:: Linux

.. tabs::

.. tab:: Arch Linux

You can install PostgREST from the `community repo <https://archlinux.org/packages/extra/x86_64/postgrest/>`_.

.. code:: bash

pacman -S postgrest

.. tab:: Nix

You can install PostgREST from nixpkgs.

.. code:: bash

nix-env -i haskellPackages.postgrest

.. group-tab:: Windows

You can install PostgREST using `Chocolatey <https://community.chocolatey.org/packages/postgrest>`_ or `Scoop <https://github.com/ScoopInstaller/Scoop>`_.

.. code:: bash

choco install postgrest
scoop install postgrest
26 changes: 24 additions & 2 deletions docs/tutorials/tut0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,25 @@ This will run the Docker instance as a daemon and expose port 5433 to the host s
Step 3. Install PostgREST
-------------------------

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.
Using a Package Manager
~~~~~~~~~~~~~~~~~~~~~~~

You can use your OS package manager to install PostgREST.

.. include:: ../shared/installation.rst

Then, try running it with:

.. code-block:: bash

postgrest -h

It should print the help page with its version and the available options.

Downloading a Pre-Built Binary
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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.
laurenceisla marked this conversation as resolved.
Show resolved Hide resolved

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

Expand Down Expand Up @@ -76,7 +94,7 @@ If everything is working correctly it will print out its version and the availab
</div></div>
</details>
<details>
<summary>OS X</summary>
<summary>macOS</summary>
<div class="highlight-bash"><div class="highlight">
<pre>brew install postgresql</pre>
</div></div>
Expand Down Expand Up @@ -172,6 +190,10 @@ Now run the server:

.. code-block:: bash

# Running postgrest installed from a package manager
postgrest tutorial.conf

# Running postgrest binary
./postgrest tutorial.conf

You should see
Expand Down
1 change: 1 addition & 0 deletions postgrest.dict
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ logins
lon
lt
lte
macOS
misprediction
multi
namespace
Expand Down