duckdb 1.5.6.1 → 2.0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/duckdb/result.rb CHANGED
@@ -95,34 +95,5 @@ module DuckDB
95
95
  end
96
96
  values
97
97
  end
98
-
99
- private
100
-
101
- def _enum_dictionary_size(idx)
102
- warn(":_enum_dictionary_size is deprecated. use columns[#{idx}].logical_type.dictionary_size instead.")
103
-
104
- raise ArgumentError, "Invalid index: #{idx}" if idx.negative?
105
-
106
- columns[idx]&.logical_type&.dictionary_size
107
- end
108
-
109
- def _enum_dictionary_value(col_index, idx)
110
- warn(":_enum_dictionary_value is deprecated.\
111
- use columns[#{col_index}].logical_type.dictionary_value_at(#{idx}) instead.")
112
-
113
- raise ArgumentError, "Invalid index: #{col_index}" if col_index.negative?
114
-
115
- lt = columns[col_index]&.logical_type
116
-
117
- raise DuckDB::Error, "Column[#{col_index}] type is not enum" if lt&.type != :enum
118
-
119
- lt.dictionary_value_at(idx)
120
- end
121
-
122
- def _column_type(idx)
123
- warn(":_column_type is deprecated. use columns[#{idx}].send(:_type) instead.")
124
-
125
- columns[idx].send(:_type)
126
- end
127
98
  end
128
99
  end
@@ -11,8 +11,7 @@ module DuckDB
11
11
  def initialize(name)
12
12
  raise TypeError, "#{name.class} is not a String or Symbol" unless name.is_a?(String) || name.is_a?(Symbol)
13
13
 
14
- @name = name.to_s
15
- _initialize(@name)
14
+ _initialize(name.to_s)
16
15
  end
17
16
 
18
17
  # @param scalar_function [DuckDB::ScalarFunction] the overload to add
@@ -28,9 +28,9 @@ module DuckDB
28
28
  # +con+ must be a DuckDB::Connection. +table+ is the table name (String).
29
29
  # Optionally pass +schema:+ and/or +catalog:+ to qualify the table.
30
30
  #
31
- # The +table+ argument supports dot-notation and quoting:
32
- # - <tt>'schema.table'</tt> — interpreted as schema-qualified (deprecated; use +schema:+ instead)
33
- # - <tt>'"a.b"'</tt> or <tt>"'a.b'"</tt> — treated as a literal table name containing a dot
31
+ # The +table+ argument is used as a literal table name, even if it contains a dot.
32
+ # Use +schema:+ and +catalog:+ to qualify the table. Surrounding double or single
33
+ # quotes (<tt>'"a.b"'</tt> or <tt>"'a.b'"</tt>) are stripped.
34
34
  #
35
35
  # Raises DuckDB::Error if the connection is invalid, the table name is nil,
36
36
  # or the table (or schema/catalog) does not exist.
@@ -4,23 +4,17 @@ module DuckDB
4
4
  # DuckDB::TableNameParser provides shared table name parsing for classes that
5
5
  # accept a table name argument, such as DuckDB::Appender and DuckDB::TableDescription.
6
6
  #
7
- # It handles:
8
- # - Dot-notation: <tt>'schema.table'</tt> is split into schema and table (deprecated).
9
- # - Quoting: <tt>'"a.b"'</tt> or <tt>"'a.b'"</tt> strips the quotes and treats the name literally.
7
+ # It handles quoting: <tt>'"a.b"'</tt> or <tt>"'a.b'"</tt> strips the quotes and treats the name literally.
8
+ # A name containing a dot (e.g. <tt>'a.b'</tt>) is used as-is, as a literal table name; it is
9
+ # never split into schema and table. Use the +schema:+ and +catalog:+ keyword arguments to qualify a table.
10
10
  module TableNameParser
11
11
  private
12
12
 
13
- # Parses +table+, +schema+, and +catalog+, handling quoting and dot-notation.
13
+ # Parses +table+, +schema+, and +catalog+, handling quoting.
14
14
  # Returns <tt>[table, schema, catalog]</tt>.
15
15
  def parse_table_name(table, schema, catalog)
16
- if quoted_table_name?(table)
17
- [unquote_table_name(table), schema, catalog]
18
- elsif table.include?('.')
19
- warn_dot_notation_deprecated(table)
20
- dot_notation_split(table, schema, catalog)
21
- else
22
- [table, schema, catalog]
23
- end
16
+ table = unquote_table_name(table) if quoted_table_name?(table)
17
+ [table, schema, catalog]
24
18
  end
25
19
 
26
20
  def quoted_table_name?(name) # :nodoc:
@@ -30,29 +24,5 @@ module DuckDB
30
24
  def unquote_table_name(name) # :nodoc:
31
25
  name[1..-2]
32
26
  end
33
-
34
- # Splits a dot-notation string into [table, schema, catalog].
35
- # Explicit keyword args take precedence over dot-notation parts.
36
- def dot_notation_split(table, schema, catalog) # :nodoc:
37
- parts = table.split('.')
38
- raise ArgumentError, "Too many dot-separated segments in '#{table}'" if parts.length > 3
39
-
40
- case parts.length
41
- when 2 then [parts[1], schema || parts[0], catalog]
42
- when 3 then [parts[2], schema || parts[1], catalog || parts[0]]
43
- else raise ArgumentError, "Unexpected segment count in '#{table}'"
44
- end
45
- end
46
-
47
- def warn_dot_notation_deprecated(table) # :nodoc:
48
- class_name = self.class.name
49
- warn(
50
- "Passing dot-notation '#{table}' to #{class_name}.new is deprecated. " \
51
- "If '#{table}' is a schema-qualified table, use #{class_name}.new(con, table, schema: schema) instead. " \
52
- "If '#{table}' is a literal table name containing a dot, " \
53
- "use #{class_name}.new(con, '\"#{table}\"') instead.",
54
- category: :deprecated
55
- )
56
- end
57
27
  end
58
28
  end
@@ -3,5 +3,5 @@
3
3
  module DuckDB
4
4
  # The version string of ruby-duckdb.
5
5
  # Currently, ruby-duckdb is NOT semantic versioning.
6
- VERSION = '1.5.6.1'
6
+ VERSION = '2.0.0.1'
7
7
  end
data/lib/duckdb.rb CHANGED
@@ -59,22 +59,8 @@ module DuckDB
59
59
 
60
60
  @default_timezone = value
61
61
  end
62
-
63
- def const_missing(name)
64
- deprecated = DEPRECATED_CONSTANTS[name]
65
- return super unless deprecated
66
-
67
- warn "DuckDB::#{name} is deprecated. Use #{deprecated} instead.", uplevel: 1
68
- const_set(name, deprecated.split('::').reduce(Object) { |mod, part| mod.const_get(part) })
69
- end
70
62
  end
71
63
 
72
- DEPRECATED_CONSTANTS = {
73
- BindInfo: 'DuckDB::TableFunction::BindInfo',
74
- InitInfo: 'DuckDB::TableFunction::InitInfo',
75
- FunctionInfo: 'DuckDB::TableFunction::FunctionInfo'
76
- }.freeze
77
-
78
64
  # Default to local time to preserve existing behavior unless explicitly
79
65
  # configured otherwise.
80
66
  self.default_timezone = :local
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: duckdb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.6.1
4
+ version: 2.0.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masaki Suketa