lib/ysql.rb in yugabytedb-ysql-0.3 vs lib/ysql.rb in yugabytedb-ysql-0.4

- old
+ new

@@ -11,14 +11,14 @@ POSTGRESQL_LIB_PATH = bundled_libpq_path else bundled_libpq_path = nil # Try to load libpq path as found by extconf.rb begin - require "pg/postgresql_lib_path" + require "ysql/postgresql_lib_path" rescue LoadError # rake-compiler doesn't use regular "make install", but uses it's own install tasks. - # It therefore doesn't copy pg/postgresql_lib_path.rb in case of "rake compile". + # It therefore doesn't copy ysql/postgresql_lib_path.rb in case of "rake compile". POSTGRESQL_LIB_PATH = false end end add_dll_path = proc do |path, &block| @@ -42,13 +42,13 @@ add_dll_path.call(POSTGRESQL_LIB_PATH) do if bundled_libpq_path # It's a Windows binary gem, try the <major>.<minor> subdirectory major_minor = RUBY_VERSION[ /^(\d+\.\d+)/ ] or raise "Oops, can't extract the major/minor version from #{RUBY_VERSION.dump}" - require "#{major_minor}/pg_ext" + require "#{major_minor}/ysql_ext" else - require 'pg_ext' + require 'ysql_ext' end end # Get the PG library version. # @@ -73,49 +73,49 @@ end end module BinaryDecoder %i[ TimestampUtc TimestampUtcToLocal TimestampLocal ].each do |klass| - autoload klass, 'pg/binary_decoder/timestamp' + autoload klass, 'ysql/binary_decoder/timestamp' end - autoload :Date, 'pg/binary_decoder/date' + autoload :Date, 'ysql/binary_decoder/date' end module BinaryEncoder %i[ TimestampUtc TimestampLocal ].each do |klass| - autoload klass, 'pg/binary_encoder/timestamp' + autoload klass, 'ysql/binary_encoder/timestamp' end end module TextDecoder %i[ TimestampUtc TimestampUtcToLocal TimestampLocal TimestampWithoutTimeZone TimestampWithTimeZone ].each do |klass| - autoload klass, 'pg/text_decoder/timestamp' + autoload klass, 'ysql/text_decoder/timestamp' end - autoload :Date, 'pg/text_decoder/date' - autoload :Inet, 'pg/text_decoder/inet' - autoload :JSON, 'pg/text_decoder/json' - autoload :Numeric, 'pg/text_decoder/numeric' + autoload :Date, 'ysql/text_decoder/date' + autoload :Inet, 'ysql/text_decoder/inet' + autoload :JSON, 'ysql/text_decoder/json' + autoload :Numeric, 'ysql/text_decoder/numeric' end module TextEncoder %i[ TimestampUtc TimestampWithoutTimeZone TimestampWithTimeZone ].each do |klass| - autoload klass, 'pg/text_encoder/timestamp' + autoload klass, 'ysql/text_encoder/timestamp' end - autoload :Date, 'pg/text_encoder/date' - autoload :Inet, 'pg/text_encoder/inet' - autoload :JSON, 'pg/text_encoder/json' - autoload :Numeric, 'pg/text_encoder/numeric' + autoload :Date, 'ysql/text_encoder/date' + autoload :Inet, 'ysql/text_encoder/inet' + autoload :JSON, 'ysql/text_encoder/json' + autoload :Numeric, 'ysql/text_encoder/numeric' end - autoload :BasicTypeMapBasedOnResult, 'pg/basic_type_map_based_on_result' - autoload :BasicTypeMapForQueries, 'pg/basic_type_map_for_queries' - autoload :BasicTypeMapForResults, 'pg/basic_type_map_for_results' - autoload :BasicTypeRegistry, 'pg/basic_type_registry' - require 'pg/exceptions' - require 'pg/coder' - require 'pg/type_map_by_column' - require 'pg/connection' - require 'pg/result' - require 'pg/tuple' - require 'pg/load_balance_service' - autoload :VERSION, 'pg/version' + autoload :BasicTypeMapBasedOnResult, 'ysql/basic_type_map_based_on_result' + autoload :BasicTypeMapForQueries, 'ysql/basic_type_map_for_queries' + autoload :BasicTypeMapForResults, 'ysql/basic_type_map_for_results' + autoload :BasicTypeRegistry, 'ysql/basic_type_registry' + require 'ysql/exceptions' + require 'ysql/coder' + require 'ysql/type_map_by_column' + require 'ysql/connection' + require 'ysql/result' + require 'ysql/tuple' + require 'ysql/load_balance_service' + autoload :VERSION, 'ysql/version' # Avoid "uninitialized constant Truffle::WarningOperations" on Truffleruby up to 22.3.1 if RUBY_ENGINE=="truffleruby" && !defined?(Truffle::WarningOperations) module TruffleFixWarn