Skip to content

Commit 5544762

Browse files
authored
Merge pull request rails#52562 from lazaronixon/sqlite-build-insert-fixture
Bulk insert fixtures on SQLite
2 parents 3bbd99a + 90b1108 commit 5544762

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

activerecord/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
* SQLite3Adapter: Bulk insert fixtures.
2+
3+
Previously one insert command was executed for each fixture, now they are
4+
aggregated in a single bulk insert command.
5+
6+
*Lázaro Nixon*
7+
18
* PostgreSQLAdapter: Allow `disable_extension` to be called with schema-qualified name.
29

310
For parity with `enable_extension`, the `disable_extension` method can be called with a schema-qualified

activerecord/lib/active_record/connection_adapters/sqlite3/database_statements.rb

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -128,20 +128,17 @@ def execute_batch(statements, name = nil)
128128
raw_execute(sql, name, batch: true)
129129
end
130130

131-
def build_fixture_statements(fixture_set)
132-
fixture_set.flat_map do |table_name, fixtures|
133-
next if fixtures.empty?
134-
fixtures.map { |fixture| build_fixture_sql([fixture], table_name) }
135-
end.compact
136-
end
137-
138131
def build_truncate_statement(table_name)
139132
"DELETE FROM #{quote_table_name(table_name)}"
140133
end
141134

142135
def returning_column_values(result)
143136
result.rows.first
144137
end
138+
139+
def default_insert_value(column)
140+
column.default
141+
end
145142
end
146143
end
147144
end

0 commit comments

Comments
 (0)