Skip to content

Commit

Permalink
Drop all :version-lt: snippets
Browse files Browse the repository at this point in the history
  • Loading branch information
1st1 committed Feb 15, 2025
1 parent 6f6629b commit ffc182e
Show file tree
Hide file tree
Showing 48 changed files with 2 additions and 2,765 deletions.
19 changes: 1 addition & 18 deletions docs/cheatsheets/annotations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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'
},
},
Expand Down
38 changes: 0 additions & 38 deletions docs/cheatsheets/link_properties.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand All @@ -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 {
Expand Down
167 changes: 0 additions & 167 deletions docs/cheatsheets/objects.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand All @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand All @@ -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(.<movie[is Review].rating);
}
.. code-block:: sdl
:version-lt: 4.0
type Movie extending HasImage {
required title: str;
required 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));
description: str;
multi directors: Person {
extending crew;
};
multi actors: Person {
extending crew
};
property avg_rating := math::mean(.<movie[is Review].rating);
}
.. code-block:: sdl
type Movie extending HasImage {
Expand Down Expand Up @@ -308,17 +152,6 @@ aggregates values from another linked type:
Define an :eql:type:`auto-incrementing <sequence>` 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;
Expand Down
Loading

0 comments on commit ffc182e

Please sign in to comment.