|
| 1 | += New Features |
| 2 | + |
| 3 | +* A subset_static_cache plugin has been added, for statically caching |
| 4 | + subsets of a model class. This is useful for cases where only a |
| 5 | + subset of the model class is static. For example, with this code: |
| 6 | + |
| 7 | + class StatusType < Sequel::Model |
| 8 | + dataset_module do |
| 9 | + where :available, hidden: false |
| 10 | + end |
| 11 | + cache_subset :available |
| 12 | + end |
| 13 | + |
| 14 | + The following methods will use the cache and not issue a database |
| 15 | + query: |
| 16 | + |
| 17 | + * StatusType.available.with_pk |
| 18 | + * StatusType.available.all |
| 19 | + * StatusType.available.each |
| 20 | + * StatusType.available.first (without block, only supporting no |
| 21 | + arguments or single integer argument) |
| 22 | + * StatusType.available.count (without an argument or block) |
| 23 | + * StatusType.available.map |
| 24 | + * StatusType.available.as_hash |
| 25 | + * StatusType.available.to_hash |
| 26 | + * StatusType.available.to_hash_groups |
| 27 | + |
| 28 | + The static_cache_cache plugin has been updated to statically cache |
| 29 | + these subsets, avoiding a query to get the static values when |
| 30 | + cache_subset is called. |
| 31 | + |
| 32 | +* On PostgreSQL, column aliases now support data types, which is |
| 33 | + useful when selecting from functions returning records, such as |
| 34 | + the jsonb_to_record/jsonb_to_recordset function: |
| 35 | + |
| 36 | + DB.from{jsonb_to_recordset(:value).as(:d, [[:a, Integer], [:e, String]])} |
| 37 | + # SELECT * FROM jsonb_to_recordset("value") AS "d"("a" integer, "e" text) |
| 38 | + |
| 39 | += Other Improvements |
| 40 | + |
| 41 | +* Sequel::Model class-level methods that call dataset methods can now |
| 42 | + be overridden by defining singleton methods on the class, and using |
| 43 | + super to get the default behavior (similar to how column and |
| 44 | + association methods work). |
| 45 | + |
| 46 | +* The timestamp migrator now has deterministic behavior when multiple |
| 47 | + migrations have the same version, using a lexicographic sort of the |
| 48 | + rest of the migration filename to break ties. |
| 49 | + |
| 50 | +* Explicit block parameters are now used in some methods, allowing |
| 51 | + the test suite to run without warnings when using |
| 52 | + -W:strict_unused_block on Ruby 3.4. |
| 53 | + |
| 54 | +* A consistent instance variable setting order is now used in the |
| 55 | + string_agg extension to avoid shape-related performance warnings. |
0 commit comments