PageRenderTime 50ms CodeModel.GetById 42ms app.highlight 2ms RepoModel.GetById 4ms app.codeStats 1ms

/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
 1<config
 2  xmlns="http://transparensee.com/schema/datatool-config-2"
 3  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 4  xsi:schemaLocation=
 5    "http://transparensee.com/schema/datatool-config-2
 6     http://transparensee.com/schema/datatool-config-2.xsd">
 7  <dataSources>
 8    <dataSource name="production-dataSource"
 9      jar="drivers/jtds-1.2.5.jar"
10      class="net.sourceforge.jtds.jdbcx.JtdsDataSource">
11      <!-- 1: sqlserver, 2: sybase -->
12      <serverType>1</serverType> 
13      <serverName>localhost</serverName>
14      <databaseName>test</databaseName>
15      <user>test</user>
16      <password>test</password>
17    </dataSource>
18  </dataSources>
19
20  <profiles>
21    <sqlProfile name="production-profile" dataSource="production-dataSource">
22      <retrieveSql startColumn="start" endColumn="end">
23        select last_run as start, CURRENT_TIMESTAMP as end
24        from changeset_profile
25        where name = :name
26      </retrieveSql>
27      <updateSql>
28        update changeset_profile
29        set last_run = :lastRun
30        where name = :name
31      </updateSql>
32    </sqlProfile>
33  </profiles>
34
35  <publishers>
36    <sqlPublisher name="production"
37      dataSource="production-dataSource" profile="production-profile">
38      <action type="create" filter="delta" idColumn="id">
39        <query><![CDATA[
40          select * from items
41          where last_updated >= :start and last_updated < :end
42        ]]></query>
43      </action>
44      <action type="delete" filter="delta" idColumn="id">
45        <query><![CDATA[
46          select id from deleted_items
47          where last_updated >= :start and last_updated < :end
48        ]]></query>
49      </action>
50      <action type="create" filter="snapshot" idColumn="id">
51        <query><![CDATA[
52          select * from items
53          where last_updated < :end
54        ]]></query>
55      </action>
56    </sqlPublisher>
57  </publishers>
58</config>