From daf78ef3d438f5b82e59ee53cfcbd36f7d4069bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Janko=20Marohni=C4=87?= Date: Mon, 24 Oct 2022 13:26:02 +0200 Subject: [PATCH] Make `:username` optional configuration argument When developing locally on Postgres and SQLite, it's common to rely on the default username and have no password, which happens when creating the database with `createdb mydatabase`. So, it would be convenient not to have to pass the username. It seems that the database URL generator is already handling the scenario of `:username` being `nil`. --- lib/sequel_tools.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sequel_tools.rb b/lib/sequel_tools.rb index 94be60d..70fd139 100644 --- a/lib/sequel_tools.rb +++ b/lib/sequel_tools.rb @@ -24,7 +24,7 @@ module SequelTools extra_tables_in_dump: nil, } # unfrozen on purpose so that one might want to update the defaults - REQUIRED_KEYS = [ :dbadapter, :dbname, :username ] + REQUIRED_KEYS = [ :dbadapter, :dbname ] class MissingConfigError < StandardError; end def self.base_config(extra_config = {}) config = DEFAULT_CONFIG.merge extra_config