Skip to main content

SQLite loader for mkpipe.

Project description

mkpipe-loader-sqlite

SQLite loader plugin for MkPipe. Writes Spark DataFrames into SQLite database files via JDBC.

Documentation

For more detailed documentation, please visit the GitHub repository.

License

This project is licensed under the Apache 2.0 License - see the LICENSE file for details.


Connection Configuration

connections:
  sqlite_target:
    variant: sqlite
    database: /full/path/to/mydb.db

Table Configuration

pipelines:
  - name: pg_to_sqlite
    source: pg_source
    destination: sqlite_target
    tables:
      - name: public.users
        target_name: stg_users
        replication_method: full
        batchsize: 5000

Write Strategy

Control how data is written to SQLite:

      - name: public.users
        target_name: stg_users
        write_strategy: upsert       # append | replace | upsert | merge
        write_key: [id]              # required for upsert/merge
Strategy SQLite Behavior
append Plain INSERT via JDBC (default for incremental)
replace Drop and recreate table, then insert (default for full). Use if_exists: append to preserve existing table
upsert INSERT ... ON CONFLICT (write_key) DO UPDATE via temp table
merge Same as upsert for SQLite

Write Throughput

      - name: public.users
        target_name: stg_users
        replication_method: full
        batchsize: 5000

Performance Notes

  • SQLite uses file-level locking — write_partitions has no benefit here as concurrent writes will serialize or fail. Set write_partitions: 1 to avoid contention.
  • Keep batchsize moderate (1,000–10,000) — large transactions in SQLite can cause memory pressure.
  • SQLite is best suited for small-to-medium outputs (local development, testing, lightweight pipelines).

All Table Parameters

Parameter Type Default Description
name string required Source table name
target_name string required SQLite destination table name
replication_method full / incremental full Replication strategy
batchsize int 10000 Rows per JDBC batch insert
write_partitions int Set to 1 to avoid SQLite lock contention
write_strategy string append, replace, upsert, merge
write_key list Key columns for upsert/merge (required)
if_exists string replace (drop+create) or append (preserve table). Inherits from settings
dedup_columns list Columns used for mkpipe_id hash deduplication
tags list [] Tags for selective pipeline execution
pass_on_error bool false Skip table on error instead of failing

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mkpipe_loader_sqlite-0.6.0.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mkpipe_loader_sqlite-0.6.0-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file mkpipe_loader_sqlite-0.6.0.tar.gz.

File metadata

  • Download URL: mkpipe_loader_sqlite-0.6.0.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for mkpipe_loader_sqlite-0.6.0.tar.gz
Algorithm Hash digest
SHA256 516731acbe1345ccf8231787b0706189b74db4cef10296ea55a2c9dbc7e15512
MD5 04cf2a44233e22da88d6b05ea948231b
BLAKE2b-256 c9b4c7dd088f2151f173ebc76fa7acde0f791f2fc2f7664f4730c5b76beb2bf0

See more details on using hashes here.

File details

Details for the file mkpipe_loader_sqlite-0.6.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mkpipe_loader_sqlite-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c013b4645748187c89bb6d0fca833bb5b97b76efe89fce4a0b8b38c0b817ec9b
MD5 892e26690b6c1f4b6bf953d8bcaebf90
BLAKE2b-256 6ccb9878c31708a9b917e890ff9c86513ef8829eccf4ed14845cf8d39382fb89

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page