Sha256: d62ea7234e9aacf076b8f8cf0a7740c2dc3ced65379dcad681a5dda04b98cf9f
Contents?: true
Size: 609 Bytes
Versions: 5
Compression:
Stored size: 609 Bytes
Contents
# frozen_string_literal: true module PgEventstore module TestHelpers class << self def clean_up_db tables_to_purge = PgEventstore.connection.with do |conn| conn.exec(<<~SQL) SELECT tablename FROM pg_catalog.pg_tables WHERE schemaname NOT IN ('pg_catalog', 'information_schema') AND tablename != 'migrations' SQL end.map { |attrs| attrs['tablename'] } tables_to_purge.each do |table_name| PgEventstore.connection.with { |c| c.exec("DELETE FROM #{table_name}") } end end end end end
Version data entries
5 entries across 5 versions & 1 rubygems