/stage/examples/v2/sqlserver-datasource.xml
http://github.com/t11e/discovery_datatool · XML · 58 lines · 55 code · 2 blank · 1 comment · 0 complexity · 81008e4844a3dbb9e616eb55b204ffbc MD5 · raw file
- <config
- xmlns="http://transparensee.com/schema/datatool-config-2"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation=
- "http://transparensee.com/schema/datatool-config-2
- http://transparensee.com/schema/datatool-config-2.xsd">
- <dataSources>
- <dataSource name="production-dataSource"
- jar="drivers/jtds-1.2.5.jar"
- class="net.sourceforge.jtds.jdbcx.JtdsDataSource">
- <!-- 1: sqlserver, 2: sybase -->
- <serverType>1</serverType>
- <serverName>localhost</serverName>
- <databaseName>test</databaseName>
- <user>test</user>
- <password>test</password>
- </dataSource>
- </dataSources>
- <profiles>
- <sqlProfile name="production-profile" dataSource="production-dataSource">
- <retrieveSql startColumn="start" endColumn="end">
- select last_run as start, CURRENT_TIMESTAMP as end
- from changeset_profile
- where name = :name
- </retrieveSql>
- <updateSql>
- update changeset_profile
- set last_run = :lastRun
- where name = :name
- </updateSql>
- </sqlProfile>
- </profiles>
- <publishers>
- <sqlPublisher name="production"
- dataSource="production-dataSource" profile="production-profile">
- <action type="create" filter="delta" idColumn="id">
- <query><![CDATA[
- select * from items
- where last_updated >= :start and last_updated < :end
- ]]></query>
- </action>
- <action type="delete" filter="delta" idColumn="id">
- <query><![CDATA[
- select id from deleted_items
- where last_updated >= :start and last_updated < :end
- ]]></query>
- </action>
- <action type="create" filter="snapshot" idColumn="id">
- <query><![CDATA[
- select * from items
- where last_updated < :end
- ]]></query>
- </action>
- </sqlPublisher>
- </publishers>
- </config>