Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into documentation-for-ui
Browse files Browse the repository at this point in the history
  • Loading branch information
Dhghomon committed Jan 23, 2024
2 parents 5c763ab + b6cde57 commit ecbc33e
Show file tree
Hide file tree
Showing 46 changed files with 1,570 additions and 709 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/pull-request-meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Pull Request Meta

on:
pull_request:
types: [opened, edited, synchronize]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:

test-pr:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: false

- name: Verify that postgres/ was not changed unintentionally
env:
PR_TITLE: ${{ github.event.pull_request.title }}
shell: bash
run: |
required_prefix="Update bundled PostgreSQL"
if [[ "$PR_TITLE" == $required_prefix* ]]; then
exit 0
fi
if git diff --quiet \
${{ github.event.pull_request.base.sha }} \
${{ github.event.pull_request.head.sha }} -- postgres/
then
echo 'all ok'
else
echo "postgres/ submodule has been changed,"\
"but PR title does not indicate that"
echo "(it should start with '$required_prefix')"
exit 1
fi
13 changes: 12 additions & 1 deletion docs/changelog/4_x.rst
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ Bug fixes

* Optimize the compiler and reduce time of an update test by ~52%
(:eql:gh:`#6579`)

* Always retry system connection on any BackendError
(:eql:gh:`#6588`)

Expand Down Expand Up @@ -638,3 +638,14 @@ Bug fixes

* Fix changing a pointer to be computed when there is a subtype
(:eql:gh:`#6565`)

4.4
===
* Fix DML-containing FOR when the iterator is an object set with duplicates
(:eql:gh:`#6609`)

* Fix very slow global introspection query when there are lots of databases
(:eql:gh:`#6633`)

* Use correct signature for in-memory cache method
(:eql:gh:`#6643`)
39 changes: 39 additions & 0 deletions docs/cli/edgedb_instance/edgedb_instance_credentials.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
.. _ref_cli_edgedb_instance_credentials:


===========================
edgedb instance credentials
===========================

Display instance credentials.

.. cli:synopsis::
edgedb instance credentials [options] [connection-options]
Description
===========

``edgedb instance credentials`` is a terminal command for displaying the
credentials of an EdgeDB instance.


Options
=======

:cli:synopsis:`--json`
Output in JSON format. In addition to formatting the credentials as JSON,
this option also includes the password in cleartext and the TLS
certificates.

:cli:synopsis:`--insecure-dsn`
Output a DSN with password in cleartext.

Connection Options
==================

By default, the ``edgedb.toml`` connection is used.

:cli:synopsis:`<connection-options>`
See :ref:`connection options <ref_cli_edgedb_connopts>`.
3 changes: 3 additions & 0 deletions docs/cli/edgedb_instance/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ for managing EdgeDB instances.
:hidden:

edgedb_instance_create
edgedb_instance_credentials
edgedb_instance_destroy
edgedb_instance_link
edgedb_instance_list
Expand All @@ -35,6 +36,8 @@ for managing EdgeDB instances.

* - :ref:`ref_cli_edgedb_instance_create`
- Initialize a new server instance
* - :ref:`ref_cli_edgedb_instance_credentials`
- Display instance credentials
* - :ref:`ref_cli_edgedb_instance_destroy`
- Destroy a server instance and remove the data stored
* - :ref:`ref_cli_edgedb_instance_link`
Expand Down
2 changes: 1 addition & 1 deletion docs/datamodel/constraints.rst
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ player picks in a color-based memory game:
required name: str;
}
This constraint ensures that a single ``User`` cannot pick two ``Color``\s at
This constraint ensures that a single ``Player`` cannot pick two ``Color``\s at
the same ``@order``.

.. _ref_datamodel_constraints_scalars:
Expand Down
8 changes: 8 additions & 0 deletions docs/edgeql/for.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@ A similar approach can be used for bulk updates.
Conditional DML
---------------

.. versionadded:: 4.0

DML is now supported in ``if..else``. The method of achieving conditional
DML demonstrated below is a workaround for earlier versions of EdgeDB
before this support was introduced in EdgeDB 4.0. If you're on EdgeDB 4.0
or higher, use :eql:op:`if..else` for a cleaner way to achieve conditional
DML.

DML (i.e., :ref:`insert <ref_eql_insert>`, :ref:`update <ref_eql_update>`,
:ref:`delete <ref_eql_delete>`) is not supported in :eql:op:`if..else`. If you
need to do one of these conditionally, you can use a ``for`` loop as a
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/auth/email_password.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Email and password

:edb-alt-title: Integrating EdgeDB Auth's email and password provider

Along with using the ``Built-in UI <ref_guide_auth_built_in_ui>``, you can also
Along with using the `Built-in UI <ref_guide_auth_built_in_ui>`_, you can also
create your own UI that calls to your own web application backend.

UI considerations
Expand Down
9 changes: 6 additions & 3 deletions docs/guides/auth/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,12 @@ provide those values and the ``additional_scope``:
Provider to fulfill our minimal data needs. You can pass additional
scope here in a space-separated string and we will request that
additional scope when getting the authentication token from the
Identity Provider. \********Note:\*******\* We return this
authentication token with this scope from the Identity Provider when
we return our own authentication token.
Identity Provider.

.. note::

We return this authentication token with this scope from the Identity
Provider when we return our own authentication token.

You’ll also need to set a callback URL in each provider’s interface. To build
this callback URL, you will need the hostname, port, and database name of your
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/auth/oauth.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ OAuth

:edb-alt-title: Integrating EdgeDB Auth's OAuth provider

Along with using the ``Built-in UI <ref_guide_auth_built_in_ui>``, you can also
Along with using the `Built-in UI <ref_guide_auth_built_in_ui>`_, you can also
create your own UI that calls to your own web application backend.

UI considerations
Expand Down
4 changes: 2 additions & 2 deletions docs/guides/contributing/code.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ Python "venv" with all dependencies and commands installed into it.
$ git clone --recursive https://github.com/edgedb/edgedb.git
#. Create a Python 3.10 virtual environment and activate it:
#. Create a Python 3.11 virtual environment and activate it:

.. code-block:: bash
$ python3.10 -m venv edgedb-dev
$ python3.11 -m venv edgedb-dev
$ source edgedb-dev/bin/activate
#. Build edgedb (the build will take a while):
Expand Down
18 changes: 9 additions & 9 deletions docs/guides/deployment/bare_metal.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ default. You can start the server by enabling the unit.

.. code-block:: bash
$ sudo systemctl enable --now edgedb-server-3
$ sudo systemctl enable --now edgedb-server-4
This will start the server on port 5656, and the data directory will be
``/var/lib/edgedb/1/data``.
Expand All @@ -88,7 +88,7 @@ To set environment variables when running EdgeDB with ``systemctl``,

.. code-block:: bash
$ systemctl edit --full edgedb-server-3
$ systemctl edit --full edgedb-server-4
This opens a ``systemd`` unit file. Set the desired environment variables
under the ``[Service]`` section. View the supported environment variables at
Expand All @@ -104,7 +104,7 @@ Save the file and exit, then restart the service.

.. code-block:: bash
$ systemctl restart edgedb-server-3
$ systemctl restart edgedb-server-4
Set a password
Expand All @@ -114,14 +114,14 @@ socket directory. You can find this by looking at your system.d unit file.

.. code-block:: bash
$ sudo systemctl cat edgedb-server-3
$ sudo systemctl cat edgedb-server-4
Set a password by connecting from localhost.

.. code-block:: bash
$ echo -n "> " && read -s PASSWORD
$ RUNSTATE_DIR=$(systemctl show edgedb-server-3 -P ExecStart | \
$ RUNSTATE_DIR=$(systemctl show edgedb-server-4 -P ExecStart | \
grep -o -m 1 -- "--runstate-dir=[^ ]\+" | \
awk -F "=" '{print $2}')
$ sudo edgedb --port 5656 --tls-security insecure --admin \
Expand All @@ -147,7 +147,7 @@ You may need to restart the server after changing the listen port or addresses.

.. code-block:: bash
$ sudo systemctl restart edgedb-server-3
$ sudo systemctl restart edgedb-server-4
Link the instance with the CLI
Expand Down Expand Up @@ -183,7 +183,7 @@ Upgrading EdgeDB
intended to manage production instances.

When you want to upgrade to the newest point release upgrade the package and
restart the ``edgedb-server-3`` unit.
restart the ``edgedb-server-4`` unit.


Debian/Ubuntu LTS
Expand All @@ -192,7 +192,7 @@ Debian/Ubuntu LTS
.. code-block:: bash
$ sudo apt-get update && sudo apt-get install --only-upgrade edgedb-3
$ sudo systemctl restart edgedb-server-3
$ sudo systemctl restart edgedb-server-4
CentOS/RHEL 7/8
Expand All @@ -201,7 +201,7 @@ CentOS/RHEL 7/8
.. code-block:: bash
$ sudo yum update edgedb-3
$ sudo systemctl restart edgedb-server-3
$ sudo systemctl restart edgedb-server-4
Health Checks
=============
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/deployment/digitalocean.rst
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ Set the security policy to strict.

.. code-block:: bash
$ apt-get update && apt-get install --only-upgrade edgedb-server-3
$ apt-get update && apt-get install --only-upgrade edgedb-server-4
$ systemctl restart edgedb
That's it! Refer to the :ref:`Construct the DSN
Expand Down
50 changes: 22 additions & 28 deletions docs/guides/deployment/fly_io.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ In this guide we show how to deploy EdgeDB using a `Fly.io <https://fly.io>`_
PostgreSQL cluster as the backend. The deployment consists of two apps: one
running Postgres and the other running EdgeDB.

.. note::

At the moment, it isn't possible to expose Fly-hosted EdgeDB instances to
the public internet, only internally to other Fly projects. As such your
application must also be hosted on Fly.

Prerequisites
=============
Expand Down Expand Up @@ -55,7 +50,7 @@ we'll need. There are a couple more environment variables we need to set:
.. code-block:: bash
$ flyctl secrets set \
EDGEDB_PASSWORD="$PASSWORD" \
EDGEDB_SERVER_PASSWORD="$PASSWORD" \
EDGEDB_SERVER_BACKEND_DSN_ENV=DATABASE_URL \
EDGEDB_SERVER_TLS_CERT_MODE=generate_self_signed \
EDGEDB_SERVER_PORT=8080 \
Expand All @@ -77,16 +72,20 @@ Let's discuss what's going on with all these secrets.
of the default 5656, because Fly.io prefers ``8080`` for its default health
checks.

Finally, let's scale the VM as EdgeDB requires a little bit more than the
default Fly.io VM side provides:
Finally, let's configure the VM size as EdgeDB requires a little bit more than
the default Fly.io VM side provides. Put this in a file called ``fly.toml`` in
your current directory.:

.. code-block:: bash
.. code-block:: yaml
[build]
image = "edgedb/edgedb"
[[vm]]
memory = "512mb"
cpus = 1
cpu-kind = "shared"
$ flyctl scale vm shared-cpu-1x --memory=1024 --app $EDB_APP
Scaled VM Type to
shared-cpu-1x
CPU Cores: 1
Memory: 1 GB
Create a PostgreSQL cluster
===========================
Expand Down Expand Up @@ -128,7 +127,7 @@ this command:

.. code-block:: bash
$ flyctl machine update <machine-id> --memory 512 --app $PG_APP -y
$ flyctl machine update <machine-id> --memory 1024 --app $PG_APP -y
Searching for image 'flyio/postgres:14.6' remotely...
image found: img_0lq747j0ym646x35
Image: registry-1.docker.io/flyio/postgres:14.6
Expand Down Expand Up @@ -173,19 +172,20 @@ Everything is set! Time to start EdgeDB.

.. code-block:: bash
$ flyctl deploy --image=edgedb/edgedb \
--remote-only --app $EDB_APP
$ flyctl deploy --remote-only --app $EDB_APP
...
1 desired, 1 placed, 1 healthy, 0 unhealthy
--> v0 deployed successfully
Finished launching new machines
-------
✔ Machine e286630dce9638 [app] was created
-------
That's it! You can now start using the EdgeDB instance located at
``edgedb://myorg-edgedb.internal`` in your Fly.io apps.


If deploy did not succeed:

1. make sure you've scaled the EdgeDB VM
1. make sure you've created the ``fly.toml`` file.
2. re-run the ``deploy`` command
3. check the logs for more information: ``flyctl logs --app $EDB_APP``

Expand Down Expand Up @@ -268,14 +268,8 @@ From external application
If you need to access EdgeDB from outside the Fly.io network, you'll need to
configure the Fly.io proxy to let external connections in.

First, save the EdgeDB app config in an **empty directory**:

.. code-block:: bash
$ flyctl config save -a $EDB_APP
A ``fly.toml`` file will be created upon result. Let's make sure our
``[[services]]`` section looks something like this:
Let's make sure the ``[[services]]`` section in our ``fly.toml`` looks
something like this:

.. code-block:: toml
Expand Down
Loading

0 comments on commit ecbc33e

Please sign in to comment.