Skip to content

Commit

Permalink
Cleanup version_added < 5
Browse files Browse the repository at this point in the history
  • Loading branch information
1st1 committed Feb 15, 2025
1 parent 05d05e0 commit 5187a6b
Show file tree
Hide file tree
Showing 43 changed files with 93 additions and 213 deletions.
6 changes: 3 additions & 3 deletions docs/cli/gel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,9 @@ Branch

.. versionadded:: 5.0

|EdgeDB| 5.0 introduced :ref:`branches <ref_datamodel_branches>` to replace
databases. If you are running an earlier version of Gel,
you will instead use the database commands above.
|EdgeDB| 5.0 introduced :ref:`branches <ref_datamodel_branches>` to replace
databases. If you are running an earlier version of Gel,
you will instead use the database commands above.

:cli:synopsis:`\\branch create NAME`
Create a new branch. The backslash command mirrors the options of the CLI's
Expand Down
4 changes: 0 additions & 4 deletions docs/datamodel/access_policies.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
.. versionadded:: 2.0

.. _ref_datamodel_access_policies:

===============
Expand Down Expand Up @@ -442,8 +440,6 @@ making the current user able to see their own ``User`` record.
Custom error messages
^^^^^^^^^^^^^^^^^^^^^

.. versionadded:: 3.0

.. index:: access policy, errmessage, using

When you run a query that attempts a write and is restricted by an access
Expand Down
2 changes: 0 additions & 2 deletions docs/datamodel/constraints.rst
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,6 @@ tuple of properties or links.
Partial constraints
^^^^^^^^^^^^^^^^^^^

.. versionadded:: 2.0

.. index:: constraint exclusive on, except

Constraints on object types can be made partial, so that they don't apply
Expand Down
2 changes: 0 additions & 2 deletions docs/datamodel/globals.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
.. versionadded:: 2.0

.. _ref_datamodel_globals:

=======
Expand Down
4 changes: 2 additions & 2 deletions docs/datamodel/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ Branch

.. versionadded:: 5.0

Prior to |EdgeDB| 5 and Gel, *branches* were called "databases"
(and "databases" is what Gel branches map to in PostgreSQL).
Prior to |EdgeDB| 5 and Gel, *branches* were called "databases"
(and "databases" is what Gel branches map to in PostgreSQL).

Instances can be branched when working on new features, similar to branches in
your VCS. Each branch has its own schema and data.
Expand Down
2 changes: 0 additions & 2 deletions docs/datamodel/introspection/mutation_rewrites.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
.. versionadded:: 3.0

.. _ref_datamodel_introspection_mutation_rewrites:

=================
Expand Down
2 changes: 0 additions & 2 deletions docs/datamodel/introspection/triggers.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
.. versionadded:: 3.0

.. _ref_datamodel_introspection_triggers:

=========
Expand Down
2 changes: 0 additions & 2 deletions docs/datamodel/links.rst
Original file line number Diff line number Diff line change
Expand Up @@ -643,8 +643,6 @@ There are 4 available target deletion policies.
Source deletion
^^^^^^^^^^^^^^^

.. versionadded:: 2.0

Source deletion policies determine what action should be taken when the
*source* of a given link is deleted. They are declared with the ``on source
delete`` clause.
Expand Down
2 changes: 0 additions & 2 deletions docs/datamodel/mutation_rewrites.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
.. versionadded:: 3.0

.. _ref_datamodel_mutation_rewrites:

=================
Expand Down
2 changes: 0 additions & 2 deletions docs/datamodel/primitives.rst
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,6 @@ details, see :ref:`EdgeQL > Literals > Tuples <ref_eql_literal_tuple>`.
Ranges
^^^^^^

.. versionadded:: 2.0

Ranges represent some interval of values. The intervals can be bound or
unbound on either end. They can also be empty, containing no values. Only
some scalar types have corresponding range types:
Expand Down
57 changes: 27 additions & 30 deletions docs/datamodel/triggers.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
.. versionadded:: 3.0

.. _ref_datamodel_triggers:

========
Expand Down Expand Up @@ -162,40 +160,39 @@ Now, whenever we run a query, we get a log entry as well:
the same trigger to be run in two different stages. These triggers will
generate an error.

.. versionadded:: 4.0

Our audit logging works, but the update logs have a major shortcoming: they
log an update even when nothing changes. Any time an ``update`` query runs,
we get a log, even if the values are the same. We can prevent that by
using the trigger's ``when`` to run the trigger conditionally. Here's a
rework of our ``update`` logging query:
Our audit logging works, but the update logs have a major shortcoming: they
log an update even when nothing changes. Any time an ``update`` query runs,
we get a log, even if the values are the same. We can prevent that by
using the trigger's ``when`` to run the trigger conditionally. Here's a
rework of our ``update`` logging query:

.. code-block:: sdl
.. code-block:: sdl-invalid
trigger log_update after update for each
when (__old__.name != __new__.name)
do (
insert Log {
action := 'update',
target_name := __new__.name,
change := __old__.name ++ '->' ++ __new__.name
}
);
trigger log_update after update for each
when (__old__.name != __new__.name)
do (
insert Log {
action := 'update',
target_name := __new__.name,
change := __old__.name ++ '->' ++ __new__.name
}
);
If this object were more complicated and we had many properties to compare,
we could use a ``json`` cast to compare them all in one shot:
If this object were more complicated and we had many properties to compare,
we could use a ``json`` cast to compare them all in one shot:

.. code-block:: sdl
.. code-block:: sdl-invalid
trigger log_update after update for each
when (<json>__old__ {**} != <json>__new__ {**})
do (
insert Log {
action := 'update',
target_name := __new__.name,
change := __old__.name ++ '->' ++ __new__.name
}
);
trigger log_update after update for each
when (<json>__old__ {**} != <json>__new__ {**})
do (
insert Log {
action := 'update',
target_name := __new__.name,
change := __old__.name ++ '->' ++ __new__.name
}
);
You might find that one log entry per row is too granular or too noisy for your
use case. In that case, a ``for all`` trigger may be a better fit. Here's a
Expand Down
2 changes: 0 additions & 2 deletions docs/edgeql/analyze.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
.. _ref_eql_analyze:

.. versionadded:: 3.0

Analyze
=======

Expand Down
2 changes: 0 additions & 2 deletions docs/edgeql/group.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
.. versionadded:: 2.0

.. _ref_eql_group:

Group
Expand Down
4 changes: 0 additions & 4 deletions docs/edgeql/literals.rst
Original file line number Diff line number Diff line change
Expand Up @@ -451,8 +451,6 @@ To declare relative duration literals:
Date durations
^^^^^^^^^^^^^^

.. versionadded:: 2.0

The :eql:type:`cal::date_duration` represents spans consisting of some number
of *months* and *days*. This type is primarily intended to simplify logic
involving :eql:type:`cal::local_date` values.
Expand Down Expand Up @@ -491,8 +489,6 @@ EdgeQL supports a set of functions and operators on duration types.
Ranges
------

.. versionadded:: 2.0

.. index:: ranges, lower bound, upper bound, inclusive, inc_lower, inc_upper,
empty

Expand Down
14 changes: 6 additions & 8 deletions docs/edgeql/parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,14 @@ parameters are supplied externally.
Note that we provided an explicit type cast before the parameter. This is
required, as it enables Gel to enforce the provided types at runtime.

.. versionadded:: 3.0
Parameters can be named or unnamed tuples.

Parameters can be named or unnamed tuples.

.. code-block:: edgeql
.. code-block:: edgeql
select <tuple<str, bool>>$var;
select <optional tuple<str, bool>>$var;
select <tuple<name: str, flag: bool>>$var;
select <optional tuple<name: str, flag: bool>>$var;
select <tuple<str, bool>>$var;
select <optional tuple<str, bool>>$var;
select <tuple<name: str, flag: bool>>$var;
select <optional tuple<name: str, flag: bool>>$var;
Usage with clients
------------------
Expand Down
2 changes: 0 additions & 2 deletions docs/edgeql/select.rst
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,6 @@ identically to concrete/non-computed links like ``Villain.nemesis``.
Splats
^^^^^^

.. versionadded:: 3.0

.. index:: select, splats, *, **, select *, select all, [is ].*, [is ].**

Splats allow you to select all properties of a type using the asterisk (``*``)
Expand Down
4 changes: 0 additions & 4 deletions docs/edgeql/sets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,6 @@ Use the :eql:op:`union` operator to merge two sets.
Finding common members
----------------------

.. versionadded:: 3.0

.. index:: intersect

Use the :eql:op:`intersect` operator to find common members between two sets.
Expand Down Expand Up @@ -297,8 +295,6 @@ resulting set.
Removing common members
-----------------------

.. versionadded:: 3.0

.. index:: except

Use the :eql:op:`except` operator to leave only the members in the first set
Expand Down
20 changes: 9 additions & 11 deletions docs/edgeql/types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,22 +93,20 @@ typed; you can't simply convert an object to an object of a different type.
.. lint-off
.. versionadded:: 3.0
You can cast a UUID into an object:

You can cast a UUID into an object:

.. code-block:: edgeql-repl
.. code-block:: edgeql-repl
db> select <Hero><uuid>'01d9cc22-b776-11ed-8bef-73f84c7e91e7';
{default::Hero {id: 01d9cc22-b776-11ed-8bef-73f84c7e91e7}}
db> select <Hero><uuid>'01d9cc22-b776-11ed-8bef-73f84c7e91e7';
{default::Hero {id: 01d9cc22-b776-11ed-8bef-73f84c7e91e7}}
If you try to cast a UUID that no object of the type has as its ``id``
property, you'll get an error:
If you try to cast a UUID that no object of the type has as its ``id``
property, you'll get an error:

.. code-block:: edgeql-repl
.. code-block:: edgeql-repl
db> select <Hero><uuid>'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa';
gel error: CardinalityViolationError: 'default::Hero' with id 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa' does not exist
db> select <Hero><uuid>'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa';
gel error: CardinalityViolationError: 'default::Hero' with id 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa' does not exist
.. lint-on
Expand Down
2 changes: 0 additions & 2 deletions docs/guides/contributing/documentation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -991,8 +991,6 @@ versionadded:: 2.0``.
.. eql:type:: cal::date_duration
.. versionadded:: 2.0
A type for representing a span of time in days.
**Rendered**
Expand Down
10 changes: 3 additions & 7 deletions docs/reference/ddl/access_policies.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
.. versionadded:: 2.0

.. _ref_eql_ddl_access_policies:

===============
Expand Down Expand Up @@ -121,11 +119,9 @@ Most sub-commands and options of this command are identical to the

The following subcommands are allowed in the ``create access policy`` block:

.. versionadded:: 3.0

:eql:synopsis:`set errmessage := <value>`
Set a custom error message of :eql:synopsis:`<value>` that is displayed
when this access policy prevents a write action.
:eql:synopsis:`set errmessage := <value>`
Set a custom error message of :eql:synopsis:`<value>` that is displayed
when this access policy prevents a write action.

:eql:synopsis:`create annotation <annotation-name> := <value>`
Set access policy annotation :eql:synopsis:`<annotation-name>` to
Expand Down
2 changes: 0 additions & 2 deletions docs/reference/ddl/globals.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
.. versionadded:: 2.0

.. _ref_eql_ddl_globals:

=======
Expand Down
4 changes: 0 additions & 4 deletions docs/reference/ddl/migrations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,6 @@ Create and execute the current migration:
Reset schema to initial
=======================

.. versionadded:: 3.0

:eql-statement:

Reset the database schema to its initial state.
Expand All @@ -354,8 +352,6 @@ Reset the database schema to its initial state.
Migration Rewrites
==================

.. versionadded:: 3.0

Migration rewrites allow you to change the migration history as long as your
final schema matches the current database schema.

Expand Down
2 changes: 0 additions & 2 deletions docs/reference/ddl/mutation_rewrites.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
.. versionadded:: 3.0

.. _ref_eql_ddl_mutation_rewrites:

=================
Expand Down
30 changes: 13 additions & 17 deletions docs/reference/ddl/triggers.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
.. versionadded:: 3.0

.. _ref_eql_ddl_triggers:

========
Expand Down Expand Up @@ -62,24 +60,22 @@ Declare a trigger that inserts a ``Log`` object for each new ``User`` object:
);
};
.. versionadded:: 4.0

Declare a trigger that inserts a ``Log`` object conditionally when an update
query makes a change to a ``User`` object:
Declare a trigger that inserts a ``Log`` object conditionally when an update
query makes a change to a ``User`` object:

.. code-block:: edgeql
.. code-block:: edgeql
alter type User {
create trigger log_update after update for each
when (<json>__old__ {**} != <json>__new__ {**})
do (
insert Log {
action := 'update',
target_name := __new__.name,
change := __old__.name ++ '->' ++ __new__.name
}
);
alter type User {
create trigger log_update after update for each
when (<json>__old__ {**} != <json>__new__ {**})
do (
insert Log {
action := 'update',
target_name := __new__.name,
change := __old__.name ++ '->' ++ __new__.name
}
);
}
Drop trigger
Expand Down
2 changes: 0 additions & 2 deletions docs/reference/edgeql/analyze.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
.. _ref_eql_statements_analyze:

.. versionadded:: 3.0

Analyze
=======

Expand Down
Loading

0 comments on commit 5187a6b

Please sign in to comment.