Sequel 5.80.0 Released

https://github.com/jeremyevans/sequel/discussions/2157

Sequel 5.80.0 has been released!

New Features

  • A provenance dataset extension has been added. This extension makes
    SQL queries include a comment describing how the dataset was built.
    This can make debugging complex cases significantly easier. Here's
    a simple example:

      DB.extension :provenance
      DB[:table].
        select(:a).
        where{b > 10}.
        order(:c).
        limit(10)
        # SQL:
        # SELECT a FROM table WHERE (b > 10) ORDER BY c LIMIT 10 --
        #  -- Dataset Provenance
        #  -- Keys:[:from] Source:(eval at bin/sequel:257):2:in `<main>'
        #  -- Keys:[:select] Source:(eval at bin/sequel:257):3:in `<main>'
        #  -- Keys:[:where] Source:(eval at bin/sequel:257):4:in `<main>'
        #  -- Keys:[:order] Source:(eval at bin/sequel:257):5:in `<main>'
        #  -- Keys:[:limit] Source:(eval at bin/sequel:257):6:in `<main>'

    With the above example, it's obvious how the dataset is created, but
    but in real applications, where datasets can be built from multiple
    files, seeing where each dataset clone was made can be helpful.

    The source listed will skip locations in the Ruby standard library
    as well as Sequel itself. Other locations can be skipped by
    providing a Database :provenance_caller_ignore Regexp option:

     DB.opts[:provenance_caller_ignore] = /\/gems\/library_name-/

Other Improvements

  • For dataset methods where Sequel can determine that the return
    value would be equivalent to the receiver, Sequel now returns the
    receiver. This reduces the number of dataset allocations.

  • Sequel now supports Dataset#skip_locked on MariaDB 10.6+.

Thanks,
Jeremy

{
"by": "thunderbong",
"descendants": 0,
"id": 40231701,
"kids": [
40231809
],
"score": 4,
"time": 1714612570,
"title": "Sequel 5.80.0 Released",
"type": "story",
"url": "https://github.com/jeremyevans/sequel/discussions/2157"
}
{
"author": "jeremyevans",
"date": "2024-05-01T12:00:00.000Z",
"description": "Sequel 5.80.0 has been released! New Features A provenance dataset extension has been added. This extension makes SQL queries include a comment describing how the dataset was built. This can make d…",
"image": "https://opengraph.githubassets.com/af94fc030d6ad9c2c879b983306dc5d8578cf9201e66e42478cfa356cd30333a/jeremyevans/sequel/discussions/2157",
"logo": "https://logo.clearbit.com/github.com",
"publisher": "GitHub",
"title": "Sequel 5.80.0 Released · jeremyevans/sequel · Discussion #2157",
"url": "https://github.com/jeremyevans/sequel/discussions/2157"
}
{
"url": "https://github.com/jeremyevans/sequel/discussions/2157",
"title": "Sequel 5.80.0 Released · jeremyevans/sequel · Discussion #2157",
"description": "Sequel 5.80.0 has been released! New Features A provenance dataset extension has been added. This extension makes SQL queries include a comment describing how the dataset was built. This can make d...",
"links": [
"https://github.com/jeremyevans/sequel/discussions/2157"
],
"image": "https://opengraph.githubassets.com/af94fc030d6ad9c2c879b983306dc5d8578cf9201e66e42478cfa356cd30333a/jeremyevans/sequel/discussions/2157",
"content": "<div>\n <tbody>\n <tr>\n <td>\n <p>Sequel 5.80.0 has been released!</p>\n<h2>New Features</h2>\n<ul>\n<li>\n<p>A provenance dataset extension has been added. This extension makes<br />\nSQL queries include a comment describing how the dataset was built.<br />\nThis can make debugging complex cases significantly easier. Here's<br />\na simple example:</p>\n<div><pre> <span>DB</span><span>.</span><span>extension</span> <span>:provenance</span>\n <span>DB</span><span>[</span><span>:table</span><span>]</span><span>.</span>\n <span>select</span><span>(</span><span>:a</span><span>)</span><span>.</span>\n <span>where</span><span>{</span><span>b</span> &gt; <span>10</span><span>}</span><span>.</span>\n <span>order</span><span>(</span><span>:c</span><span>)</span><span>.</span>\n <span>limit</span><span>(</span><span>10</span><span>)</span>\n <span># SQL:</span>\n <span># SELECT a FROM table WHERE (b &gt; 10) ORDER BY c LIMIT 10 --</span>\n <span># -- Dataset Provenance</span>\n <span># -- Keys:[:from] Source:(eval at bin/sequel:257):2:in `&lt;main&gt;'</span>\n <span># -- Keys:[:select] Source:(eval at bin/sequel:257):3:in `&lt;main&gt;'</span>\n <span># -- Keys:[:where] Source:(eval at bin/sequel:257):4:in `&lt;main&gt;'</span>\n <span># -- Keys:[:order] Source:(eval at bin/sequel:257):5:in `&lt;main&gt;'</span>\n <span># -- Keys:[:limit] Source:(eval at bin/sequel:257):6:in `&lt;main&gt;'</span></pre></div>\n<p>With the above example, it's obvious how the dataset is created, but<br />\nbut in real applications, where datasets can be built from multiple<br />\nfiles, seeing where each dataset clone was made can be helpful.</p>\n<p>The source listed will skip locations in the Ruby standard library<br />\nas well as Sequel itself. Other locations can be skipped by<br />\nproviding a Database :provenance_caller_ignore Regexp option:</p>\n<div><pre> <span>DB</span><span>.</span><span>opts</span><span>[</span><span>:provenance_caller_ignore</span><span>]</span> <span>=</span> <span>/<span>\\/</span>gems<span>\\/</span>library_name-/</span></pre></div>\n</li>\n</ul>\n<h2>Other Improvements</h2>\n<ul>\n<li>\n<p>For dataset methods where Sequel can determine that the return<br />\nvalue would be equivalent to the receiver, Sequel now returns the<br />\nreceiver. This reduces the number of dataset allocations.</p>\n</li>\n<li>\n<p>Sequel now supports Dataset#skip_locked on MariaDB 10.6+.</p>\n</li>\n</ul>\n<p>Thanks,<br />\nJeremy</p>\n </td>\n </tr>\n </tbody>\n </div>",
"author": "",
"favicon": "https://github.githubassets.com/favicons/favicon.svg",
"source": "github.com",
"published": "",
"ttr": 42,
"type": "object"
}