mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-13 05:23:46 +08:00
There are concrete implementations for a simple set, a key-value store, and nested sets with 2 or 3 keys. The API stays the same for all implementations and the performances is more or less the same as without the wrapper (at least with YJIT enabled).
25 lines
390 B
Ruby
25 lines
390 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Migrations::SetStore
|
|
module Interface
|
|
def add(...)
|
|
raise NotImplementedError
|
|
end
|
|
|
|
def add?(...)
|
|
raise NotImplementedError
|
|
end
|
|
|
|
def include?(...)
|
|
raise NotImplementedError
|
|
end
|
|
|
|
def bulk_add(records)
|
|
raise NotImplementedError
|
|
end
|
|
|
|
def empty?
|
|
raise NotImplementedError
|
|
end
|
|
end
|
|
end
|