marklogic-community / marklogic-spring-batch

Write batch processing applications in MarkLogic
Other
8 stars 26 forks source link

Read all Information Schema from a relational database #291

Open sastafford opened 6 years ago

sastafford commented 6 years ago

As a developer I want to Read the table metadata from a relational database table So that I can process this data for batch processing.

Notes

Project: rdbms Package: com.marklogic.spring.batch.item.rdbms Class: InformationSchemaItemReader implements ItemStreamReader

Recommend to test with H2 Database. RDBMSs which support information_schema include:

Recommend that this class inherits from a JdbcCursorItemReader. Preset the sql attribute to read all table names and columns for each table.

Unit Tests

Given an relational database with an Information Schema When the InformationSchemaItemReader reads from the database Then a ResultSet is returned with the table metadata.

Example

Column, Table, Type name, Customer, string address, Customer, string invoiceId, Invoice, integer customerId, Invoice, integer total, Invoice, float