/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. <profiles>
  20. <sqlProfile name="production-profile" dataSource="production-dataSource">
  21. <retrieveSql startColumn="start" endColumn="end">
  22. select last_run as start, CURRENT_TIMESTAMP as end
  23. from changeset_profile
  24. where name = :name
  25. </retrieveSql>
  26. <updateSql>
  27. update changeset_profile
  28. set last_run = :lastRun
  29. where name = :name
  30. </updateSql>
  31. </sqlProfile>
  32. </profiles>
  33. <publishers>
  34. <sqlPublisher name="production"
  35. dataSource="production-dataSource" profile="production-profile">
  36. <action type="create" filter="delta" idColumn="id">
  37. <query><![CDATA[
  38. select * from items
  39. where last_updated >= :start and last_updated < :end
  40. ]]></query>
  41. </action>
  42. <action type="delete" filter="delta" idColumn="id">
  43. <query><![CDATA[
  44. select id from deleted_items
  45. where last_updated >= :start and last_updated < :end
  46. ]]></query>
  47. </action>
  48. <action type="create" filter="snapshot" idColumn="id">
  49. <query><![CDATA[
  50. select * from items
  51. where last_updated < :end
  52. ]]></query>
  53. </action>
  54. </sqlPublisher>
  55. </publishers>
  56. </config>