@@ -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.
749711end
@@ -779,6 +741,12 @@ def initialize(...)
779741
780742 conn_params = @config . compact
781743
744+ # NOTE: strict strings is not supported by the jdbc driver yet,
745+ # hope it will supported soon, I open a issue in their repository.
746+ # https://github.com/xerial/sqlite-jdbc/issues/1153
747+ #
748+ # @config[:strict] = ConnectionAdapters::SQLite3Adapter.strict_strings_by_default unless @config.key?(:strict)
749+
782750 @connection_parameters = conn_params
783751 end
784752
0 commit comments