New feature: dynamic include elements

It seems obvious and natural, but it was challenging for me to add dynamic includes implementation requested by one of Scriptella users. Here is an example of dynamic includes.

<query id="migrate" connection-id="db">
    SELECT version FROM schema_info
    <script>
	<include href="${version}.sql"/>
     </script>
</query>

This feature is especially useful for building Rails-like migrations. Later me or Mike will post a short how-to on a simplified migrations in Scriptella ETL.

New feature: ?{textfile ‘url/file_name’} to upload CLOBs

Yesterday I’ve implemented a requested feature which allows inserting CLOB content from files. It works the same way as ?{file } for BLOBs.

A simple example:

INSERT INTOEmail (ID, Text) VALUES (1 , ?{textfile ‘email1.txt’})

Using Scriptella for In-Memory Testing

I’ve started writing a small article on how-to populate/refresh a database with JUnit 4 and Spring.

In fact it’s very simple – just lookup and run a Runnable ETLExecutor registered in the application context.

Working with dates in JEXL expressions

I’ve just added a useful feature to the Scriptella 0.8 code base. It allows formatting/parsing dates in JEXL expressions. JEXL lacks a possibility to instantiate Java object or directly invoke static methods. The solution is to use a helper variable named etl which provides several utility classes.

etl.date is a date format/parse helper. Here is a simple ETL to script utilizing the new feature:

<!DOCTYPE etl SYSTEM "http://scriptella.javaforge.com/dtd/etl.dtd">
<etl>
    <connection driver="text" url="${etl.date.today('yyyyMMdd')}.log"/>
    <script>Current time is ${etl.date.today('yyyy-MM-dd HH:mm:ss.SSS')}</script>
</etl>
In future I can add a possibility to work files, numbers etc. using the same approach, e.g. ${etl.io.listFiles(...)}