Lasso makes it easy to access data from many different datasources using a common query language. The same code can be used to access MySQL, Oracle, or even FileMaker. Lasso automatically generates SQL statements or datasource-specific commands to perform database actions. This is sometimes referred to as a "database abstraction layer." Hand-crafted SQL statements can also be used to access advanced database features.
Results are automatically parsed by Lasso, and a rich collection of methods make it easy to format the results as HTML, XML, JSON, or any format desired. Query Expressions allow the results to be further refined or sorted within Lasso.
The following snippet demonstrates how a personnel database could be searched, and the results listed, in a datasource-agnostic fashion:
inline(
-search,
-database='myCompany',
-table='People',
-bw, 'first_name' = 'j',
-sortfield='last_name'
)
rows
column('last_name') + ', '
column('first_name') + '<br />'
/rows
/inline