Skip to content

825 add connectors for duckdb access - #1024

Merged
ebhills merged 4 commits into
mainfrom
825-add-connectors-for-duckdb-access
Jun 30, 2026
Merged

825 add connectors for duckdb access#1024
ebhills merged 4 commits into
mainfrom
825-add-connectors-for-duckdb-access

Conversation

@mborodii-prog

Copy link
Copy Markdown
Contributor

Add DuckDB and Microsoft Access connectors

Summary

  • Adds a duckdb connector (wrangles/connectors/duckdb.py) with read/write/run operations, backed by the duckdb package.
  • Adds an access connector (wrangles/connectors/access.py) for Microsoft Access databases with read/write/run operations, backed by pyodbc.
  • Registers both connectors in wrangles/connectors/__init__.py so they're usable from recipes (duckdb: / access: keys) and from the Python API.
  • Documents the new optional dependencies in README.md and requirements-full.txt (duckdb>=1.0.0, pyodbc>=5.0.0).
  • Adds connector tests (tests/connectors/test_duckdb.py, tests/connectors/test_access.py), skipped automatically if the optional dependency isn't installed.

Usage

DuckDB — Python API

from wrangles.connectors import duckdb

# Read
df = duckdb.read(database='database.duckdb', command='SELECT * FROM table')

# Write (INSERT / REPLACE / FAIL)
duckdb.write(df, database='database.duckdb', table='table', action='REPLACE')

# Run arbitrary SQL (single command or list)
duckdb.run(database='database.duckdb', command='CREATE INDEX idx ON table(col)')

DuckDB — Recipe YAML

read:
  duckdb:
    database: database.duckdb
    command: SELECT * FROM table

wrangles:
  - ...

write:
  duckdb:
    database: database.duckdb
    table: output_table
    action: REPLACE

Microsoft Access — Python API

from wrangles.connectors import access

# Read (via database file or full connection string)
df = access.read(database='database.accdb', command='SELECT * FROM table')

# Write — auto-creates the table if it doesn't exist
access.write(df, database='database.accdb', table='table', action='INSERT')

# Run arbitrary SQL
access.run(database='database.accdb', command='DELETE FROM table WHERE id = ?', params=[42])

Microsoft Access — Recipe YAML

read:
  access:
    database: database.accdb
    command: SELECT * FROM table

wrangles:
  - ...

write:
  access:
    database: database.accdb
    table: output_table
    action: REPLACE

Both connectors also support :memory: (DuckDB) and a raw connection_string (Access) for advanced configuration, and a params argument for parameterized queries to avoid SQL injection.

New optional dependencies

Capability Install
DuckDB pip install duckdb
Microsoft Access pip install pyodbc

Add DuckDB read/write/run connector with recipe schemas
Add Microsoft Access read/write/run connector via ODBC
Export new connectors from wrangles.connectors
Document optional duckdb and pyodbc dependencies
Add connector tests for DuckDB and Access
@mborodii-prog mborodii-prog linked an issue Jun 25, 2026 that may be closed by this pull request
2 tasks
@mborodii-prog
mborodii-prog requested a review from thomasstvr June 25, 2026 11:06
@ebhills
ebhills merged commit 74b94c8 into main Jun 30, 2026
15 checks passed
@ebhills
ebhills deleted the 825-add-connectors-for-duckdb-access branch June 30, 2026 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Connectors for DuckDB & Access

2 participants