Skip to content

Commit 6ef89ca

Browse files
committed
Sqlite, remove duplicated definition of configure_connection method
1 parent 9cc3533 commit 6ef89ca

File tree

1 file changed

+0
-38
lines changed

1 file changed

+0
-38
lines changed

lib/arjdbc/sqlite3/adapter.rb

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -706,44 +706,6 @@ def configure_connection
706706
# https://www.sqlite.org/pragma.html#pragma_cache_size
707707
raw_execute("PRAGMA cache_size = 2000", "SCHEMA")
708708
end
709-
710-
def configure_connection
711-
if @config[:timeout] && @config[:retries]
712-
raise ArgumentError, "Cannot specify both timeout and retries arguments"
713-
elsif @config[:timeout]
714-
# FIXME:
715-
# @raw_connection.busy_timeout(self.class.type_cast_config_to_integer(@config[:timeout]))
716-
elsif @config[:retries]
717-
retries = self.class.type_cast_config_to_integer(@config[:retries])
718-
raw_connection.busy_handler do |count|
719-
count <= retries
720-
end
721-
end
722-
723-
# Enforce foreign key constraints
724-
# https://www.sqlite.org/pragma.html#pragma_foreign_keys
725-
# https://www.sqlite.org/foreignkeys.html
726-
raw_execute("PRAGMA foreign_keys = ON", "SCHEMA")
727-
unless @memory_database
728-
# Journal mode WAL allows for greater concurrency (many readers + one writer)
729-
# https://www.sqlite.org/pragma.html#pragma_journal_mode
730-
raw_execute("PRAGMA journal_mode = WAL", "SCHEMA")
731-
# Set more relaxed level of database durability
732-
# 2 = "FULL" (sync on every write), 1 = "NORMAL" (sync every 1000 written pages) and 0 = "NONE"
733-
# https://www.sqlite.org/pragma.html#pragma_synchronous
734-
raw_execute("PRAGMA synchronous = NORMAL", "SCHEMA")
735-
# Set the global memory map so all processes can share some data
736-
# https://www.sqlite.org/pragma.html#pragma_mmap_size
737-
# https://www.sqlite.org/mmap.html
738-
raw_execute("PRAGMA mmap_size = #{128.megabytes}", "SCHEMA")
739-
end
740-
# Impose a limit on the WAL file to prevent unlimited growth
741-
# https://www.sqlite.org/pragma.html#pragma_journal_size_limit
742-
raw_execute("PRAGMA journal_size_limit = #{64.megabytes}", "SCHEMA")
743-
# Set the local connection cache to 2000 pages
744-
# https://www.sqlite.org/pragma.html#pragma_cache_size
745-
raw_execute("PRAGMA cache_size = 2000", "SCHEMA")
746-
end
747709
end
748710
# DIFFERENCE: A registration here is moved down to concrete class so we are not registering part of an adapter.
749711
end

0 commit comments

Comments
 (0)