sequel 5.83.0 → 5.84.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (126) hide show
  1. checksums.yaml +4 -4
  2. data/lib/sequel/adapters/shared/sqlite.rb +3 -1
  3. data/lib/sequel/database/connecting.rb +1 -1
  4. data/lib/sequel/database/misc.rb +8 -3
  5. data/lib/sequel/database/schema_methods.rb +2 -0
  6. data/lib/sequel/extensions/pg_json_ops.rb +328 -1
  7. data/lib/sequel/sql.rb +8 -5
  8. data/lib/sequel/version.rb +1 -1
  9. metadata +2 -236
  10. data/CHANGELOG +0 -1393
  11. data/README.rdoc +0 -936
  12. data/doc/advanced_associations.rdoc +0 -884
  13. data/doc/association_basics.rdoc +0 -1859
  14. data/doc/bin_sequel.rdoc +0 -146
  15. data/doc/cheat_sheet.rdoc +0 -255
  16. data/doc/code_order.rdoc +0 -104
  17. data/doc/core_extensions.rdoc +0 -405
  18. data/doc/dataset_basics.rdoc +0 -96
  19. data/doc/dataset_filtering.rdoc +0 -222
  20. data/doc/extensions.rdoc +0 -77
  21. data/doc/fork_safety.rdoc +0 -84
  22. data/doc/mass_assignment.rdoc +0 -98
  23. data/doc/migration.rdoc +0 -660
  24. data/doc/model_dataset_method_design.rdoc +0 -129
  25. data/doc/model_hooks.rdoc +0 -254
  26. data/doc/model_plugins.rdoc +0 -270
  27. data/doc/mssql_stored_procedures.rdoc +0 -43
  28. data/doc/object_model.rdoc +0 -563
  29. data/doc/opening_databases.rdoc +0 -439
  30. data/doc/postgresql.rdoc +0 -611
  31. data/doc/prepared_statements.rdoc +0 -144
  32. data/doc/querying.rdoc +0 -1070
  33. data/doc/reflection.rdoc +0 -120
  34. data/doc/release_notes/5.0.0.txt +0 -159
  35. data/doc/release_notes/5.1.0.txt +0 -31
  36. data/doc/release_notes/5.10.0.txt +0 -84
  37. data/doc/release_notes/5.11.0.txt +0 -83
  38. data/doc/release_notes/5.12.0.txt +0 -141
  39. data/doc/release_notes/5.13.0.txt +0 -27
  40. data/doc/release_notes/5.14.0.txt +0 -63
  41. data/doc/release_notes/5.15.0.txt +0 -39
  42. data/doc/release_notes/5.16.0.txt +0 -110
  43. data/doc/release_notes/5.17.0.txt +0 -31
  44. data/doc/release_notes/5.18.0.txt +0 -69
  45. data/doc/release_notes/5.19.0.txt +0 -28
  46. data/doc/release_notes/5.2.0.txt +0 -33
  47. data/doc/release_notes/5.20.0.txt +0 -89
  48. data/doc/release_notes/5.21.0.txt +0 -87
  49. data/doc/release_notes/5.22.0.txt +0 -48
  50. data/doc/release_notes/5.23.0.txt +0 -56
  51. data/doc/release_notes/5.24.0.txt +0 -56
  52. data/doc/release_notes/5.25.0.txt +0 -32
  53. data/doc/release_notes/5.26.0.txt +0 -35
  54. data/doc/release_notes/5.27.0.txt +0 -21
  55. data/doc/release_notes/5.28.0.txt +0 -16
  56. data/doc/release_notes/5.29.0.txt +0 -22
  57. data/doc/release_notes/5.3.0.txt +0 -121
  58. data/doc/release_notes/5.30.0.txt +0 -20
  59. data/doc/release_notes/5.31.0.txt +0 -148
  60. data/doc/release_notes/5.32.0.txt +0 -46
  61. data/doc/release_notes/5.33.0.txt +0 -24
  62. data/doc/release_notes/5.34.0.txt +0 -40
  63. data/doc/release_notes/5.35.0.txt +0 -56
  64. data/doc/release_notes/5.36.0.txt +0 -60
  65. data/doc/release_notes/5.37.0.txt +0 -30
  66. data/doc/release_notes/5.38.0.txt +0 -28
  67. data/doc/release_notes/5.39.0.txt +0 -19
  68. data/doc/release_notes/5.4.0.txt +0 -80
  69. data/doc/release_notes/5.40.0.txt +0 -40
  70. data/doc/release_notes/5.41.0.txt +0 -25
  71. data/doc/release_notes/5.42.0.txt +0 -136
  72. data/doc/release_notes/5.43.0.txt +0 -98
  73. data/doc/release_notes/5.44.0.txt +0 -32
  74. data/doc/release_notes/5.45.0.txt +0 -34
  75. data/doc/release_notes/5.46.0.txt +0 -87
  76. data/doc/release_notes/5.47.0.txt +0 -59
  77. data/doc/release_notes/5.48.0.txt +0 -14
  78. data/doc/release_notes/5.49.0.txt +0 -59
  79. data/doc/release_notes/5.5.0.txt +0 -61
  80. data/doc/release_notes/5.50.0.txt +0 -78
  81. data/doc/release_notes/5.51.0.txt +0 -47
  82. data/doc/release_notes/5.52.0.txt +0 -87
  83. data/doc/release_notes/5.53.0.txt +0 -23
  84. data/doc/release_notes/5.54.0.txt +0 -27
  85. data/doc/release_notes/5.55.0.txt +0 -21
  86. data/doc/release_notes/5.56.0.txt +0 -51
  87. data/doc/release_notes/5.57.0.txt +0 -23
  88. data/doc/release_notes/5.58.0.txt +0 -31
  89. data/doc/release_notes/5.59.0.txt +0 -73
  90. data/doc/release_notes/5.6.0.txt +0 -31
  91. data/doc/release_notes/5.60.0.txt +0 -22
  92. data/doc/release_notes/5.61.0.txt +0 -43
  93. data/doc/release_notes/5.62.0.txt +0 -132
  94. data/doc/release_notes/5.63.0.txt +0 -33
  95. data/doc/release_notes/5.64.0.txt +0 -50
  96. data/doc/release_notes/5.65.0.txt +0 -21
  97. data/doc/release_notes/5.66.0.txt +0 -24
  98. data/doc/release_notes/5.67.0.txt +0 -32
  99. data/doc/release_notes/5.68.0.txt +0 -61
  100. data/doc/release_notes/5.69.0.txt +0 -26
  101. data/doc/release_notes/5.7.0.txt +0 -108
  102. data/doc/release_notes/5.70.0.txt +0 -35
  103. data/doc/release_notes/5.71.0.txt +0 -21
  104. data/doc/release_notes/5.72.0.txt +0 -33
  105. data/doc/release_notes/5.73.0.txt +0 -66
  106. data/doc/release_notes/5.74.0.txt +0 -45
  107. data/doc/release_notes/5.75.0.txt +0 -35
  108. data/doc/release_notes/5.76.0.txt +0 -86
  109. data/doc/release_notes/5.77.0.txt +0 -63
  110. data/doc/release_notes/5.78.0.txt +0 -67
  111. data/doc/release_notes/5.79.0.txt +0 -28
  112. data/doc/release_notes/5.8.0.txt +0 -170
  113. data/doc/release_notes/5.80.0.txt +0 -40
  114. data/doc/release_notes/5.81.0.txt +0 -31
  115. data/doc/release_notes/5.82.0.txt +0 -61
  116. data/doc/release_notes/5.83.0.txt +0 -56
  117. data/doc/release_notes/5.9.0.txt +0 -99
  118. data/doc/schema_modification.rdoc +0 -679
  119. data/doc/security.rdoc +0 -443
  120. data/doc/sharding.rdoc +0 -286
  121. data/doc/sql.rdoc +0 -648
  122. data/doc/testing.rdoc +0 -204
  123. data/doc/thread_safety.rdoc +0 -15
  124. data/doc/transactions.rdoc +0 -250
  125. data/doc/validations.rdoc +0 -558
  126. data/doc/virtual_rows.rdoc +0 -265
@@ -1,61 +0,0 @@
1
- = New Features
2
-
3
- * MERGE RETURNING is now supported when using PostgreSQL 17+. For
4
- datasets supporting RETURNING, calling merge with a block
5
- will yield each returned row:
6
-
7
- DB[:table1].
8
- returning.
9
- merge_using(:table2, column1: :column2).
10
- merge_insert(column3: :column4).
11
- merge do |row|
12
- # ...
13
- end
14
- # MERGE INTO "table1" USING "table2"
15
- # ON ("column1" = "column2")
16
- # WHEN NOT MATCHED THEN
17
- # INSERT ("column3") VALUES ("column3")
18
- # RETURNING *
19
-
20
- * A :connect_opts_proc Database option is now supported, to allow
21
- support for late-binding Database options. If provided, this
22
- should be a callable object that is called with the options
23
- used for connecting, and can modify the options. This makes
24
- it simple to support authentication schemes that rotate
25
- passwords automatically without user involvement:
26
-
27
- Sequel.connect('postgres://user@host/database',
28
- connect_opts_proc: lambda do |opts|
29
- opts[:password] = SomeAuthLibrary.get_current_password(opts[:user])
30
- end)
31
-
32
- Note that the jdbc adapter relies on URIs and not option hashes,
33
- so when using the jdbc adapter with this feature, you'll generally
34
- need to set the :uri option.
35
-
36
- = Other Improvements
37
-
38
- * A race condition in the threaded connection pools that could result
39
- in a delay or timeout error in checking out connections in low-traffic
40
- environments has been fixed.
41
-
42
- * Sequel now supports dropping a unique column or a column that is
43
- part of an index on SQLite 3.35.0+, with the same emulation approach
44
- it uses in earlier SQLite versions.
45
-
46
- * The tactical_eager_loading plugin now handles cases where inheritance
47
- is used and the objects used include associations with the same name
48
- but different definitions. Sequel will now only eager load the
49
- association for objects that use the same association definition as
50
- the receiver.
51
-
52
- = Backwards Compatibility
53
-
54
- * bin/sequel no longer requires logger if passed the -E or -l options.
55
- Instead, it uses a simple implementation that supports only
56
- debug/warn/info/error methods. If you are using bin/sequel and
57
- depending on the log format produced by the logger library, or
58
- calling methods on the logger object other than
59
- debug/warn/info/error, you'll need to update your code. This change
60
- was made because logger is moving out of stdlib in a future Ruby
61
- version.
@@ -1,56 +0,0 @@
1
- = New Features
2
-
3
- * MERGE WHEN NOT MATCHED BY SOURCE is now supported when using
4
- PostgreSQL 17+. You can use this SQL syntax via the following
5
- Dataset methods:
6
-
7
- * merge_delete_when_not_matched_by_source
8
- * merge_update_when_not_matched_by_source
9
- * merge_do_nothing_when_not_matched_by_source
10
-
11
- These are similar to the existing merge_delete, merge_update,
12
- and merge_do_nothing_when_matched, except they use
13
- WHEN NOT MATCHED BY SOURCE instead of WHEN MATCHED.
14
-
15
- * An stdio_logger extension has been added. This adds the
16
- Sequel::StdioLogger class, which is a minimal logger implementation
17
- that is compatible for usage with Sequel::Database. Example:
18
-
19
- Sequel.extension :stdio_logger
20
- DB.loggers << Sequel::StdioLogger.new($stdout)
21
-
22
- = Other Improvements
23
-
24
- * Database#inspect now only displays the database type, host, database
25
- name, and user. In addition to being easier to read, this also
26
- prevents displaying the password, enhancing security.
27
-
28
- * The string_agg extension now supports SQLite 3.44+.
29
-
30
- * The defaults_setter plugin now passes the model instance to a
31
- default_values proc if the proc has arity 1. This allows default
32
- values to depend on model instance state.
33
-
34
- * The optimistic_locking plugin no longer adds the lock column to
35
- changed_columns after updating the model instance.
36
-
37
- * Database#create_temp with :temp option and an
38
- SQL::QualifiedIdentifier table name will now attempt to create a
39
- schema qualified table. Note that schema qualified temporary
40
- tables are not supported by many (any?) databases, but this
41
- change prevents the CREATE TABLE statement from succeeding with
42
- an unexpected table name.
43
-
44
- = Backwards Compatibility
45
-
46
- * The Database.uri_to_options private class method now handles
47
- conversion of URI parameters to options. Previously, this was
48
- handled by callers of this method.
49
-
50
- * The _merge_matched_sql and _merge_not_matched_sql private Dataset
51
- methods in PostgreSQL have been replaced with
52
- _merge_do_nothing_sql.
53
-
54
- * An unnecessary space in submitted SQL has been removed when using
55
- MERGE INSERT on PostgreSQL. This should only affect your code if
56
- you are explicitly checking the produced SQL.
@@ -1,99 +0,0 @@
1
- = New Features
2
-
3
- * An escaped_like extension has been added, for the creation of
4
- LIKE/ILIKE expressions with placeholders in patterns without
5
- access to a dataset. This adds escaped_like and escaped_ilike
6
- methods to the same Sequel expression objects that support like
7
- and ilike. These methods take two arguments, the first being
8
- the pattern, with ? placeholders, and the second being the
9
- placeholder value (which can be an array for multiple
10
- placeholders):
11
-
12
- Sequel.extension :escaped_like
13
- DB[:table].where{string_column.escaped_like('?%', user_input)}
14
- # user_input is 'foo':
15
- # SELECT * FROM table WHERE string_column LIKE 'foo%'
16
- # user_input is '%foo':
17
- # SELECT * FROM table WHERE string_column LIKE '\%foo%'
18
-
19
- * Generated columns on MySQL 5.7+ and MariaDB 5.2+ are now supported
20
- using the :generated_always_as option when creating the column.
21
- The :generated_type option can also be used to specify the type of
22
- generated column (virtual or stored). Examples:
23
-
24
- DB.add_column :t, :c, Integer, generated_always_as: Sequel[:a]+'b'
25
- # ALTER TABLE `t` ADD COLUMN `c` varchar(255)
26
- # GENERATED ALWAYS AS (CONCAT(`a`, 'b'))
27
-
28
- DB.add_column :t, :c, Integer, generated_always_as: Sequel[:a]+'b',
29
- generated_type: :virtual
30
- # ALTER TABLE `t` ADD COLUMN `c` varchar(255)
31
- # GENERATED ALWAYS AS (CONCAT(`a`, 'b')) VIRTUAL
32
-
33
- DB.add_column :t, :c, Integer, generated_always_as: Sequel[:a]+'b',
34
- generated_type: :stored
35
- # ALTER TABLE `t` ADD COLUMN `c` varchar(255)
36
- # GENERATED ALWAYS AS (CONCAT(`a`, 'b')) STORED
37
-
38
- * Sequel::Model.has_dataset? has been added for checking whether the
39
- model class has an associated dataset. This will generally be true
40
- for most model classes, but will be false for abstract model
41
- classes (such as Sequel::Model itself).
42
-
43
- * Sequel::VERSION_NUMBER has been added for easier future version
44
- comparisons. The version number for 5.9.0 is 50090.
45
-
46
- = Other Improvements
47
-
48
- * When disconnecting connections in the threaded connection pools,
49
- the disconnection is performed without holding the connection
50
- pool mutex, since disconnection may block.
51
-
52
- * The sharded threaded connection pool no longer deadlocks when
53
- disconnecting connections if the connection_validator or
54
- connection_expiration extension is used.
55
-
56
- * If a thread dies and does not check a connection back into the
57
- connection pool, Sequel now disconnects the connection when it
58
- detects the dead thread, instead of assuming the connection is
59
- safe to be reused.
60
-
61
- * When using eager_graph with cascaded associations, a unique
62
- object is now used instead of a shared object in cases where
63
- using a shared object may cause further cascaded associated
64
- objects to be duplicated.
65
-
66
- * On PostgreSQL, the ESCAPE modifier to the LIKE/ILIKE operators is
67
- no longer used, since the default ESCAPE value is the one Sequel
68
- uses. This change was made in order to allow the LIKE/ILIKE
69
- operators to work with the ANY function, as PostgreSQL does not
70
- support the use of the ESCAPE modifier in such cases.
71
-
72
- * A hash argument passed to Model.nested_attributes in the
73
- nested_attributes plugin is now no longer modified.
74
-
75
- * Internal data structures for eager and eager_graph datasets are now
76
- frozen to avoid unintentional modification.
77
-
78
- * Nondeterministic behavior in Database#foreign_key_list with the
79
- :reverse option on PostgreSQL is now avoided by using an
80
- unambiguous order.
81
-
82
- * Performance has been improved slightly by avoiding unnecessary
83
- hash allocations.
84
-
85
- * Performance has been improved slightly by using while instead
86
- of Kernel#loop.
87
-
88
- * BigDecimal() is now used instead of BigDecimal.new(), as the
89
- latter has been deprecated.
90
-
91
- * The jdbc adapter now avoids referencing ::NativeException on JRuby
92
- 9.2+, since JRuby has deprecated it. It is still used on older
93
- versions of JRuby, since some JRuby 1.7 code may still require it.
94
-
95
- * Sequel now works around multiple Date/Time conversion bugs in
96
- JRuby 9.2.0.0 for BC dates in the pg_extended_date_support
97
- extension. These bugs have already been fixed in JRuby, and
98
- the workarounds will be removed after the release of JRuby
99
- 9.2.1.0.