mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 02:11:08 -06:00
d286c1d5a1
* Moves existing files around. All essential scripts are in `migrations/bin`, and non-essential scripts like benchmarks are in `migrations/scripts` * Dependabot configuration for migrations-tooling (disabled for now) * Updates test configuration for migrations-tooling * Shorter configuration for intermediate DB for now. We will add the rest table by table. * Adds a couple of benchmark scripts * RSpec setup especially for migrations-tooling and the first tests * Adds sorting/formatting to the `generate_schema` script
26 lines
439 B
Ruby
26 lines
439 B
Ruby
# frozen_string_literal: true
|
|
|
|
class Migrations
|
|
class PreparedStatementCache < ::LruRedux::Cache
|
|
class PreparedStatementHash < Hash
|
|
def shift
|
|
result = super
|
|
if (stmt = result[1])
|
|
stmt.close
|
|
end
|
|
result
|
|
end
|
|
|
|
def clear
|
|
each_value(&:close)
|
|
super
|
|
end
|
|
end
|
|
|
|
def initialize(*args)
|
|
super
|
|
@data = PreparedStatementHash.new
|
|
end
|
|
end
|
|
end
|