class Scenic::Adapters::Postgres::TemporaryName
Generates a temporary object name used internally by Scenic
. This is used during side-by-side materialized view updates to avoid naming collisions. The generated name is based on a SHA1 hash of the original which ensures we do not exceed the 63 character limit for object names.
@api private
Constants
- PREFIX
-
The prefix used for all temporary names.
Attributes
Public Class Methods
Source
# File lib/scenic/adapters/postgres/temporary_name.rb, line 17 def initialize(name) @name = name @salt = SecureRandom.hex(4) @temporary_name = "#{PREFIX}#{Digest::SHA1.hexdigest(name + salt)}" end
Creates a new temporary name object.
@param name [String] The original name to base the temporary name on.
Public Instance Methods
Source
# File lib/scenic/adapters/postgres/temporary_name.rb, line 24 def to_s temporary_name end
@return [String] The temporary name.