Norconex / committer-sql

Implementation of Norconex Committer for SQL (JDBC) databases.
https://opensource.norconex.com/committers/sql/
Apache License 2.0
1 stars 6 forks source link

Is it possible to use with SQLite? #6

Closed LeMoussel closed 4 years ago

LeMoussel commented 4 years ago

Hi,

Is it possible to use SQL Committer with SQLite? Do you have any examples of using SQL Committer?

Regards,

Christian

essiembre commented 4 years ago

Definitely, the SQL Committer works with any RDBMS offering a JDBC driver and SQLite is no exception.

You first have to download add the SQLite drive to the lib folder. You can find configuration options here. For an example, it could look like this:

<committer class="com.norconex.committer.sql.SQLCommitter">
    <driverClass>org.sqlite.JDBC</driverClass>
    <connectionUrl>jdbc:sqlite:/path/to/my/database.db</connectionUrl>
    <username>myUsername</username>
    <password>myPassword</password>
    <tableName>myTable</tableName>
    <createTableSQL>
        CREATE TABLE "${tableName}"
        (
            ${targetReferenceField} TEXT PRIMARY KEY NOT NULL, 
            ${targetContentField}  TEXT,
            title TEXT,
            etc TEXT
        );    
    </createTableSQL>   

    <fixFieldNames>true</fixFieldNames>
    <fixFieldValues>true</fixFieldValues>

    <commitBatchSize>10</commitBatchSize>
    <queueDir>${workdir}/committer-queue</queueDir>
    <queueSize>10</queueSize>
    <maxRetries>5</maxRetries>
    <maxRetryWait>5000</maxRetryWait>
</committer> 
LeMoussel commented 4 years ago

Thank you Pascal for your support.