- 2201.2.0 (Swan Lake Update 2)
- 2201.1.2 (Swan Lake Update 1)
- 2201.1.1 (Swan Lake Update 1)
- 2201.1.0 (Swan Lake Update 1)
- 2201.0.5 (Swan Lake)
- 2201.0.4 (Swan Lake)
- 2201.0.3 (Swan Lake)
- 2201.0.2 (Swan Lake)
- 2201.0.1 (Swan Lake)
- 2201.0.0 (Swan Lake)
- Swan Lake Beta6
- Swan Lake Beta5
- Swan Lake Beta4
- Swan Lake Beta3
- Swan Lake Beta2
- Swan Lake Beta1
- Swan Lake Alpha5
- Swan Lake Alpha4
- Swan Lake Alpha3
- Swan Lake Alpha2
- Swan Lake Alpha1
- Swan Lake Preview 8
- Swan Lake Preview 7
- Swan Lake Preview 6
- Swan Lake Preview 5
- Swan Lake Preview 4
- Swan Lake Preview 3
- Swan Lake Preview 2
- Swan Lake Preview 1
Overview of Ballerina Swan Lake Preview 3
This release is the third preview version of Ballerina Swan Lake. This release includes a new set of language features along with improvements and bug fixes to the compiler, runtime, standard libraries, and developer tooling.
You can use the update tool to update to Ballerina Swan Lake Preview 3 as follows.
For existing users:
If you are already using jBallerina, you can directly update your distribution to the Swan Lake channel using the Ballerina update tool. To do this, first, execute the command below to get the update tool updated to its latest version.
Next, execute the command below to update to Swan Lake Preview 3.
ballerina dist pull slp3
However, if you are using a jBallerina version below 1.1.0, install via the installers.
For new users:
If you have not installed jBallerina, then download the installers to install.
- Support for defining external object method bodies
- Order by clause for sorting
- Inner/Nested query expressions
- Support for executing stored procedures in the SQL connector
- Azure Functions support
What's new in Ballerina Swan Lake Preview 3
The language implementation is based on Ballerina Language Specifications Draft 2020-06-18.
External object method bodies
This release introduces support for defining object methods with external function bodies.
The Java method to which the
getFullName() method is bound:
Order by clause for sorting
This release introduces the
order by clause support for sorting in query expression/action. An order-by clause is executed by constructing a list of entries.
Inner/Nested query expressions
This release introduces the support to write inner/nested query expression/action.
Stored procedures can now be executed through SQL connectors (JDBC & MySQL).
ballerina/nats library was moved to Ballerina Central. Previously, this module was packed in the Ballerina distribution. With this change, this library can now be released independently.
Data Mapping code action
Two record types can now be mapped automatically using the
Data Mapping code action. Once a possible record mapping instance is identified, it suggests a mapping based on an AI algorithm. A mapping function will be generated automatically and added to the workspace to perform the record mapping.
The following is a sample in which the code action to generate a mapping function will appear when attempting to assign a mapping value to a variable of a type that is not directly assignable.
By choosing the
Generate mapping functioncode action, the following function will be added to the workspace.
Furthermore, the line with the error would be replaced with a function call as shown below.
For more information, see Code Actions.
Support single test execution
A single test function or a set of functions can now be executed using the
--tests flag as follows.
API change in
Deep value equality is supported only for
anydata-typed values according to the language specification. The
assertEquals function has been changed to accept only
anydata-typed values to reflect this behavior.
Introduction of the
assertExactEquals function compares two values to assert whether they refer to the same entity (i.e., they are exactly equal).
Introduction of the
These two new annotations can now be used when writing tests with the Ballerina test framework.
Introduction of the
alwaysRun field to the
You can now specify
alwaysRun : true|false in the
@AfterSuite annotation, which enables running the
@AfterSuite even if the
@BeforeSuite function fails during the test execution. The default value is
Code to Cloud
Azure Functions support
Ballerina now supports writing serverless functions using the Azure Functions framework.
For more information, see Azure Functions.