OSS TanbouSign in with GitHub

Bulk-insert ActiveRecord data with fewer SQL statements while controlling batches, validation, and upserts

About these scores

OSS scale score is an unbounded metric that log-compresses and weights Stars, Watchers, Forks, and Contributors. Discovery score is the current OSS scale score minus the score at discovery. Update pace is commits in the last 30 days, growth momentum is the OSS scale score difference within the recent observation window, and OSS health is a 0–100 rating based on available recency, Community Health, and release data.

Stars
4,155
Primary language
Ruby
License
MIT
Repository last updated
Aug 28, 2026
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.

Sources: [2][3][4]

Official sources

  1. [1]zdennis/activerecord-import — GitHub repository(2026-10-06)
  2. [2]activerecord-import — README(2026-10-06)
  3. [3]activerecord-import — gemspec(2026-10-06)
  4. [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. 1

    Get the source

    git clone --depth 1 https://github.com/zdennis/activerecord-import.git
  2. 2

    Enter the repository

    cd activerecord-import
  3. 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
Check the official README

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

GitHub data

GitHub dataView detailed GitHub data
Stars
4,155
Forks
620
Watchers
37
Open issues
41
Contributors
156
Owner type
User
Primary language
Ruby
License
MIT
Repository last updated
Aug 28, 2026
Write a related article

Share a guide or use case for this OSS in Markdown. Articles are published after administrator approval.

Report incorrect information

Tell us if any listing information is incorrect or outdated.

After reading this page, do you know what to do next?