From ffc182e1bd552acc06a94615ab5334b87a9c2b7d Mon Sep 17 00:00:00 2001 From: Yury Selivanov Date: Sat, 15 Feb 2025 11:10:11 -0800 Subject: [PATCH] Drop all :version-lt: snippets --- docs/cheatsheets/annotations.rst | 19 +- docs/cheatsheets/link_properties.rst | 38 --- docs/cheatsheets/objects.rst | 167 -------------- docs/datamodel/access_policies.rst | 213 ----------------- docs/datamodel/aliases.rst | 41 +--- docs/datamodel/annotations.rst | 12 - docs/datamodel/comparison.rst | 12 - docs/datamodel/computeds.rst | 94 -------- docs/datamodel/constraints.rst | 149 ------------ docs/datamodel/globals.rst | 50 ---- docs/datamodel/indexes.rst | 48 ---- docs/datamodel/inheritance.rst | 84 ------- docs/datamodel/introspection/objects.rst | 17 -- docs/datamodel/links.rst | 281 ----------------------- docs/datamodel/objects.rst | 49 ---- docs/datamodel/primitives.rst | 56 ----- docs/datamodel/properties.rst | 111 --------- docs/edgeql/delete.rst | 12 - docs/edgeql/insert.rst | 48 ---- docs/edgeql/paths.rst | 69 ------ docs/edgeql/select.rst | 68 ------ docs/edgeql/sets.rst | 15 -- docs/guides/migrations/tips.rst | 201 ---------------- docs/intro/edgeql.rst | 15 -- docs/intro/quickstart.rst | 23 -- docs/intro/schema.rst | 222 ------------------ docs/reference/ddl/access_policies.rst | 48 ---- docs/reference/ddl/triggers.rst | 11 - docs/reference/edgeql/describe.rst | 15 -- docs/reference/edgeql/shapes.rst | 8 - docs/reference/edgeql/update.rst | 12 - docs/reference/sdl/access_policies.rst | 45 ---- docs/reference/sdl/annotations.rst | 10 - docs/reference/sdl/constraints.rst | 11 - docs/reference/sdl/index.rst | 34 --- docs/reference/sdl/indexes.rst | 15 -- docs/reference/sdl/links.rst | 116 ---------- docs/reference/sdl/modules.rst | 42 ---- docs/reference/sdl/objects.rst | 33 --- docs/reference/sdl/properties.rst | 102 -------- docs/reference/sdl/triggers.rst | 11 - docs/stdlib/array.rst | 8 - docs/stdlib/constraints.rst | 40 ---- docs/stdlib/objects.rst | 15 -- docs/stdlib/sequence.rst | 11 - docs/stdlib/set.rst | 19 -- docs/stdlib/tuple.rst | 8 - docs/stdlib/type.rst | 39 ---- 48 files changed, 2 insertions(+), 2765 deletions(-) diff --git a/docs/cheatsheets/annotations.rst b/docs/cheatsheets/annotations.rst index 141cbd23208..4e773a71348 100644 --- a/docs/cheatsheets/annotations.rst +++ b/docs/cheatsheets/annotations.rst @@ -5,23 +5,6 @@ Declaring annotations Use annotations to add descriptions to types and links: -.. code-block:: sdl - :version-lt: 3.0 - - type Label { - annotation description := - 'Special label to stick on reviews'; - required property comments -> str; - link review -> Review { - annotation description := - 'This review needs some attention'; - }; - } - - type Review { - content -> str; - } - .. code-block:: sdl type Label { @@ -56,7 +39,7 @@ Retrieving the annotations can be done via an introspection query: name: 'default::Label', annotations: { schema::Annotation { - name: 'std::description', + name: 'std::description', @value: 'Special label to stick on reviews' }, }, diff --git a/docs/cheatsheets/link_properties.rst b/docs/cheatsheets/link_properties.rst index d6a604c914a..194fe55f4c1 100644 --- a/docs/cheatsheets/link_properties.rst +++ b/docs/cheatsheets/link_properties.rst @@ -30,17 +30,6 @@ Declaration Let's a create a ``Person.friends`` link with a ``strength`` property corresponding to the strength of the friendship. -.. code-block:: sdl - :version-lt: 3.0 - - type Person { - required property name -> str { constraint exclusive }; - - multi link friends -> Person { - property strength -> float64; - } - } - .. code-block:: sdl type Person { @@ -54,20 +43,6 @@ corresponding to the strength of the friendship. Constraints ----------- -.. code-block:: sdl - :version-lt: 3.0 - - type Person { - required property name -> str { constraint exclusive }; - - multi link friends -> Person { - property strength -> float64; - constraint expression on ( - __subject__@strength >= 0 - ); - } - } - .. code-block:: sdl type Person { @@ -86,19 +61,6 @@ Indexes To index on a link property, you must declare an abstract link and extend it. -.. code-block:: sdl - :version-lt: 3.0 - - abstract link friendship { - property strength -> float64; - index on (__subject__@strength); - } - - type Person { - required property name -> str { constraint exclusive }; - multi link friends extending friendship -> Person; - } - .. code-block:: sdl abstract link friendship { diff --git a/docs/cheatsheets/objects.rst b/docs/cheatsheets/objects.rst index a038825c9c3..d7e3f3b1b6a 100644 --- a/docs/cheatsheets/objects.rst +++ b/docs/cheatsheets/objects.rst @@ -6,15 +6,6 @@ Object types Define an abstract type: -.. code-block:: sdl - :version-lt: 3.0 - - abstract type HasImage { - # just a URL to the image - required property image -> str; - index on (.image); - } - .. code-block:: sdl abstract type HasImage { @@ -29,16 +20,6 @@ Define an abstract type: Define a type extending from the abstract: -.. code-block:: sdl - :version-lt: 3.0 - - type User extending HasImage { - required property name -> str { - # Ensure unique name for each User. - constraint exclusive; - } - } - .. code-block:: sdl type User extending HasImage { @@ -54,27 +35,6 @@ Define a type extending from the abstract: Define a type with constraints and defaults for properties: -.. code-block:: sdl - :version-lt: 3.0 - - type Review { - required property body -> str; - required property rating -> int64 { - constraint min_value(0); - constraint max_value(5); - } - required property flag -> bool { - default := False; - } - - required link author -> User; - required link movie -> Movie; - - required property creation_time -> datetime { - default := datetime_current(); - } - } - .. code-block:: sdl type Review { @@ -102,62 +62,6 @@ Define a type with constraints and defaults for properties: Define a type with a property that is computed from the combination of the other properties: -.. code-block:: sdl - :version-lt: 3.0 - - type Person extending HasImage { - required property first_name -> str { - default := ''; - } - required property middle_name -> str { - default := ''; - } - required property last_name -> str; - property full_name := - ( - ( - (.first_name ++ ' ') - if .first_name != '' else - '' - ) ++ - ( - (.middle_name ++ ' ') - if .middle_name != '' else - '' - ) ++ - .last_name - ); - property bio -> str; - } - -.. code-block:: sdl - :version-lt: 4.0 - - type Person extending HasImage { - required first_name: str { - default := ''; - } - required middle_name: str { - default := ''; - } - required last_name: str; - property full_name := - ( - ( - (.first_name ++ ' ') - if .first_name != '' else - '' - ) ++ - ( - (.middle_name ++ ' ') - if .middle_name != '' else - '' - ) ++ - .last_name - ); - bio: str; - } - .. code-block:: sdl type Person extending HasImage { @@ -192,20 +96,6 @@ the other properties: Define an abstract links: -.. code-block:: sdl - :version-lt: 3.0 - - abstract link crew { - # Provide a way to specify some "natural" - # ordering, as relevant to the movie. This - # may be order of importance, appearance, etc. - property list_order -> int64; - } - - abstract link directors extending crew; - - abstract link actors extending crew; - .. code-block:: sdl abstract link crew { @@ -230,52 +120,6 @@ Define an abstract links: Define a type using abstract links and a computed property that aggregates values from another linked type: -.. code-block:: sdl - :version-lt: 3.0 - - type Movie extending HasImage { - required property title -> str; - required property year -> int64; - - # Add an index for accessing movies by title and year, - # separately and in combination. - index on (.title); - index on (.year); - index on ((.title, .year)); - - property description -> str; - - multi link directors extending crew -> Person; - multi link actors extending crew -> Person; - - property avg_rating := math::mean(.` scalar type and an object type using it as a property: -.. code-block:: sdl - :version-lt: 3.0 - - scalar type TicketNo extending sequence; - - type Ticket { - property number -> TicketNo { - constraint exclusive; - } - } - .. code-block:: sdl scalar type TicketNo extending sequence; diff --git a/docs/datamodel/access_policies.rst b/docs/datamodel/access_policies.rst index 94345b2ec56..f2444ef7192 100644 --- a/docs/datamodel/access_policies.rst +++ b/docs/datamodel/access_policies.rst @@ -16,18 +16,6 @@ row-level security. Let's start with a simple schema for a blog without any access policies. -.. code-block:: sdl - :version-lt: 3.0 - - type User { - required property email -> str { constraint exclusive; } - } - - type BlogPost { - required property title -> str; - required link author -> User; - } - .. code-block:: sdl type User { @@ -71,24 +59,6 @@ context-specific: the same user who can access certain content in one country might not be able to in another country due to different legal frameworks (such as copyright length). -.. code-block:: sdl-diff - :version-lt: 3.0 - - + scalar type Country extending enum; - + global current_user -> uuid; - + required global current_country -> Country { - + default := Country.None - + } - - type User { - required property email -> str { constraint exclusive; } - } - - type BlogPost { - required property title -> str; - required link author -> User; - } - .. code-block:: sdl-diff + scalar type Country extending enum; @@ -203,35 +173,6 @@ Defining a policy Let's add two policies to our sample schema. -.. code-block:: sdl-diff - :version-lt: 3.0 - - global current_user -> uuid; - required global current_country -> Country { - default := Country.None - } - scalar type Country extending enum; - - type User { - required property email -> str { constraint exclusive; } - } - - type BlogPost { - required property title -> str; - required link author -> User; - - + access policy author_has_full_access - + allow all - + using (global current_user ?= .author.id - + and global current_country ?= Country.Full) { - + errmessage := "User does not have full access"; - + } - + access policy author_has_read_access - + allow select - + using (global current_user ?= .author.id - + and global current_country ?= Country.ReadOnly); - } - .. code-block:: sdl-diff global current_user: uuid; @@ -446,32 +387,6 @@ policies. This means that they can affect each other in various ways. Because of this, great care needs to be taken when creating access policies based on objects other than the ones they are defined on. For example: -.. code-block:: sdl - :version-lt: 3.0 - - global current_user_id -> uuid; - global current_user := ( - select User filter .id = global current_user_id - ); - - type User { - required property email -> str { constraint exclusive; } - required property is_admin -> bool { default := false }; - - access policy admin_only - allow all - using (global current_user.is_admin ?? false); - } - - type BlogPost { - required property title -> str; - link author -> User; - - access policy author_has_full_access - allow all - using (global current_user ?= .author.id); - } - .. code-block:: sdl global current_user_id: uuid; @@ -609,28 +524,6 @@ Examples Blog posts are publicly visible if ``published`` but only writable by the author. -.. code-block:: sdl-diff - :version-lt: 3.0 - - global current_user -> uuid; - - type User { - required property email -> str { constraint exclusive; } - } - - type BlogPost { - required property title -> str; - required link author -> User; - + required property published -> bool { default := false }; - - access policy author_has_full_access - allow all - using (global current_user ?= .author.id); - + access policy visible_if_published - + allow select - + using (.published); - } - .. code-block:: sdl-diff global current_user: uuid; @@ -654,28 +547,6 @@ author. Blog posts are visible to friends but only modifiable by the author. -.. code-block:: sdl-diff - :version-lt: 3.0 - - global current_user -> uuid; - - type User { - required property email -> str { constraint exclusive; } - + multi link friends -> User; - } - - type BlogPost { - required property title -> str; - required link author -> User; - - access policy author_has_full_access - allow all - using (global current_user ?= .author.id); - + access policy friends_can_read - + allow select - + using ((global current_user in .author.friends.id) ?? false); - } - .. code-block:: sdl-diff global current_user: uuid; @@ -700,28 +571,6 @@ Blog posts are visible to friends but only modifiable by the author. Blog posts are publicly visible except to users that have been ``blocked`` by the author. -.. code-block:: sdl-diff - :version-lt: 3.0 - - type User { - required property email -> str { constraint exclusive; } - + multi link blocked -> User; - } - - type BlogPost { - required property title -> str; - required link author -> User; - - access policy author_has_full_access - allow all - using (global current_user ?= .author.id); - + access policy anyone_can_read - + allow select; - + access policy exclude_blocked - + deny select - + using ((global current_user in .author.blocked.id) ?? false); - } - .. code-block:: sdl-diff type User { @@ -746,28 +595,6 @@ the author. "Disappearing" posts that become invisible after 24 hours. -.. code-block:: sdl-diff - :version-lt: 3.0 - - type User { - required property email -> str { constraint exclusive; } - } - - type BlogPost { - required property title -> str; - required link author -> User; - + required property created_at -> datetime { - + default := datetime_of_statement() # non-volatile - + } - - access policy author_has_full_access - allow all - using (global current_user ?= .author.id); - + access policy hide_after_24hrs - + allow select - + using (datetime_of_statement() - .created_at < '24 hours'); - } - .. code-block:: sdl-diff type User { @@ -805,46 +632,6 @@ will be rolled back. Here's a policy that limits the number of blog posts a ``User`` can post. -.. code-block:: sdl-diff - :version-lt: 3.0 - - type User { - required property email -> str { constraint exclusive; } - + multi link posts := . str; - required link author -> User; - - access policy author_has_full_access - allow all - using (global current_user ?= .author.id); - + access policy max_posts_limit - + deny insert - + using (count(.author.posts) > 500); - } - -.. code-block:: sdl-diff - :version-lt: 4.0 - - type User { - required email: str { constraint exclusive; } - + multi link posts := . 500); - } - .. code-block:: sdl-diff type User { diff --git a/docs/datamodel/aliases.rst b/docs/datamodel/aliases.rst index dc577b5ade3..fc56a1dd911 100644 --- a/docs/datamodel/aliases.rst +++ b/docs/datamodel/aliases.rst @@ -16,7 +16,7 @@ An **alias** is a *pointer* to a set of values. This set is defined with an arbitrary EdgeQL expression. Like computed properties, this expression is evaluated on the fly whenever the -alias is referenced in a query. Unlike computed properties, aliases are +alias is referenced in a query. Unlike computed properties, aliases are defined independent of an object type; they are standalone expressions. As such, aliases are fairly open ended. Some examples are: @@ -41,17 +41,6 @@ of all User objects*. After declaring the alias below, you can use ``User`` and Object type aliases can include a *shape* that declare additional computed properties or links. -.. code-block:: sdl - :version-lt: 3.0 - - type Post { - required property title -> str; - } - - alias PostAlias := Post { - trimmed_title := str_trim(.title) - } - .. code-block:: sdl type Post { @@ -70,34 +59,6 @@ referenced in queries just like any other type. Aliases can correspond to any arbitrary EdgeQL expression, including entire queries. -.. code-block:: sdl - :version-lt: 3.0 - - # Tuple alias - alias Color := ("Purple", 128, 0, 128); - - # Named tuple alias - alias GameInfo := ( - name := "Li Europan Lingues", - country := "Iceland", - date_published := 2023, - creators := ( - (name := "Bob Bobson", age := 20), - (name := "Trina Trinadóttir", age := 25), - ), - ); - - type BlogPost { - required property title -> str; - required property is_published -> bool; - } - - # Query alias - alias PublishedPosts := ( - select BlogPost - filter .is_published = true - ); - .. code-block:: sdl # Tuple alias diff --git a/docs/datamodel/annotations.rst b/docs/datamodel/annotations.rst index dd67a3f2284..4983081d205 100644 --- a/docs/datamodel/annotations.rst +++ b/docs/datamodel/annotations.rst @@ -23,18 +23,6 @@ The following are the annotations which can be set on any schema item: For example, consider the following declaration: -.. code-block:: sdl - :version-lt: 3.0 - - type Status { - annotation title := 'Activity status'; - annotation description := 'All possible user activities'; - - required property name -> str { - constraint exclusive - } - } - .. code-block:: sdl type Status { diff --git a/docs/datamodel/comparison.rst b/docs/datamodel/comparison.rst index 901bd4966a1..2dc778df388 100644 --- a/docs/datamodel/comparison.rst +++ b/docs/datamodel/comparison.rst @@ -36,18 +36,6 @@ to query across tables. In |Gel|, connections between tables are represented with :ref:`Links `. -.. code-block:: sdl - :version-lt: 3.0 - - type Movie { - required property title -> str; - required link director -> Person; - } - - type Person { - required property name -> str; - } - .. code-block:: sdl type Movie { diff --git a/docs/datamodel/computeds.rst b/docs/datamodel/computeds.rst index 9cc0ba34aea..8562f92f53b 100644 --- a/docs/datamodel/computeds.rst +++ b/docs/datamodel/computeds.rst @@ -60,24 +60,6 @@ However, explicitly using ``__source__`` is optional here; inside the scope of an object type declaration, you can omit it entirely and use the ``.`` shorthand. -.. code-block:: sdl - :version-lt: 3.0 - - type Person { - property first_name -> str; - property last_name -> str; - property full_name := .first_name ++ ' ' ++ .last_name; - } - -.. code-block:: sdl - :version-lt: 4.0 - - type Person { - first_name: str; - last_name: str; - property full_name := .first_name ++ ' ' ++ .last_name; - } - .. code-block:: sdl type Person { @@ -96,26 +78,6 @@ makes the schema more readable and acts as a sanity check: if the provided EdgeQL expression disagrees with the modifiers, an error will be thrown the next time you try to :ref:`create a migration `. -.. code-block:: sdl - :version-lt: 3.0 - - type Person { - property first_name -> str; - - # this is invalid, because first_name is not a required property - required property first_name_upper := str_upper(.first_name); - } - -.. code-block:: sdl - :version-lt: 4.0 - - type Person { - first_name: str; - - # this is invalid, because first_name is not a required property - required property first_name_upper := str_upper(.first_name); - } - .. code-block:: sdl type Person { @@ -134,36 +96,6 @@ Filtering If you find yourself writing the same ``filter`` expression repeatedly in queries, consider defining a computed field that encapsulates the filter. -.. code-block:: sdl - :version-lt: 3.0 - - type Club { - multi link members -> Person; - multi link active_members := ( - select .members filter .is_active = true - ) - } - - type Person { - property name -> str; - property is_active -> bool; - } - -.. code-block:: sdl - :version-lt: 4.0 - - type Club { - multi members: Person; - multi link active_members := ( - select .members filter .is_active = true - ) - } - - type Person { - name: str; - is_active: bool; - } - .. code-block:: sdl type Club { @@ -187,32 +119,6 @@ Backlinks are one of the most common use cases for computed links. In |Gel| links are *directional*; they have a source and a target. Often it's convenient to traverse a link in the *reverse* direction. -.. code-block:: sdl - :version-lt: 3.0 - - type BlogPost { - property title -> str; - link author -> User; - } - - type User { - property name -> str; - multi link blog_posts := .`, Below is a simple property constraint. -.. code-block:: sdl - :version-lt: 3.0 - - type User { - required property username -> str { - constraint exclusive; - } - } - .. code-block:: sdl type User { @@ -53,19 +44,6 @@ Constraints on properties The ``max_len_value`` constraint below uses the built-in :eql:func:`len` function, which returns the length of a string. -.. code-block:: sdl - :version-lt: 3.0 - - type User { - required property username -> str { - # usernames must be unique - constraint exclusive; - - # max length (built-in) - constraint max_len_value(25); - }; - } - .. code-block:: sdl type User { @@ -85,16 +63,6 @@ The ``expression`` constraint is used to define custom constraint logic. Inside custom constraints, the keyword ``__subject__`` can used to reference the *value* being constrained. -.. code-block:: sdl - :version-lt: 3.0 - - type User { - required property username -> str { - # max length (as custom constraint) - constraint expression on (len(__subject__) <= 25); - }; - } - .. code-block:: sdl type User { @@ -118,18 +86,6 @@ constraint logic must reference multiple links or properties. refer to properties with the :ref:`leading dot notation ` (e.g. ``.``). -.. code-block:: sdl - :version-lt: 3.0 - - type ConstrainedVector { - required property x -> float64; - required property y -> float64; - - constraint expression on ( - .x ^ 2 + .y ^ 2 <= 25 - ); - } - .. code-block:: sdl type ConstrainedVector { @@ -145,18 +101,6 @@ Note that the constraint expression cannot contain arbitrary EdgeQL! Due to how constraints are implemented, you can only reference ``single`` (non-multi) properties and links defined on the object type. -.. code-block:: sdl - :version-lt: 3.0 - - # Not valid! - type User { - required property username -> str; - multi link friends -> User; - - # ❌ constraints cannot contain paths with more than one hop - constraint expression on ('bob' in .friends.username); - } - .. code-block:: sdl # Not valid! @@ -173,26 +117,6 @@ Computed constraints Constraints can be defined on computed properties. -.. code-block:: sdl - :version-lt: 3.0 - - type User { - required property username -> str; - required property clean_username := str_trim(str_lower(.username)); - - constraint exclusive on (.clean_username); - } - -.. code-block:: sdl - :version-lt: 4.0 - - type User { - required username: str; - required property clean_username := str_trim(str_lower(.username)); - - constraint exclusive on (.clean_username); - } - .. code-block:: sdl type User { @@ -211,20 +135,6 @@ Composite constraints To define a composite constraint, create an ``exclusive`` constraint on a tuple of properties or links. -.. code-block:: sdl - :version-lt: 3.0 - - type User { - property username -> str; - } - - type BlogPost { - property title -> str; - link author -> User; - - constraint exclusive on ((.title, .author)); - } - .. code-block:: sdl type User { @@ -250,17 +160,6 @@ Partial constraints Constraints on object types can be made partial, so that they don't apply when some condition holds. -.. code-block:: sdl - :version-lt: 3.0 - - type User { - required property username -> str; - property deleted -> bool; - - # Usernames must be unique unless marked deleted - constraint exclusive on (.username) except (.deleted); - } - .. code-block:: sdl type User { @@ -280,19 +179,6 @@ Constraints on links You can constrain links such that a given object can only be linked once by using :eql:constraint:`exclusive`: -.. code-block:: sdl - :version-lt: 3.0 - - type User { - required property name -> str; - - # Make sure none of the "owned" items belong - # to any other user. - multi link owns -> Item { - constraint exclusive; - } - } - .. code-block:: sdl type User { @@ -311,19 +197,6 @@ Link property constraints You can also add constraints for :ref:`link properties `: -.. code-block:: sdl - :version-lt: 3.0 - - type User { - property name -> str; - multi link friends -> User { - single property strength -> float64; - constraint expression on ( - @strength >= 0 - ); - } - } - .. code-block:: sdl type User { @@ -428,17 +301,6 @@ If you define a constraint on a type and then extend that type, the constraint will *not* be applied individually to each extending type. Instead, it will apply globally across all the types that inherited the constraint. -.. code-block:: sdl - :version-lt: 3.0 - - type User { - required property name -> str { - constraint exclusive; - } - } - type Administrator extending User; - type Moderator extending User; - .. code-block:: sdl type User { @@ -480,17 +342,6 @@ inheriting types by prepending the ``delegated`` keyword to the constraint. The constraint would then be applied just as if it were declared individually on each of the inheriting types. -.. code-block:: sdl - :version-lt: 3.0 - - type User { - required property name -> str { - delegated constraint exclusive; - } - } - type Administrator extending User; - type Moderator extending User; - .. code-block:: sdl type User { diff --git a/docs/datamodel/globals.rst b/docs/datamodel/globals.rst index c3eed5fb887..77f9173a718 100644 --- a/docs/datamodel/globals.rst +++ b/docs/datamodel/globals.rst @@ -10,11 +10,6 @@ Globals Schemas can contain scalar-typed *global variables*. -.. code-block:: sdl - :version-lt: 3.0 - - global current_user_id -> uuid; - .. code-block:: sdl global current_user_id: uuid; @@ -137,13 +132,6 @@ Cardinality Global variables can be marked ``required``; in this case, you must specify a default value. -.. code-block:: sdl - :version-lt: 3.0 - - required global one_string -> str { - default := "Hi Mom!" - }; - .. code-block:: sdl required global one_string: str { @@ -169,19 +157,6 @@ type is inferred from the computed expression. Computed globals are not subject to the same constraints as non-computed ones; specifically, they can be object-typed and have a ``multi`` cardinality. -.. code-block:: sdl - :version-lt: 3.0 - - global current_user_id -> uuid; - - # object-typed global - global current_user := ( - select User filter .id = global current_user_id - ); - - # multi global - global current_user_friends := (global current_user).friends; - .. code-block:: sdl global current_user_id: uuid; @@ -224,23 +199,6 @@ Usage in schema Unlike query parameters, globals can be referenced *inside your schema declarations*. -.. code-block:: sdl - :version-lt: 3.0 - - type User { - property name -> str; - property is_self := (.id = global current_user_id) - }; - - -.. code-block:: sdl - :version-lt: 4.0 - - type User { - name: str; - property is_self := (.id = global current_user_id) - }; - .. code-block:: sdl type User { @@ -251,14 +209,6 @@ Unlike query parameters, globals can be referenced This is particularly useful when declaring :ref:`access policies `. -.. code-block:: sdl - :version-lt: 3.0 - - type Person { - required property name -> str; - access policy my_policy allow all using (.id = global current_user_id); - } - .. code-block:: sdl type Person { diff --git a/docs/datamodel/indexes.rst b/docs/datamodel/indexes.rst index e2a3ce5c093..1b9def1b21f 100644 --- a/docs/datamodel/indexes.rst +++ b/docs/datamodel/indexes.rst @@ -39,14 +39,6 @@ Index on a property Below, we are referencing the ``User.name`` property with the :ref:`dot notation shorthand `: ``.name``. -.. code-block:: sdl - :version-lt: 3.0 - - type User { - required property name -> str; - index on (.name); - } - .. code-block:: sdl type User { @@ -82,15 +74,6 @@ references multiple properties of the enclosing object type. A singleton expression is an expression that's guaranteed to return *at most one* element. As such, you can't index on a ``multi`` property. -.. code-block:: sdl - :version-lt: 3.0 - - type User { - required property first_name -> str; - required property last_name -> str; - index on (str_lower(.firstname + ' ' + .lastname)); - } - .. code-block:: sdl type User { @@ -120,15 +103,6 @@ speed up queries that filter, order, or group on both properties. In Gel, this index is created by indexing on a ``tuple`` of properties. -.. code-block:: sdl - :version-lt: 3.0 - - type User { - required property name -> str; - required property email -> str; - index on ((.name, .email)); - } - .. code-block:: sdl type User { @@ -145,18 +119,6 @@ Index on a link property Link properties can also be indexed. -.. code-block:: sdl - :version-lt: 3.0 - - abstract link friendship { - property strength -> float64; - index on (__subject__@strength); - } - - type User { - multi link friends extending friendship -> User; - } - .. code-block:: sdl abstract link friendship { @@ -213,16 +175,6 @@ Annotate an index Indexes can be augmented with annotations. -.. code-block:: sdl - :version-lt: 3.0 - - type User { - property name -> str; - index on (.name) { - annotation description := 'Indexing all users by name.'; - }; - } - .. code-block:: sdl type User { diff --git a/docs/datamodel/inheritance.rst b/docs/datamodel/inheritance.rst index 8fe23c8ff41..fb9d77ace25 100644 --- a/docs/datamodel/inheritance.rst +++ b/docs/datamodel/inheritance.rst @@ -29,17 +29,6 @@ Object types can *extend* other object types. The extending type (AKA the *subtype*) inherits all links, properties, indexes, constraints, etc. from its *supertypes*. -.. code-block:: sdl - :version-lt: 3.0 - - abstract type Animal { - property species -> str; - } - - type Dog extending Animal { - property breed -> str; - } - .. code-block:: sdl abstract type Animal { @@ -59,21 +48,6 @@ and can be inserted, which was not the case in the example above. The new ``CanBark`` type however is abstract and thus the database will not have any individual ``CanBark`` objects. -.. code-block:: sdl - :version-lt: 3.0 - - abstract type CanBark { - required property bark_sound -> str; - } - - type Animal { - property species -> str; - } - - type Dog extending Animal, CanBark { - property breed -> str; - } - .. code-block:: sdl abstract type CanBark { @@ -104,22 +78,6 @@ than one type ` — that's called *multiple inheritance*. This mechanism allows building complex object types out of combinations of more basic types. -.. code-block:: sdl - :version-lt: 3.0 - - abstract type HasName { - property first_name -> str; - property last_name -> str; - } - - abstract type HasEmail { - property email -> str; - } - - type Person extending HasName, HasEmail { - property profession -> str; - } - .. code-block:: sdl abstract type HasName { @@ -147,21 +105,6 @@ An object type can overload an inherited property or link. All overloaded declarations must be prefixed with the ``overloaded`` prefix to avoid unintentional overloads. -.. code-block:: sdl - :version-lt: 3.0 - - abstract type Person { - property name -> str; - multi link friends -> Person; - } - - type Student extending Person { - overloaded property name -> str { - constraint exclusive; - } - overloaded multi link friends -> Student; - } - .. code-block:: sdl abstract type Person { @@ -206,18 +149,6 @@ It's possible to define ``abstract`` links that aren't tied to a particular *source* or *target*. Abstract links can be marked as readonly and contain annotations, property declarations, constraints, and indexes. -.. code-block:: sdl - :version-lt: 3.0 - - abstract link link_with_strength { - property strength -> float64; - index on (__subject__@strength); - } - - type Person { - multi link friends extending link_with_strength -> Person; - } - .. code-block:: sdl abstract link link_with_strength { @@ -239,21 +170,6 @@ Constraints Use ``abstract`` to declare reusable, user-defined constraint types. -.. code-block:: sdl - :version-lt: 3.0 - - abstract constraint in_range(min: anyreal, max: anyreal) { - errmessage := - 'Value must be in range [{min}, {max}].'; - using (min <= __subject__ and __subject__ < max); - } - - type Player { - property points -> int64 { - constraint in_range(0, 100); - } - } - .. code-block:: sdl abstract constraint in_range(min: anyreal, max: anyreal) { diff --git a/docs/datamodel/introspection/objects.rst b/docs/datamodel/introspection/objects.rst index 825469fe146..d62f18c3bae 100644 --- a/docs/datamodel/introspection/objects.rst +++ b/docs/datamodel/introspection/objects.rst @@ -46,23 +46,6 @@ Introspection of the ``schema::ObjectType``: Consider the following schema: -.. code-block:: sdl - :version-lt: 3.0 - - abstract type Addressable { - property address -> str; - } - - type User extending Addressable { - # define some properties and a link - required property name -> str; - - multi link friends -> User; - - # define an index for User based on name - index on (.name); - } - .. code-block:: sdl abstract type Addressable { diff --git a/docs/datamodel/links.rst b/docs/datamodel/links.rst index bc5692c12da..3f42a56d956 100644 --- a/docs/datamodel/links.rst +++ b/docs/datamodel/links.rst @@ -12,13 +12,6 @@ types `. Defining links -------------- -.. code-block:: sdl - :version-lt: 3.0 - - type Person { - link best_friend -> Person; - } - .. code-block:: sdl type Person { @@ -37,13 +30,6 @@ All links have a cardinality: either ``single`` or ``multi``. The default is ``single`` (a "to-one" link). Use the ``multi`` keyword to declare a "to-many" link. -.. code-block:: sdl - :version-lt: 3.0 - - type Person { - multi link friends -> Person; - } - .. code-block:: sdl type Person { @@ -54,17 +40,6 @@ On the other hand, backlinks work in reverse to find objects that link to the object, and thus assume ``multi`` as a default. Use the ``single`` keyword to declare a "to-one" backlink. -.. code-block:: sdl - :version-lt: 4.0 - - type Author { - link posts := . Person; - } - .. code-block:: sdl type Person { @@ -102,17 +70,6 @@ scenario, every ``Person`` must have *exactly one* ``best_friend``: Links with cardinality ``multi`` can also be ``required``; ``required multi`` links must point to *at least one* target object. -.. code-block:: sdl - :version-lt: 3.0 - - type Person { - property name -> str; - } - - type GroupChat { - required multi link members -> Person; - } - .. code-block:: sdl type Person { @@ -134,19 +91,6 @@ Exclusive constraints You can add an ``exclusive`` constraint to a link to guarantee that no other instances can link to the same target(s). -.. code-block:: sdl - :version-lt: 3.0 - - type Person { - property name -> str; - } - - type GroupChat { - required multi link members -> Person { - constraint exclusive; - } - } - .. code-block:: sdl type Person { @@ -203,18 +147,6 @@ Many-to-one relationships typically represent concepts like ownership, membership, or hierarchies. For example, ``Person`` and ``Shirt``. One person may own many shirts, and a shirt is (usually) owned by just one person. -.. code-block:: sdl - :version-lt: 3.0 - - type Person { - required property name -> str - } - - type Shirt { - required property color -> str; - link owner -> Person; - } - .. code-block:: sdl type Person { @@ -245,21 +177,6 @@ Conceptually, one-to-many and many-to-one relationships are identical; the "directionality" of a relation is just a matter of perspective. Here, the same "shirt owner" relationship is represented with a ``multi`` link. -.. code-block:: sdl - :version-lt: 3.0 - - type Person { - required property name -> str; - multi link shirts -> Shirt { - # ensures a one-to-many relationship - constraint exclusive; - } - } - - type Shirt { - required property color -> str; - } - .. code-block:: sdl type Person { @@ -303,17 +220,6 @@ table `_, whereas a computed backlink on the other. This is marginally more efficient and generally recommended when modeling 1:N relations: - .. code-block:: sdl - :version-lt: 4.0 - - type Post { - required author: User; - } - - type User { - multi link posts := (. str; - link assigned_space -> ParkingSpace { - constraint exclusive; - } - } - - type ParkingSpace { - required property number -> int64; - } - .. code-block:: sdl type Employee { @@ -375,17 +267,6 @@ A *many-to-many* relation is the least constrained kind of relationship. There is no exclusivity or cardinality constraints in either direction. As an example consider a simple app where a ``User`` can "like" their favorite ``Movies``. -.. code-block:: sdl - :version-lt: 3.0 - - type User { - required property name -> str; - multi link likes -> Movie; - } - type Movie { - required property title -> str; - } - .. code-block:: sdl type User { @@ -405,19 +286,6 @@ constraint, each movie can be liked by multiple users. Thus this is a Links are always distinct. That means it's not possible to link the same objects twice. - .. code-block:: sdl - :version-lt: 3.0 - - type User { - required property name -> str; - multi link watch_history -> Movie { - seen_at: datetime; - }; - } - type Movie { - required property title -> str; - } - .. code-block:: sdl type User { @@ -434,19 +302,6 @@ constraint, each movie can be liked by multiple users. Thus this is a might change your ``seen_at`` link property to an array to store multiple watch times. - .. code-block:: sdl - :version-lt: 3.0 - - type User { - required property name -> str; - multi link watch_history -> Movie { - seen_at: array; - }; - } - type Movie { - required property title -> str; - } - .. code-block:: sdl type User { @@ -462,38 +317,6 @@ constraint, each movie can be liked by multiple users. Thus this is a Alternatively, the watch history could be modeled more traditionally as its own type. - .. code-block:: sdl - :version-lt: 3.0 - - type User { - required property name -> str; - multi link watch_history := . User; - required link movie -> Movie; - property seen_at -> datetime; - } - - .. code-block:: sdl - :version-lt: 4.0 - - type User { - required name: str; - multi link watch_history := . str; - multi link friends -> Person { - default := (select Person order by random() limit 3); - } - } - .. code-block:: sdl type Person { @@ -579,16 +392,6 @@ Like object types, links in Gel can contain **properties**. Link properties can be used to store metadata about links, such as *when* they were created or the *nature/strength* of the relationship. -.. code-block:: sdl - :version-lt: 3.0 - - type Person { - property name -> str; - multi link family_members -> Person { - property relationship -> str; - } - } - .. code-block:: sdl type Person { @@ -610,16 +413,6 @@ the *nature/strength* of the relationship. That means this would not work: - .. code-block:: - :version-lt: 3.0 - - type Person { - property name -> str; - multi link friends -> Person { - link introduced_by -> Person; - } - } - .. code-block:: type Person { @@ -812,20 +605,6 @@ Target deletion policies determine what action should be taken when the *target* of a given link is deleted. They are declared with the ``on target delete`` clause. -.. code-block:: sdl - :version-lt: 3.0 - - type MessageThread { - property title -> str; - } - - type Message { - property content -> str; - link chat -> MessageThread { - on target delete delete source; - } - } - .. code-block:: sdl type MessageThread { @@ -880,20 +659,6 @@ There are 3 available source deletion policies: object is unconditionally deleted unless the target object is linked to by another source object via the same link. -.. code-block:: sdl - :version-lt: 3.0 - - type MessageThread { - property title -> str; - multi link messages -> Message { - on source delete delete target; - } - } - - type Message { - property content -> str; - } - .. code-block:: sdl type MessageThread { @@ -914,17 +679,6 @@ To avoid deleting a ``Message`` that is linked to by other ``MessageThread`` objects via their ``message`` link, append ``if orphan`` to that link's deletion policy. -.. code-block:: sdl-diff - :version-lt: 3.0 - - type MessageThread { - property title -> str; - multi link messages -> Message { - - on source delete delete target; - + on source delete delete target if orphan; - } - } - .. code-block:: sdl-diff type MessageThread { @@ -1006,21 +760,6 @@ Polymorphic links Links can have ``abstract`` targets, in which case the link is considered **polymorphic**. Consider the following schema: -.. code-block:: sdl - :version-lt: 3.0 - - abstract type Person { - property name -> str; - } - - type Hero extending Person { - # additional fields - } - - type Villain extending Person { - # additional fields - } - .. code-block:: sdl abstract type Person { @@ -1039,14 +778,6 @@ The ``abstract`` type ``Person`` has two concrete subtypes: ``Hero`` and ``Villain``. Despite being abstract, ``Person`` can be used as a link target in concrete object types. -.. code-block:: sdl - :version-lt: 3.0 - - type Movie { - property title -> str; - multi link characters -> Person; - } - .. code-block:: sdl type Movie { @@ -1070,18 +801,6 @@ It's possible to define ``abstract`` links that aren't tied to a particular of properties, annotations, constraints, or indexes, abstract links can be used to eliminate repetitive SDL. -.. code-block:: sdl - :version-lt: 3.0 - - abstract link link_with_strength { - property strength -> float64; - index on (__subject__@strength); - } - - type Person { - multi link friends extending link_with_strength -> Person; - } - .. code-block:: sdl abstract link link_with_strength { diff --git a/docs/datamodel/objects.rst b/docs/datamodel/objects.rst index a55864a9c14..c641e2eba83 100644 --- a/docs/datamodel/objects.rst +++ b/docs/datamodel/objects.rst @@ -14,13 +14,6 @@ Properties are used to attach primitive data to an object type. For the full documentation on properties, see :ref:`Properties `. -.. code-block:: sdl - :version-lt: 3.0 - - type Person { - property email -> str; - } - .. code-block:: sdl type Person { @@ -30,13 +23,6 @@ see :ref:`Properties `. Links are used to define relationships between object types. For the full documentation on links, see :ref:`Links `. -.. code-block:: sdl - :version-lt: 3.0 - - type Person { - link best_friend -> Person; - } - .. code-block:: sdl type Person { @@ -64,14 +50,6 @@ types are non-abstract. You can't create or store instances of abstract types, but they're a useful way to share functionality and structure among other object types. -.. code-block:: sdl - :version-lt: 3.0 - - abstract type HasName { - property first_name -> str; - property last_name -> str; - } - .. code-block:: sdl abstract type HasName { @@ -92,17 +70,6 @@ Object types can *extend* other object types. The extending type (AKA the *subtype*) inherits all links, properties, indexes, constraints, etc. from its *supertypes*. -.. code-block:: sdl - :version-lt: 3.0 - - abstract type Animal { - property species -> str; - } - - type Dog extending Animal { - property breed -> str; - } - .. code-block:: sdl abstract type Animal { @@ -123,22 +90,6 @@ than one type ` — that's called *multiple inheritance*. This mechanism allows building complex object types out of combinations of more basic types. -.. code-block:: sdl - :version-lt: 3.0 - - abstract type HasName { - property first_name -> str; - property last_name -> str; - } - - abstract type HasEmail { - property email -> str; - } - - type Person extending HasName, HasEmail { - property profession -> str; - } - .. code-block:: sdl abstract type HasName { diff --git a/docs/datamodel/primitives.rst b/docs/datamodel/primitives.rst index 24290e8af37..62ab50c48ea 100644 --- a/docs/datamodel/primitives.rst +++ b/docs/datamodel/primitives.rst @@ -27,15 +27,6 @@ Enums To represent an enum, declare a custom scalar that extends the abstract :ref:`enum ` type. -.. code-block:: sdl - :version-lt: 3.0 - - scalar type Color extending enum; - - type Shirt { - property color -> Color; - } - .. code-block:: sdl scalar type Color extending enum; @@ -60,20 +51,6 @@ Arrays Arrays store zero or more primitive values of the same type in an ordered list. Arrays cannot contain object types or other arrays. -.. code-block:: sdl - :version-lt: 3.0 - - type Person { - property str_array -> array; - property json_array -> array; - - # INVALID: arrays of object types not allowed - # property friends -> array - - # INVALID: arrays cannot be nested - # property nested_array -> array> - } - .. code-block:: sdl type Person { @@ -99,17 +76,6 @@ Like arrays, tuples are ordered sequences of primitive data. Unlike arrays, each element of a tuple can have a distinct type. Tuple elements can be *any type*, including primitives, objects, arrays, and other tuples. -.. code-block:: sdl - :version-lt: 3.0 - - type Person { - - property unnamed_tuple -> tuple; - property nested_tuple -> tuple>>; - property tuple_of_arrays -> tuple, array>; - - } - .. code-block:: sdl type Person { @@ -124,13 +90,6 @@ Optionally, you can assign a *key* to each element of the tuple. Tuples containing explicit keys are known as *named tuples*. You must assign keys to all elements (or none of them). -.. code-block:: sdl - :version-lt: 3.0 - - type BlogPost { - property metadata -> tuple; - } - .. code-block:: sdl type BlogPost { @@ -168,13 +127,6 @@ some scalar types have corresponding range types: - ``range`` - ``range`` -.. code-block:: sdl - :version-lt: 3.0 - - type DieRoll { - property values -> range; - } - .. code-block:: sdl type DieRoll { @@ -193,14 +145,6 @@ initializes a global ``int64`` counter that auto-increments whenever a new object is created. All properties that point to the same sequence type will share the counter. -.. code-block:: sdl - :version-lt: 3.0 - - scalar type ticket_number extending sequence; - type Ticket { - property number -> ticket_number; - } - .. code-block:: sdl scalar type ticket_number extending sequence; diff --git a/docs/datamodel/properties.rst b/docs/datamodel/properties.rst index 1f1470c7ed5..59c3071c860 100644 --- a/docs/datamodel/properties.rst +++ b/docs/datamodel/properties.rst @@ -9,16 +9,6 @@ Properties Properties are used to associate primitive data with an :ref:`object type ` or :ref:`link `. - -.. code-block:: sdl - :version-lt: 3.0 - - type Player { - property email -> str; - property points -> int64; - property is_online -> bool; - } - .. code-block:: sdl type Player { @@ -41,13 +31,6 @@ Required properties Properties can be either ``optional`` (the default) or ``required``. -.. code-block:: sdl - :version-lt: 3.0 - - type User { - required property email -> str; - } - .. code-block:: sdl type User { @@ -65,22 +48,6 @@ Properties have a **cardinality**, either ``single`` (the default) or ``multi``. A ``multi`` property of type ``str`` points to an *unordered set* of strings. -.. code-block:: sdl - :version-lt: 3.0 - - type User { - - # single isn't necessary here - # properties are single by default - single property name -> str; - - # an unordered set of strings - multi property nicknames -> str; - - # an unordered set of string arrays - multi property set_of_arrays -> array; - } - .. code-block:: sdl type User { @@ -114,19 +81,6 @@ Default values Properties can have a default value. This default can be a static value or an arbitrary EdgeQL expression, which will be evaluated upon insertion. -.. code-block:: sdl - :version-lt: 3.0 - - type Player { - required property points -> int64 { - default := 0; - } - - required property latitude -> float64 { - default := (360 * random() - 180); - } - } - .. code-block:: sdl type Player { @@ -148,15 +102,6 @@ Properties can be marked as ``readonly``. In the example below, the ``User.external_id`` property can be set at the time of creation but not modified thereafter. -.. code-block:: sdl - :version-lt: 3.0 - - type User { - required property external_id -> uuid { - readonly := true; - } - } - .. code-block:: sdl type User { @@ -173,27 +118,6 @@ Constraints Properties can be augmented wth constraints. The example below showcases a subset of Gel's built-in constraints. -.. code-block:: sdl - :version-lt: 3.0 - - type BlogPost { - property title -> str { - constraint exclusive; # all post titles must be unique - constraint min_len_value(8); - constraint max_len_value(30); - constraint regexp(r'^[A-Za-z0-9 ]+$'); - } - - property status -> str { - constraint one_of('Draft', 'InReview', 'Published'); - } - - property upvotes -> int64 { - constraint min_value(0); - constraint max_value(9999); - } - } - .. code-block:: sdl type BlogPost { @@ -218,17 +142,6 @@ You can constrain properties with arbitrary :ref:`EdgeQL ` expressions returning ``bool``. To reference the value of the property, use the special scope keyword ``__subject__``. -.. code-block:: sdl - :version-lt: 3.0 - - type BlogPost { - property title -> str { - constraint expression on ( - __subject__ = str_trim(__subject__) - ); - } - } - .. code-block:: sdl type BlogPost { @@ -256,17 +169,6 @@ Properties can contain annotations, small human-readable notes. The built-in annotations are ``title``, ``description``, and ``deprecated``. You may also declare :ref:`custom annotation types `. -.. code-block:: sdl - :version-lt: 3.0 - - type User { - property email -> str { - annotation title := 'Email address'; - annotation description := "The user's email address."; - annotation deprecated := 'Use NewUser instead.'; - } - } - .. code-block:: sdl type User { @@ -287,19 +189,6 @@ Properties can be *concrete* (the default) or *abstract*. Abstract properties are declared independent of a source or target, can contain :ref:`annotations `, and can be marked as ``readonly``. -.. code-block:: sdl - :version-lt: 3.0 - - abstract property email_prop { - annotation title := 'An email address'; - readonly := true; - } - - type Student { - # inherits annotations and "readonly := true" - property email extending email_prop -> str; - } - .. code-block:: sdl abstract property email_prop { diff --git a/docs/edgeql/delete.rst b/docs/edgeql/delete.rst index f2b3a07fbf7..bd1ff829cff 100644 --- a/docs/edgeql/delete.rst +++ b/docs/edgeql/delete.rst @@ -60,18 +60,6 @@ deleted. To avoid this behavior, we could update the ``Movie.characters`` link to use the ``allow`` deletion policy. -.. code-block:: sdl-diff - :version-lt: 3.0 - - type Movie { - required property title -> str { constraint exclusive }; - required property release_year -> int64; - - multi link characters -> Person; - + multi link characters -> Person { - + on target delete allow; - + }; - } - .. code-block:: sdl-diff type Movie { diff --git a/docs/edgeql/insert.rst b/docs/edgeql/insert.rst index e01fc729a52..6e7dbd80883 100644 --- a/docs/edgeql/insert.rst +++ b/docs/edgeql/insert.rst @@ -8,54 +8,6 @@ Insert The ``insert`` command is used to create instances of object types. The code samples on this page assume the following schema: -.. code-block:: sdl - :version-lt: 3.0 - - module default { - abstract type Person { - required property name -> str { constraint exclusive }; - } - - type Hero extending Person { - property secret_identity -> str; - multi link villains := . Hero; - } - - type Movie { - required property title -> str { constraint exclusive }; - required property release_year -> int64; - multi link characters -> Person; - } - } - -.. code-block:: sdl - :version-lt: 4.0 - - module default { - abstract type Person { - required name: str { constraint exclusive }; - } - - type Hero extending Person { - secret_identity: str; - multi link villains := . str; - multi link friends -> User; - } - - type BlogPost { - required property title -> str; - required link author -> User; - } - - type Comment { - required property text -> str; - required link author -> User; - } - .. code-block:: sdl type User { @@ -203,46 +185,6 @@ Syntax Meaning Backlinks can be inserted into a schema with the same format, except that the type name (in this case ``User``) doesn't need to be specified. -.. code-block:: sdl-diff - :version-lt: 3.0 - - type User { - required property email -> str; - multi link friends -> User; - + link all_links := . str; - required link author -> User; - } - type Comment { - required property text -> str; - required link author -> User; - } - -.. code-block:: sdl-diff - :version-lt: 4.0 - - type User { - required email: str; - multi friends: User; - + link all_links := .` with ``@`` notation. To demonstrate this, let's add a property to the ``User. friends`` link: -.. code-block:: sdl-diff - :version-lt: 3.0 - - type User { - required property email -> str; - - multi link friends -> User; - + multi link friends -> User { - + property since -> cal::local_date; - + } - } - .. code-block:: sdl-diff type User { diff --git a/docs/edgeql/select.rst b/docs/edgeql/select.rst index 7b8fa76e1e3..ef68b4b5343 100644 --- a/docs/edgeql/select.rst +++ b/docs/edgeql/select.rst @@ -52,54 +52,6 @@ Selecting objects However most queries are selecting *objects* that live in the database. For demonstration purposes, the queries below assume the following schema: -.. code-block:: sdl - :version-lt: 3.0 - - module default { - abstract type Person { - required property name -> str { constraint exclusive }; - } - - type Hero extending Person { - property secret_identity -> str; - multi link villains := . Hero; - } - - type Movie { - required property title -> str { constraint exclusive }; - required property release_year -> int64; - multi link characters -> Person; - } - } - -.. code-block:: sdl - :version-lt: 4.0 - - module default { - abstract type Person { - required name: str { constraint exclusive }; - } - - type Hero extending Person { - secret_identity: str; - multi link villains := . str { - constraint exclusive; - }; - + multi link movies := . str; - } - - type Movie extending Media { - property release_year -> int64; - } - - type TVShow extending Media { - property num_seasons -> int64; - } - .. code-block:: sdl abstract type Media { diff --git a/docs/guides/migrations/tips.rst b/docs/guides/migrations/tips.rst index 53097e0eef0..6c697ddd753 100644 --- a/docs/guides/migrations/tips.rst +++ b/docs/guides/migrations/tips.rst @@ -15,16 +15,6 @@ events. We'll start with this schema: -.. code-block:: sdl - :version-lt: 3.0 - - type Event { - required property name -> str; - link prev -> Event; - - # ... more properties and links - } - .. code-block:: sdl type Event { @@ -70,26 +60,6 @@ It seems like having a ``next`` link would be useful, too. So we can define it as a computed link by using :ref:`backlink ` notation: -.. code-block:: sdl - :version-lt: 3.0 - - type Event { - required property name -> str; - - link prev -> Event; - link next := . str; - - link prev -> Event { - constraint exclusive; - }; - link next := . str; - } - .. code-block:: sdl type User { @@ -258,13 +197,6 @@ that for a little while we realize that we want to make ``name`` a *required property*. So we make the following change in the schema file: -.. code-block:: sdl - :version-lt: 3.0 - - type User { - required property name -> str; - } - .. code-block:: sdl type User { @@ -309,15 +241,6 @@ Next we realize that we actually want to make names unique, perhaps to avoid confusion or to use them as reliable human-readable identifiers (unlike ``id``). We update the schema again: -.. code-block:: sdl - :version-lt: 3.0 - - type User { - required property name -> str { - constraint exclusive; - } - } - .. code-block:: sdl type User { @@ -435,16 +358,6 @@ character in an adventure game as the type of data we will evolve. Let's start with this schema: -.. code-block:: sdl - :version-lt: 3.0 - - scalar type CharacterClass extending enum; - - type Character { - required property name -> str; - required property class -> CharacterClass; - } - .. code-block:: sdl scalar type CharacterClass extending enum; @@ -488,22 +401,6 @@ This way instead of a property ``class`` we want to end up with a link between the two explicitly. This means that we will need to have both the old and the new "class" information to begin with: -.. code-block:: sdl - :version-lt: 3.0 - - scalar type CharacterClass extending enum; - - type NewClass { - required property name -> str; - multi property skills -> str; - } - - type Character { - required property name -> str; - required property class -> CharacterClass; - link new_class -> NewClass; - } - .. code-block:: sdl scalar type CharacterClass extending enum; @@ -632,19 +529,6 @@ We can see the changes after the data migration is complete: Everything seems to be in order. It is time to clean up the old property and ``CharacterClass`` :eql:type:`enum`: -.. code-block:: sdl - :version-lt: 3.0 - - type NewClass { - required property name -> str; - multi property skills -> str; - } - - type Character { - required property name -> str; - link new_class -> NewClass; - } - .. code-block:: sdl type NewClass { @@ -678,19 +562,6 @@ Now that the original property and scalar type are gone, we can rename the "new" components, so that they become ``class`` link and ``CharacterClass`` type, respectively: -.. code-block:: sdl - :version-lt: 3.0 - - type CharacterClass { - required property name -> str; - multi property skills -> str; - } - - type Character { - required property name -> str; - link class -> CharacterClass; - } - .. code-block:: sdl type CharacterClass { @@ -767,14 +638,6 @@ character in an adventure game as the type of data we will evolve. Let's start with this schema: -.. code-block:: sdl - :version-lt: 3.0 - - type Character { - required property name -> str; - required property description -> str; - } - .. code-block:: sdl type Character { @@ -812,14 +675,6 @@ However, as we keep developing our game it becomes apparent that this is less of a "description" and more of a "character class", so at first we just rename the property to reflect that: -.. code-block:: sdl - :version-lt: 3.0 - - type Character { - required property name -> str; - required property class -> str; - } - .. code-block:: sdl type Character { @@ -909,16 +764,6 @@ As the game becomes more stable there's no reason for the ``class`` to be a :eql:type:`str` anymore, instead we can use an :eql:type:`enum` to make sure that we don't accidentally use some invalid value for it. -.. code-block:: sdl - :version-lt: 3.0 - - scalar type CharacterClass extending enum; - - type Character { - required property name -> str; - required property class -> CharacterClass; - } - .. code-block:: sdl scalar type CharacterClass extending enum; @@ -966,13 +811,6 @@ character in an adventure game as the type of data we will evolve. Let's start with this schema: -.. code-block:: sdl - :version-lt: 3.0 - - type Character { - required property name -> str; - } - .. code-block:: sdl type Character { @@ -1071,19 +909,6 @@ to a link, we will add the ``required link class`` right away, without any intermediate properties. So we end up with a schema like this: -.. code-block:: sdl - :version-lt: 3.0 - - type CharacterClass { - required property name -> str; - multi property skills -> str; - } - - type Character { - required property name -> str; - required link class -> CharacterClass; - } - .. code-block:: sdl type CharacterClass { @@ -1117,19 +942,6 @@ our strategy. We need a separate step where the ``class`` link is not *required* so that we can write some custom queries to handle the character classes: -.. code-block:: sdl - :version-lt: 3.0 - - type CharacterClass { - required property name -> str; - multi property skills -> str; - } - - type Character { - required property name -> str; - link class -> CharacterClass; - } - .. code-block:: sdl type CharacterClass { @@ -1256,19 +1068,6 @@ classes: We're finally ready to make the ``class`` link *required*. We update the schema: -.. code-block:: sdl - :version-lt: 3.0 - - type CharacterClass { - required property name -> str; - multi property skills -> str; - } - - type Character { - required property name -> str; - required link class -> CharacterClass; - } - .. code-block:: sdl type CharacterClass { diff --git a/docs/intro/edgeql.rst b/docs/intro/edgeql.rst index 9fb8b33655c..b7fc846911f 100644 --- a/docs/intro/edgeql.rst +++ b/docs/intro/edgeql.rst @@ -814,21 +814,6 @@ Polymorphic queries Consider the following schema. -.. code-block:: sdl - :version-lt: 3.0 - - abstract type Content { - required property title -> str; - } - - type Movie extending Content { - property release_year -> int64; - } - - type TVShow extending Content { - property num_seasons -> int64; - } - .. code-block:: sdl abstract type Content { diff --git a/docs/intro/quickstart.rst b/docs/intro/quickstart.rst index bcec89d21a0..88e700073f3 100644 --- a/docs/intro/quickstart.rst +++ b/docs/intro/quickstart.rst @@ -248,20 +248,6 @@ Let's build a simple movie database. We'll need to define two **object types** (equivalent to a *table* in SQL): Movie and Person. Open :dotgel:`dbschema/default` in your editor of choice and paste the following: -.. code-block:: sdl - :version-lt: 3.0 - - module default { - type Person { - required property name -> str; - } - - type Movie { - property title -> str; - multi link actors -> Person; - } - }; - .. code-block:: sdl module default { @@ -341,15 +327,6 @@ object types. Before we proceed, let's try making a small change to our schema: making the ``title`` property of ``Movie`` required. First, update the schema file: -.. code-block:: sdl-diff - :version-lt: 3.0 - - type Movie { - - property title -> str; - + required property title -> str; - multi link actors -> Person; - } - .. code-block:: sdl-diff type Movie { diff --git a/docs/intro/schema.rst b/docs/intro/schema.rst index b94dec4b1ea..06ba507a6df 100644 --- a/docs/intro/schema.rst +++ b/docs/intro/schema.rst @@ -68,13 +68,6 @@ Properties Declare a property by naming it and setting its type. -.. code-block:: sdl - :version-lt: 3.0 - - type Movie { - property title -> str; - } - .. code-block:: sdl type Movie { @@ -91,14 +84,6 @@ Required vs optional Properties are optional by default. Use the ``required`` keyword to make them required. -.. code-block:: sdl - :version-lt: 3.0 - - type Movie { - required property title -> str; # required - property release_year -> int64; # optional - } - .. code-block:: sdl type Movie { @@ -114,17 +99,6 @@ Constraints Add a pair of curly braces after the property to define additional information, including constraints. -.. code-block:: sdl - :version-lt: 3.0 - - type Movie { - required property title -> str { - constraint exclusive; - constraint min_len_value(8); - constraint regexp(r'^[A-Za-z0-9 ]+$'); - } - } - .. code-block:: sdl type Movie { @@ -145,22 +119,6 @@ Object types can contain *computed properties* that correspond to EdgeQL expressions. This expression is dynamically computed whenever the property is queried. -.. code-block:: sdl - :version-lt: 3.0 - - type Movie { - required property title -> str; - property uppercase_title := str_upper(.title); - } - -.. code-block:: sdl - :version-lt: 4.0 - - type Movie { - required title: str; - property uppercase_title := str_upper(.title); - } - .. code-block:: sdl type Movie { @@ -175,18 +133,6 @@ Links Object types can have links to other object types. -.. code-block:: sdl - :version-lt: 3.0 - - type Movie { - required property title -> str; - link director -> Person; - } - - type Person { - required property name -> str; - } - .. code-block:: sdl type Movie { @@ -203,22 +149,6 @@ The ``link`` keyword can be omitted for non-computed links since Gel v3. Use the ``required`` and ``multi`` keywords to specify the cardinality of the relation. -.. code-block:: sdl - :version-lt: 3.0 - - type Movie { - required property title -> str; - - link cinematographer -> Person; # zero or one - required link director -> Person; # exactly one - multi link writers -> Person; # zero or more - required multi link actors -> Person; # one or more - } - - type Person { - required property name -> str; - } - .. code-block:: sdl type Movie { @@ -236,21 +166,6 @@ relation. To define a one-to-one relation, use an ``exclusive`` constraint. -.. code-block:: sdl - :version-lt: 3.0 - - type Movie { - required property title -> str; - required link stats -> MovieStats { - constraint exclusive; - }; - } - - type MovieStats { - required property budget -> int64; - required property box_office -> int64; - } - .. code-block:: sdl type Movie { @@ -274,34 +189,6 @@ Objects can contain "computed links": stored expressions that return a set of objects. Computed links are dynamically computed when they are referenced in queries. The example below defines a backlink. -.. code-block:: sdl - :version-lt: 3.0 - - type Movie { - required property title -> str; - multi link actors -> Person; - - # returns all movies with same title - multi link same_title := ( - with t := .title - select detached Movie filter .title = t - ) - } - -.. code-block:: sdl - :version-lt: 4.0 - - type Movie { - required title: str; - multi actors: Person; - - # returns all movies with same title - multi link same_title := ( - with t := .title - select detached Movie filter .title = t - ) - } - .. code-block:: sdl type Movie { @@ -320,32 +207,6 @@ Backlinks A common use case for computed links is *backlinks*. -.. code-block:: sdl - :version-lt: 3.0 - - type Movie { - required property title -> str; - multi link actors -> Person; - } - - type Person { - required property name -> str; - multi link acted_in := . str; - link author -> User; - - constraint exclusive on ((.title, .author)); - } - - .. code-block:: sdl type BlogPost { @@ -402,16 +252,6 @@ Constraints can also be defined at the *object level*. Constraints can contain exceptions; these are called *partial constraints*. -.. code-block:: sdl - :version-lt: 3.0 - - type BlogPost { - property title -> str; - property published -> bool; - - constraint exclusive on (.title) except (not .published); - } - .. code-block:: sdl type BlogPost { @@ -426,18 +266,6 @@ Indexes Use ``index on`` to define indexes on an object type. -.. code-block:: sdl - :version-lt: 3.0 - - type Movie { - required property title -> str; - required property release_year -> int64; - - index on (.title); # simple index - index on ((.title, .release_year)); # composite index - index on (str_trim(str_lower(.title))); # computed index - } - .. code-block:: sdl type Movie { @@ -460,21 +288,6 @@ Schema mixins Object types can be declared as ``abstract``. Non-abstract types can *extend* abstract types. -.. code-block:: sdl - :version-lt: 3.0 - - abstract type Content { - required property title -> str; - } - - type Movie extending Content { - required property release_year -> int64; - } - - type TVShow extending Content { - required property num_seasons -> int64; - } - .. code-block:: sdl abstract type Content { @@ -491,21 +304,6 @@ abstract types. Multiple inheritance is supported. -.. code-block:: sdl - :version-lt: 3.0 - - abstract type HasTitle { - required property title -> str; - } - - abstract type HasReleaseYear { - required property release_year -> int64; - } - - type Movie extending HasTitle, HasReleaseYear { - link sequel_to -> Movie; - } - .. code-block:: sdl abstract type HasTitle { @@ -528,26 +326,6 @@ Polymorphism Links can correspond to abstract types. These are known as *polymorphic links*. -.. code-block:: sdl - :version-lt: 3.0 - - abstract type Content { - required property title -> str; - } - - type Movie extending Content { - required property release_year -> int64; - } - - type TVShow extending Content { - required property num_seasons -> int64; - } - - type Franchise { - required property name -> str; - multi link entries -> Content; - } - .. code-block:: sdl abstract type Content { diff --git a/docs/reference/ddl/access_policies.rst b/docs/reference/ddl/access_policies.rst index 1f06651847b..c9edb3afdd9 100644 --- a/docs/reference/ddl/access_policies.rst +++ b/docs/reference/ddl/access_policies.rst @@ -15,29 +15,6 @@ Create access policy :ref:`Declare ` a new object access policy. -.. eql:synopsis:: - :version-lt: 3.0 - - [ with [, ...] ] - { create | alter } type "{" - [ ... ] - create access policy - [ when () ; ] - { allow | deny } [, ... ; ] - [ using () ; ] - [ "{" - [ set errmessage := value ; ] - [ create annotation annotation-name := value ; ] - "}" ] - "}" - - # where is one of - all - select - insert - delete - update [{ read | write }] - .. eql:synopsis:: [ with [, ...] ] @@ -163,31 +140,6 @@ Alter access policy :ref:`Declare ` a new object access policy. -.. eql:synopsis:: - :version-lt: 3.0 - - [ with [, ...] ] - alter type "{" - [ ... ] - alter access policy "{" - [ when () ; ] - [ reset when ; ] - { allow | deny } [, ... ; ] - [ using () ; ] - [ reset expression ; ] - [ create annotation := ; ] - [ alter annotation := ; ] - [ drop annotation ; ] - "}" - "}" - - # where is one of - all - select - insert - delete - update [{ read | write }] - .. eql:synopsis:: [ with [, ...] ] diff --git a/docs/reference/ddl/triggers.rst b/docs/reference/ddl/triggers.rst index 72789fbf5ce..55e800f4bab 100644 --- a/docs/reference/ddl/triggers.rst +++ b/docs/reference/ddl/triggers.rst @@ -18,17 +18,6 @@ Create trigger :ref:`Define ` a new trigger. -.. eql:synopsis:: - :version-lt: 4.0 - - {create | alter} type "{" - create trigger - after - {insert | update | delete} [, ...] - for {each | all} - do - "}" - .. eql:synopsis:: {create | alter} type "{" diff --git a/docs/reference/edgeql/describe.rst b/docs/reference/edgeql/describe.rst index 438ff82abc2..5d9edc00dc5 100644 --- a/docs/reference/edgeql/describe.rst +++ b/docs/reference/edgeql/describe.rst @@ -115,21 +115,6 @@ Examples Consider the following schema: -.. code-block:: sdl - :version-lt: 3.0 - - abstract type Named { - required property name -> str { - delegated constraint exclusive; - } - } - - type User extending Named { - required property email -> str { - annotation title := 'Contact email'; - } - } - .. code-block:: sdl abstract type Named { diff --git a/docs/reference/edgeql/shapes.rst b/docs/reference/edgeql/shapes.rst index 4038e739745..607918547c4 100644 --- a/docs/reference/edgeql/shapes.rst +++ b/docs/reference/edgeql/shapes.rst @@ -64,14 +64,6 @@ Consider the task of getting "names of users and all of the friends' names associated with the given user" in a database defined by the following schema: -.. code-block:: sdl - :version-lt: 3.0 - - type User { - required property name -> str; - multi link friends -> User; - } - .. code-block:: sdl type User { diff --git a/docs/reference/edgeql/update.rst b/docs/reference/edgeql/update.rst index 4e976cd512f..7d86451ae11 100644 --- a/docs/reference/edgeql/update.rst +++ b/docs/reference/edgeql/update.rst @@ -95,18 +95,6 @@ assignments using ``:=``: For usage of ``+=`` and ``-=`` consider the following ``Post`` type: -.. code-block:: sdl - :version-lt: 3.0 - - # ... Assume some User type is already defined - type Post { - required property title -> str; - required property body -> str; - # A "tags" property containing a set of strings - multi property tags -> str; - link author -> User; - } - .. code-block:: sdl # ... Assume some User type is already defined diff --git a/docs/reference/sdl/access_policies.rst b/docs/reference/sdl/access_policies.rst index c3a19d73c7f..20959b40994 100644 --- a/docs/reference/sdl/access_policies.rst +++ b/docs/reference/sdl/access_policies.rst @@ -13,31 +13,6 @@ Examples Declare a schema where users can only see their own profiles: -.. code-block:: sdl - :version-lt: 3.0 - - # Declare some global variables to store "current user" - # information. - global current_user_id -> uuid; - global current_user := ( - select User filter .id = global current_user_id - ); - - type User { - required property name -> str; - } - - type Profile { - link owner -> User; - - # Only allow reading to the owner, but also - # ensure that a user cannot set the "owner" link - # to anything but themselves. - access policy owner_only - allow all using (.owner = global current_user) - { errmessage := 'Profile may only be accessed by the owner'; } - } - .. code-block:: sdl # Declare some global variables to store "current user" @@ -69,26 +44,6 @@ Syntax Define a new access policy corresponding to the :ref:`more explicit DDL commands `. -.. sdl:synopsis:: - :version-lt: 3.0 - - # Access policy used inside a type declaration: - access policy - [ when () ] - { allow | deny } [, ... ] - [ using () ] - [ "{" - [ errmessage := value ; ] - [ ] - "}" ] ; - - # where is one of - all - select - insert - delete - update [{ read | write }] - .. sdl:synopsis:: # Access policy used inside a type declaration: diff --git a/docs/reference/sdl/annotations.rst b/docs/reference/sdl/annotations.rst index 495c7c4c8a8..d208dc5aebb 100644 --- a/docs/reference/sdl/annotations.rst +++ b/docs/reference/sdl/annotations.rst @@ -19,16 +19,6 @@ Declare a new annotation: Specify the value of an annotation for a type: -.. code-block:: sdl - :version-lt: 3.0 - - type Status { - annotation admin_note := 'system-critical'; - required property name -> str { - constraint exclusive - } - } - .. code-block:: sdl type Status { diff --git a/docs/reference/sdl/constraints.rst b/docs/reference/sdl/constraints.rst index 399ec492d1f..facf917c7ad 100644 --- a/docs/reference/sdl/constraints.rst +++ b/docs/reference/sdl/constraints.rst @@ -32,17 +32,6 @@ Declare a *concrete* constraint on an integer type: Declare a *concrete* constraint on an object type: -.. code-block:: sdl - :version-lt: 3.0 - - type Vector { - required property x -> float64; - required property y -> float64; - constraint expression on ( - __subject__.x^2 + __subject__.y^2 < 25 - ); - } - .. code-block:: sdl type Vector { diff --git a/docs/reference/sdl/index.rst b/docs/reference/sdl/index.rst index b29f0995e0d..b008a32eebb 100644 --- a/docs/reference/sdl/index.rst +++ b/docs/reference/sdl/index.rst @@ -60,24 +60,6 @@ declarations of module blocks or individual items does not matter. The built-in :ref:`migration tools` expect the schema to be given in SDL format. For example: -.. code-block:: sdl - :version-lt: 3.0 - - # "default" module block - module default { - type Movie { - required property title -> str; - # the year of release - property year -> int64; - required link director -> Person; - required multi link actors -> Person; - } - type Person { - required property first_name -> str; - required property last_name -> str; - } - } - .. code-block:: sdl # "default" module block @@ -101,22 +83,6 @@ declarations must use :ref:`fully-qualified names to their respective modules. For example, the following is equivalent to the previous migration: -.. code-block:: sdl - :version-lt: 3.0 - - # no module block - type default::Movie { - required property title -> str; - # the year of release - property year -> int64; - required link director -> default::Person; - required multi link actors -> default::Person; - } - type default::Person { - required property first_name -> str; - required property last_name -> str; - } - .. code-block:: sdl # no module block diff --git a/docs/reference/sdl/indexes.rst b/docs/reference/sdl/indexes.rst index 00a267ad242..7347dea6efd 100644 --- a/docs/reference/sdl/indexes.rst +++ b/docs/reference/sdl/indexes.rst @@ -13,21 +13,6 @@ Example Declare an index for a "User" based on the "name" property: -.. code-block:: sdl - :version-lt: 3.0 - - type User { - required property name -> str; - property address -> str; - - multi link friends -> User; - - # define an index for User based on name - index on (.name) { - annotation title := 'User name index'; - } - } - .. code-block:: sdl type User { diff --git a/docs/reference/sdl/links.rst b/docs/reference/sdl/links.rst index 24f17a356ad..5eb0bf1329a 100644 --- a/docs/reference/sdl/links.rst +++ b/docs/reference/sdl/links.rst @@ -22,18 +22,6 @@ Declare an *abstract* link "friends_base" with a helpful title: Declare a *concrete* link "friends" within a "User" type: -.. code-block:: sdl - :version-lt: 3.0 - - type User { - required property name -> str; - property address -> str; - # define a concrete link "friends" - multi link friends extending friends_base -> User; - - index on (__subject__.name); - } - .. code-block:: sdl type User { @@ -57,20 +45,6 @@ being overloaded (by adding more constraints or changing the target type, for example), the ``overloaded`` keyword must be used. This is to prevent unintentional overloading due to name clashes: -.. code-block:: sdl - :version-lt: 3.0 - - abstract type Friendly { - # this type can have "friends" - multi link friends -> Friendly; - } - - type User extending Friendly { - # overload the link target to be User, specifically - overloaded multi link friends -> User; - # ... other links and properties - } - .. code-block:: sdl abstract type Friendly { @@ -92,96 +66,6 @@ Syntax Define a new link corresponding to the :ref:`more explicit DDL commands `. -.. sdl:synopsis:: - :version-lt: 3.0 - - # Concrete link form used inside type declaration: - [ overloaded ] [{required | optional}] [{single | multi}] - link - [ extending [, ...] ] -> - [ "{" - [ default := ; ] - [ readonly := {true | false} ; ] - [ on target delete ; ] - [ on source delete ; ] - [ ] - [ ] - [ ] - ... - "}" ] - - - # Computed link form used inside type declaration: - [{required | optional}] [{single | multi}] - link := ; - - # Computed link form used inside type declaration (extended): - [ overloaded ] [{required | optional}] [{single | multi}] - link - [ extending [, ...] ] [-> ] - [ "{" - using () ; - [ ] - [ ] - ... - "}" ] - - # Abstract link form: - abstract link [extending [, ...]] - [ "{" - [ readonly := {true | false} ; ] - [ ] - [ ] - [ ] - [ ] - ... - "}" ] - -.. sdl:synopsis:: - :version-lt: 4.0 - - # Concrete link form used inside type declaration: - [ overloaded ] [{required | optional}] [{single | multi}] - link - [ extending [, ...] ] -> - [ "{" - [ default := ; ] - [ readonly := {true | false} ; ] - [ on target delete ; ] - [ on source delete ; ] - [ ] - [ ] - [ ] - ... - "}" ] - - - # Computed link form used inside type declaration: - [{required | optional}] [{single | multi}] - link := ; - - # Computed link form used inside type declaration (extended): - [ overloaded ] [{required | optional}] [{single | multi}] - link - [ extending [, ...] ] [-> ] - [ "{" - using () ; - [ ] - [ ] - ... - "}" ] - - # Abstract link form: - abstract link [extending [, ...]] - [ "{" - [ readonly := {true | false} ; ] - [ ] - [ ] - [ ] - [ ] - ... - "}" ] - .. sdl:synopsis:: # Concrete link form used inside type declaration: diff --git a/docs/reference/sdl/modules.rst b/docs/reference/sdl/modules.rst index bb8068dffe1..81e3dff197b 100644 --- a/docs/reference/sdl/modules.rst +++ b/docs/reference/sdl/modules.rst @@ -20,15 +20,6 @@ Declare an empty module: Declare a module with some content: -.. code-block:: sdl - :version-lt: 3.0 - - module my_module { - type User { - required property name -> str; - } - } - .. code-block:: sdl module my_module { @@ -80,19 +71,6 @@ same name can appear multiple times in an SDL document. In that case all blocks with the same name are merged into a single module under that name. For example: -.. code-block:: sdl - :version-lt: 3.0 - - module my_module { - abstract type Named { - required property name -> str; - } - } - - module my_module { - type User extending Named; - } - .. code-block:: sdl module my_module { @@ -107,17 +85,6 @@ that name. For example: The above is equivalent to: -.. code-block:: sdl - :version-lt: 3.0 - - module my_module { - abstract type Named { - required property name -> str; - } - - type User extending Named; - } - .. code-block:: sdl module my_module { @@ -140,15 +107,6 @@ that a module by that name will be automatically created in the schema. The following declaration is equivalent to the previous examples, but it declares module ``my_module`` implicitly: -.. code-block:: sdl - :version-lt: 3.0 - - abstract type my_module::Named { - required property name -> str; - } - - type my_module::User extending my_module::Named; - .. code-block:: sdl abstract type my_module::Named { diff --git a/docs/reference/sdl/objects.rst b/docs/reference/sdl/objects.rst index cc9b12cf519..97f362876a1 100644 --- a/docs/reference/sdl/objects.rst +++ b/docs/reference/sdl/objects.rst @@ -13,20 +13,6 @@ Example Consider a ``User`` type with a few properties: -.. code-block:: sdl - :version-lt: 3.0 - - type User { - # define some properties and a link - required property name -> str; - property address -> str; - - multi link friends -> User; - - # define an index for User based on name - index on (__subject__.name); - } - .. code-block:: sdl type User { @@ -46,25 +32,6 @@ An alternative way to define the same ``User`` type could be by using abstract types. These abstract types can then be re-used in other type definitions as well: -.. code-block:: sdl - :version-lt: 3.0 - - abstract type Named { - required property name -> str; - } - - abstract type HasAddress { - property address -> str; - } - - type User extending Named, HasAddress { - # define some user-specific properties and a link - multi link friends -> User; - - # define an index for User based on name - index on (__subject__.name); - } - .. code-block:: sdl abstract type Named { diff --git a/docs/reference/sdl/properties.rst b/docs/reference/sdl/properties.rst index ce304438b19..1ec98a9344c 100644 --- a/docs/reference/sdl/properties.rst +++ b/docs/reference/sdl/properties.rst @@ -22,19 +22,6 @@ Declare an *abstract* property "address_base" with a helpful title: Declare *concrete* properties "name" and "address" within a "User" type: -.. code-block:: sdl - :version-lt: 3.0 - - type User { - # define concrete properties - required property name -> str; - property address extending address_base -> str; - - multi link friends -> User; - - index on (__subject__.name); - } - .. code-block:: sdl type User { @@ -54,19 +41,6 @@ is being overloaded (by adding more constraints, for example), the ``overloaded`` keyword must be used. This is to prevent unintentional overloading due to name clashes: -.. code-block:: sdl - :version-lt: 3.0 - - abstract type Named { - property name -> str; - } - - type User extending Named { - # define concrete properties - overloaded required property name -> str; - # ... other links and properties - } - .. code-block:: sdl abstract type Named { @@ -87,82 +61,6 @@ Syntax Define a new property corresponding to the :ref:`more explicit DDL commands `. -.. sdl:synopsis:: - :version-lt: 3.0 - - # Concrete property form used inside type declaration: - [ overloaded ] [{required | optional}] [{single | multi}] - property - [ extending [, ...] ] -> - [ "{" - [ default := ; ] - [ readonly := {true | false} ; ] - [ ] - [ ] - ... - "}" ] - - # Computed property form used inside type declaration: - [{required | optional}] [{single | multi}] - property := ; - - # Computed property form used inside type declaration (extended): - [ overloaded ] [{required | optional}] [{single | multi}] - property - [ extending [, ...] ] [-> ] - [ "{" - using () ; - [ ] - [ ] - ... - "}" ] - - # Abstract property form: - abstract property [::] [extending [, ...]] - [ "{" - [ readonly := {true | false} ; ] - [ ] - ... - "}" ] - -.. sdl:synopsis:: - :version-lt: 4.0 - - # Concrete property form used inside type declaration: - [ overloaded ] [{required | optional}] [{single | multi}] - property - [ extending [, ...] ] -> - [ "{" - [ default := ; ] - [ readonly := {true | false} ; ] - [ ] - [ ] - ... - "}" ] - - # Computed property form used inside type declaration: - [{required | optional}] [{single | multi}] - property := ; - - # Computed property form used inside type declaration (extended): - [ overloaded ] [{required | optional}] [{single | multi}] - property - [ extending [, ...] ] [-> ] - [ "{" - using () ; - [ ] - [ ] - ... - "}" ] - - # Abstract property form: - abstract property [::] [extending [, ...]] - [ "{" - [ readonly := {true | false} ; ] - [ ] - ... - "}" ] - .. sdl:synopsis:: # Concrete property form used inside type declaration: diff --git a/docs/reference/sdl/triggers.rst b/docs/reference/sdl/triggers.rst index 1ba55945722..4dea6bfda96 100644 --- a/docs/reference/sdl/triggers.rst +++ b/docs/reference/sdl/triggers.rst @@ -57,17 +57,6 @@ Syntax Define a new trigger corresponding to the :ref:`more explicit DDL commands `. -.. sdl:synopsis:: - :version-lt: 4.0 - - type "{" - trigger - after - {insert | update | delete} [, ...] - for {each | all} - do - "}" - .. sdl:synopsis:: type "{" diff --git a/docs/stdlib/array.rst b/docs/stdlib/array.rst index a0d9a585894..90f7f05d914 100644 --- a/docs/stdlib/array.rst +++ b/docs/stdlib/array.rst @@ -128,14 +128,6 @@ Reference Array types may also appear in schema declarations: - .. code-block:: sdl - :version-lt: 3.0 - - type Person { - property str_array -> array; - property json_array -> array; - } - .. code-block:: sdl type Person { diff --git a/docs/stdlib/constraints.rst b/docs/stdlib/constraints.rst index c3cd0c6eb47..2e34442d682 100644 --- a/docs/stdlib/constraints.rst +++ b/docs/stdlib/constraints.rst @@ -23,17 +23,6 @@ Constraints Example of using an ``expression`` constraint based on two object properties to restrict maximum magnitude for a vector: - .. code-block:: sdl - :version-lt: 3.0 - - type Vector { - required property x -> float64; - required property y -> float64; - constraint expression on ( - __subject__.x^2 + __subject__.y^2 < 25 - ); - } - .. code-block:: sdl type Vector { @@ -172,24 +161,6 @@ Constraints Example: - .. code-block:: sdl - :version-lt: 3.0 - - type User { - # Make sure user names are unique. - required property name -> str { - constraint exclusive; - } - # Already indexed, don't need to do this: - # index on (.name) - - # Make sure none of the "owned" items belong - # to any other user. - multi link owns -> Item { - constraint exclusive; - } - } - .. code-block:: sdl type User { @@ -212,17 +183,6 @@ Constraints ``exclusive`` constraint for the combination, rather than on each property: - .. code-block:: sdl - :version-lt: 3.0 - - type UniqueCoordinates { - required property x -> int64; - required property y -> int64; - - # Each combination of x and y must be unique. - constraint exclusive on ( (.x, .y) ); - } - .. code-block:: sdl type UniqueCoordinates { diff --git a/docs/stdlib/objects.rst b/docs/stdlib/objects.rst index 296efa8b682..1a17a2c1be8 100644 --- a/docs/stdlib/objects.rst +++ b/docs/stdlib/objects.rst @@ -29,21 +29,6 @@ type, which is a subtype of ``std::BaseObject``. Definition: - .. code-block:: sdl - :version-lt: 3.0 - - abstract type std::BaseObject { - # Universally unique object identifier - required property id -> uuid { - default := (select std::uuid_generate_v1mc()); - readonly := true; - constraint exclusive; - } - - # Object type in the information schema. - required readonly link __type__ -> schema::ObjectType; - } - .. code-block:: sdl abstract type std::BaseObject { diff --git a/docs/stdlib/sequence.rst b/docs/stdlib/sequence.rst index 7e9352835c9..cddcde67c81 100644 --- a/docs/stdlib/sequence.rst +++ b/docs/stdlib/sequence.rst @@ -27,17 +27,6 @@ Sequences This type can be used to create auto-incrementing :ref:`properties `: - .. code-block:: sdl - :version-lt: 3.0 - - scalar type TicketNo extending sequence; - - type Ticket { - property number -> TicketNo { - constraint exclusive; - } - } - .. code-block:: sdl scalar type TicketNo extending sequence; diff --git a/docs/stdlib/set.rst b/docs/stdlib/set.rst index 6209fb4a8cb..3cf4c842760 100644 --- a/docs/stdlib/set.rst +++ b/docs/stdlib/set.rst @@ -437,25 +437,6 @@ Sets Consider the following types: - .. code-block:: sdl - :version-lt: 3.0 - - type User { - required property name -> str; - } - - abstract type Owned { - required link owner -> User; - } - - type Issue extending Owned { - required property title -> str; - } - - type Comment extending Owned { - required property body -> str; - } - .. code-block:: sdl type User { diff --git a/docs/stdlib/tuple.rst b/docs/stdlib/tuple.rst index fd5fa8f953d..008c758e653 100644 --- a/docs/stdlib/tuple.rst +++ b/docs/stdlib/tuple.rst @@ -103,14 +103,6 @@ Any type can be used as a tuple element type. Here's an example of using this syntax in a schema definition: -.. code-block:: sdl - :version-lt: 3.0 - - type GameElement { - required property name -> str; - required property position -> tuple; - } - .. code-block:: sdl type GameElement { diff --git a/docs/stdlib/type.rst b/docs/stdlib/type.rst index b231b55c9eb..8e3d0b16cdf 100644 --- a/docs/stdlib/type.rst +++ b/docs/stdlib/type.rst @@ -114,25 +114,6 @@ the ``name`` property inside ``__type__``: same logic then applies: in order to be a valid link target the object must satisfy ``object is (A | B | C)``. - .. code-block:: sdl - :version-lt: 3.0 - - abstract type Named { - required property name -> str; - } - - abstract type Text { - required property body -> str; - } - - type Item extending Named; - - type Note extending Text; - - type User extending Named { - multi link stuff -> Named | Text; - } - .. code-block:: sdl abstract type Named { @@ -312,16 +293,6 @@ the ``name`` property inside ``__type__``: Consider the following types using links and properties with names that don't indicate their respective target types: - .. code-block:: sdl - :version-lt: 3.0 - - type Foo { - property bar -> int16; - link baz -> Bar; - } - - type Bar extending Foo; - .. code-block:: sdl type Foo { @@ -390,16 +361,6 @@ the ``name`` property inside ``__type__``: Consider the following types using links and properties with names that don't indicate their respective target types: - .. code-block:: sdl - :version-lt: 3.0 - - type Foo { - property bar -> int16; - link baz -> Bar; - } - - type Bar extending Foo; - .. code-block:: sdl type Foo {