On this page
Overview
activerecord-import adds bulk import APIs to ActiveRecord. It can insert model arrays, hashes, or column/value arrays in a small number of statements with batching, validation, duplicate-key handling, and PostgreSQL recursive association imports. The current version is 2.3.0.
Features and best fit
Based on official documentation; not hands-on tested · Content checked:
Key features
Collapse many record inserts into one or a few SQL statements
Model.import can bulk-insert many records instead of issuing one INSERT per save. batch_size controls statement size and progress callbacks can report long-running imports.
Sources: [2]
Choose validation, upsert behavior, and PostgreSQL recursive imports
Projects can enable or skip validations, track failures, use database-specific upsert behavior, and recursively import associations on PostgreSQL.
Sources: [2]
Best fit
Fits large seeds, ETL, batch synchronization, and bulk upsert work that should stay close to ActiveRecord
It is useful when Rails batch jobs or data migrations need high-volume writes without replacing model-oriented code with fully hand-written SQL.
Sources: [2]
Before adoption
Understand callback and uniqueness-validation differences from normal ActiveRecord saves
Create, update, and destroy callbacks do not run exactly as they do with normal save, and uniqueness validation is disabled by default because enabling it can produce one query per record. Version 2.3.0 declares Ruby 2.4+ and ActiveRecord 4.2+ and adds compatibility work for newer Rails and multi-database connections.
Official sources
- [1]zdennis/activerecord-import — GitHub repository(2026-10-06)
- [2]activerecord-import — README(2026-10-06)
- [3]activerecord-import — gemspec(2026-10-06)
- [4]activerecord-import — CHANGELOG(2026-10-06)
Supplemental curator note
It can dramatically reduce insert statements while staying within ActiveRecord, but callbacks and uniqueness validation differ from normal saves. Validate those behavioral differences as well as throughput.
Try it in 3 steps
- 1
Get the source
git clone --depth 1 https://github.com/zdennis/activerecord-import.git - 2
Enter the repository
cd activerecord-import - 3
Check the official steps
Continue with the commands in the README Installation, Quick Start, or Getting Started section.
find . -maxdepth 1 -iname 'README*' -exec sed -n '1,220p' {} \; -quit
Growth
Growth trends · Last 30 days
4,155 Stars
Trend data is still being collected.
Development activity
Last 90 days · weekly
- Commits (last 30 days)
- 0
- Open PRs
- 13
Development activity is still being collected.
Built with
Categories and tags
Categories
GitHub data
GitHub dataView detailed GitHub data
Related information
Write a related articleShare a guide or use case for this OSS in Markdown. Articles are published after administrator approval.
Explore next
- Turso Database24,632 Stars
2 shared tag(s) · 2 shared category(s)
run SQLite-compatible SQL on a Rust database engine with bindings for multiple languages
Rust - HikariCP21,234 Stars
2 shared tag(s) · 2 shared category(s)
keep JDBC connection pooling small and fast with explicit timeout and lifetime controls
Java - sqlc18,348 Stars
2 shared tag(s) · 2 shared category(s)
keep SQL as the source of truth and generate type-safe data-access code
Go - sqlx17,743 Stars
2 shared tag(s) · 2 shared category(s)
extend database/sql with struct scanning and named queries without replacing its interfaces
Go - Ent17,204 Stars
2 shared tag(s) · 2 shared category(s)
generate statically typed query APIs from Go schemas with an entity framework
Go - Go MySQL Driver15,278 Stars
2 shared tag(s) · 2 shared category(s)
connect standard database/sql applications to MySQL and MariaDB with a pure-Go driver
Go
Report incorrect information
Tell us if any listing information is incorrect or outdated.