...
You can use the Database extractor to connect to and extract data from a database.
Table of Contents |
---|
Format
Code Block |
---|
{ "display": string, "database": { "url" : "string" , // "username" : "string", // Username for the database, "password" : "string", // Password for the database, "databaseType" : "string", // String, type of DB to connect to // eg: mysql, db2, oracle, mssqlserver, sybase "hostname" : "string", // String, hostname of database server to connect to "port" : "string", // String, port database server is listening for connections on "databaseName" : "string", // String, name of database containing the data to be extracted "query" : "string", // String, SQL query used to retrieve full dataset from source (the first time the source is added) "deltaQuery" : "string", // String, SQL query used to retrieve updates from source after the first time through "deleteQuery" : "string", // String, not currently implemented "primaryKey" : "string", // String, primary key field in data set, used to help identify whether a record is new or previously harvested "primaryKeyValue" : "string", //String, primary key value, only used when placing in the feed record "title" : "string", // String, one of the columns from query/deltaQuery; populates the document's title field "snippet" : "string", // String, one of the columns from query/deltaQuery; populates the document's description field "publishedDate" : "string", // String, one of the columns from query/deltaQuery; populates the document's published date field } |
...
Description
Field | Description | Note |
---|---|---|
username | Username for the database credentials. | |
password | From v0.3, password can be either plaintext or encrypted. In earlier versions, password must be encrypted. download the jasypt command line utility to encrypt (link) - use "infinit.e" as the "password" (actually the salt). | |
databaseType | The type of RDBMS to connect to. Valid values currently include: mysql, db2, oracle, mssqlserver, sybase. | |
hostanme | The hostname of the database server to connect to, i.e. "my.databaseserver.com" in the example above. | |
port | The port that the database accepts incoming connections on. | |
databaseName | The name of the database to connect to. | |
query | The query field is used to specify the SQL used to perform a full extraction of data for the source. This is generally used the first time the harvester extracts data from a source with incremental extractions being specified using the deltaQuery below. | |
deltaQuery | The deltaQuery field is used to specify the SQL that extracts data from the source RDBS based on one or more delta values, i.e. created or modified date for a record. | |
deleteQuery | Note: The deleteQuery functionality of the Database Harvester is not implemented in the Beta version of Infinit.e. | |
primaryKey | Primary key field in data set, used to help identify whether a record is new or previously harvested. | |
primaryKeyValue | Primary key value, only used when placing in the feed record. | |
title | Record field used to populate the document's title field. | |
snippet | Record field used to populate the document's description field. | |
publishedDate | Record field used to populate the document's published date field. |
Connecting to the Database
...
- database.url + record.get(primaryKey)
Example:
TODO
Examples
Obtaining Data from the Database
The following input table represents an incident report which will be used by way of example.
...