diff --git a/lib/conceptql/database.rb b/lib/conceptql/database.rb
index <HASH>..<HASH> 100644
--- a/lib/conceptql/database.rb
+++ b/lib/conceptql/database.rb
@@ -2,7 +2,7 @@ require 'facets/hash/revalue'
 
 module ConceptQL
   class Database
-    attr :db
+    attr :db, :opts
 
     def initialize(db, opts={})
       @db = db
@@ -15,6 +15,7 @@ module ConceptQL
       @opts = opts.revalue { |v| v ? v.to_sym : v }
       @opts[:data_model] ||= :omopv4
       @opts[:database_type] ||= db_type
+      @opts[:impala_mem_limit] ||= ENV['IMPALA_MEM_LIMIT'] if ENV['IMPALA_MEM_LIMIT']
     end
 
     def query(statement, opts={})
diff --git a/lib/conceptql/scope.rb b/lib/conceptql/scope.rb
index <HASH>..<HASH> 100644
--- a/lib/conceptql/scope.rb
+++ b/lib/conceptql/scope.rb
@@ -171,7 +171,7 @@ module ConceptQL
     end
 
     def mem_limit
-      opts[:impala_mem_limit] || ENV['IMPALA_MEM_LIMIT']
+      opts[:impala_mem_limit]
     end
   end
 end
Database#opts exposes options set on database

Also set MEM_LIMIT from environment variable in Database