Path: redb/changelog/CHANGELOG-4.7.x.md Snapshot: redb, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb Page: https://redbase.app/src/dev-2026-12-06/redb/changelog/CHANGELOG-4.7.x.md ---- # redb changelog: 4.7.x Releases of the 4.7 line, moved here unchanged from CHANGELOG.md, which keeps the latest released line only. Newer releases: [CHANGELOG.md](../CHANGELOG.md). ## [4.7.8] — 2026-11-30 ### Fixed - **A filter on a field of a dictionary entry finds the entry for every key type.** With a tuple or `DateTime` key (`ByQuarter[quarter].Name == v`, `ByDay[day].Rank > 3`), and with a `double` key such as 0.1, the filter returned no objects; with a `bool` key it returned none on PostgreSQL and SQLite. Text and integer keys were not affected. Packages: `redb.Core`. - **A save from a process with an older Props class no longer deletes the fields a newer build added.** During a rolling upgrade, a node still on the old class lost the values of the new fields of every object it saved, without a word. A new field at the top level of the class is now kept. A new field under a nested class, an array or a dictionary cannot be kept when the save replaces that part: such a save now throws `RedbPropsClassOlderException` naming the fields and writes nothing, where it used to lose the values silently. An old node can meet this exception during a rolling upgrade: upgrade it, or do not save those objects from it until it is upgraded. Packages: `redb.Core`, `redb.Core.Pro`. - **`== null` on a field of a dictionary entry finds the objects without a value.** When such a field was the only Props condition (`WhereRedb(o => o.Id == id).Where(e => e.OfficeLocations!["HQ"].City == null)`), the objects without the entry were missed on SQLite and, with `EnablePvtPrefilter` set to `false`, on PostgreSQL; SQL Server with the setting off missed the entries without the field as well. Packages: `redb.Postgres.Pro`, `redb.MSSql.Pro`, `redb.SQLite.Pro`. ## [4.7.7] — 2026-11-28 ### Changed - **A Pro list call makes fewer round trips: two on SQL Server and PostgreSQL (four before), three on SQLite (four before).** The type table is read once per database instead of on every call, and on SQL Server and PostgreSQL the scheme's structure hash rides with the page. From a client on the local network a page of 100 objects with its count went from about 118 ms to 103 ms on SQL Server and from about 114 ms to 92 ms on PostgreSQL, on a scheme of 60 objects from 33 ms to 21 ms and from 42 ms to 31 ms; a page of 10 000 objects is level. A scheme changed by another process is still seen by the next list call; counts, tree and multi-root lists are unchanged. Packages: `redb.Core`, `redb.Core.Pro`, `redb.MSSql`, `redb.MSSql.Pro`, `redb.Postgres`, `redb.Postgres.Pro`, `redb.SQLite.Pro`. - **`x.Tags != null && x.Tags.Contains(v)` runs as the Contains alone on the Pro providers.** The null guard of an array is dropped when the same AND chain already requires an element of that array (Contains of a value, Any with a condition, or an OR of those); on SQL Server the extra test over the same rows multiplied the compile time and the reads of the statement. Over 100 000 objects such a list with its count runs 1.1 to 1.3 times faster on SQL Server, 1.4 to 1.9 times on PostgreSQL and 1.7 to 6 times on SQLite. Answers do not change; guards under OR or NOT, on another array or standing alone stay as they are. Packages: `redb.Core.Pro`, `redb.MSSql.Pro`, `redb.Postgres.Pro`, `redb.SQLite.Pro`. - **SQL Server Pro: `GroupByArray` over two or more fields of an array element joins them with hash joins when it reads many elements.** Without a condition, and with a condition that matches 10 000 objects or more, the grouping no longer joins the second field as a many-to-many merge that read about 800 000 worktable pages for 133 000 elements; it reads a few thousand pages and runs three to four times faster. Where the statistics happened to give such a conditioned grouping a nested-loops plan, it may now be somewhat slower (about 130 ms on 66 000 objects in our example), in exchange for a time that no longer depends on the state of the statistics. A condition that matches fewer objects keeps its plan, which reads only the matching elements. Tree queries keep their plan. Answers do not change. Packages: `redb.MSSql.Pro`. - **SQL Server Pro runs a GroupBy over the whole scheme with hash joins.** With the query planner on and no condition at all, a grouping that reads two or more fields no longer joins their values through worktables: a two-key grouping over 100 000 objects went from about 1 230 ms to about 134 ms, over 300 objects from 12 ms to 11 ms. Groupings with any condition, with the planner off, with a window over the groups or in a tree keep their statement; answers do not change. Packages: `redb.MSSql.Pro`. - **SQL Server Pro and SQLite Pro write the structure ids of fields into the statement text instead of passing them as parameters.** On SQL Server a statement no longer reuses for one field a plan compiled for another (a plan made for a field of 12 rows read 404 000 pages when run for a field of 100 000 rows, against 1 700 with its own), and the plan cache holds one plan per field for those forms. SQL previews show the ids in the text; on PostgreSQL Pro the same happens in aggregates over array elements and dictionary entries. Values stay parameters, and answers do not change. Packages: `redb.MSSql.Pro`, `redb.SQLite.Pro`, `redb.Postgres.Pro`. - **PostgreSQL Pro: `GroupByArray` without any condition runs with nested loops off for its one statement.** PostgreSQL walked the elements one by one, searching every element field for each of them; it now reads each field once and merges them: on 133 000 elements with two fields 291 ms became 161 ms and 1.62 million buffer reads became 29 000. The setting travels with the statement in one round trip and lasts for that statement only, inside or outside the caller's transaction. A grouping with a condition, and a tree grouping, keep their plan. Answers do not change. Packages: `redb.Postgres.Pro`. ## [4.7.6] — 2026-11-27 ### Changed - **A dictionary read from the database lists its entries by key, the same on every provider.** Strings sort ordinally, numbers, dates and other simple keys by value. The order used to follow the rows of the read (Pro, where it could move between reads) or the JSON of the free modules (by key length on PostgreSQL); code that relied on the order of entries sees the key order now. Packages: `redb.Core`, `redb.Core.Pro`. - **Reading rows into objects (`QueryAsync` of `redb.Context`, and the props loading built on it) now matches each column to its property once per result set and sets properties through compiled setters.** Before, every cell looked its column name up again and was set by reflection. A page of 100 objects with 86 stored values each loads in 79 ms instead of 123 ms on PostgreSQL, 99 ms instead of 117 ms on SQL Server and 73 ms instead of 92 ms on SQLite. Column-name rules, conversions and errors are unchanged. Packages: `redb.Core`, `redb.Postgres`, `redb.MSSql`, `redb.SQLite`, `redb.Postgres.Pro`, `redb.MSSql.Pro`, `redb.SQLite.Pro`. - **Pro: loading a page of objects allocates about 45% less memory.** The values of a read are indexed once, and the materializer no longer goes through reflection for each value. A page of 100 objects with about 85 values each now allocates 5.6 MB instead of 10.2 MB. Answers do not change. An exception thrown while a nested class or a nested object is built now arrives as it is, no longer wrapped in `TargetInvocationException`. Packages: `redb.Core.Pro`, `redb.Core`. - **`AllAsync` with one condition on a plain field and no `Where` no longer counts every object of the scheme twice on SQL Server Pro and SQLite Pro.** It first looks for a counterexample among the first 1 000 objects. If none is found there, it compares two index counts: the objects of the scheme and the values that match. Over 100 000 objects, a false `All` takes about 1 ms (was 26-83 ms). A true `All` takes 40-58 ms on SQL Server (was 57-88 ms) and 17-21 ms on SQLite (was 62-102 ms). Other predicates keep the plans they have. Answers do not change. Packages: `redb.MSSql.Pro`, `redb.SQLite.Pro`. - **SQL Server Pro reads the objects of a query off the index of values when the filter has an equality or a closed range on a number, date, Guid or list field.** Before, it went through every object of the scheme. A count, page, grouping or aggregate with such a condition is now several times faster (an equality matching 2 % of 100 000 objects: count 19 -> 2 ms, sum 25 -> 8 ms, grouping 44 -> 29 ms). Next to a `WhereRedb` range of ids or dates, such a condition also lets SQL Server choose where to start. Text conditions and a `WhereRedb` on a parent or an id list keep today's plans. Answers do not change. Packages: `redb.MSSql.Pro`. - **`AggregateAsync` with only `Min`, `Max` and `Count` and no condition now reads each extreme off the index of values on SQL Server Pro and SQLite Pro.** Before, every object of the scheme was read. This covers number and date fields, nested-class fields included. Min and Max of a decimal field over 100 000 objects: 55 -> 1.2 ms on SQL Server, 66 -> 0.5 ms on SQLite. Batches with `Sum` or `Average`, and any `Where` or `WhereRedb`, keep the plans they have. Answers and result types do not change. Packages: `redb.MSSql.Pro`, `redb.SQLite.Pro`. - **SQL Server Pro: a page sorted by one field under a rare open range on another number or date field is read from the range.** SQL Server used to walk the sort field's index and test the range on every object to fill the page. Now the range's matches are counted first, up to 1 000, and a range at or below that leads the page. `Salary > 0 && Score < 100` by `Salary`, `Take(20)`, 12 of 100 000 objects: 296.5 ms -> 0.8 ms for the statement, the same descending; `Score < 100` alone 52.2 -> 0.9 ms. A range wide in the data keeps the form it had and pays only for the capped count, which adds a fraction of a millisecond to such a page (about 0.6 ms). Answers do not change. Packages: `redb.MSSql.Pro`. - **`AllAsync` over one text field without any other condition no longer reads the text of every object.** PostgreSQL Pro looks for a counterexample among the first objects of the scheme and, when it finds none, compares two counts read from indexes; on a large scheme where the condition holds for every object the answer comes several times faster. Answers do not change. Packages: `redb.Postgres.Pro`. - **An OR of narrow conditions on different fields no longer reads every object when the query also sorts, projects or aggregates other fields, or has another condition next to the OR.** PostgreSQL Pro reads the branches of the OR from the index of values first and starts from the objects found; when they turn out to be many, the query keeps the plan it had. Answers do not change. Packages: `redb.Postgres.Pro`. - **A grouping, aggregate or window that reads a text field after a filter no longer scans every value of each matching object to find it.** PostgreSQL Pro reads the field's own value for each object; on objects with many fields such a query over thousands of matches answers markedly faster. Answers do not change. Packages: `redb.Postgres.Pro`. - **`AggregateAsync` without any condition reads each field straight from its values.** On PostgreSQL Pro `Sum`, `Min`, `Max` and `Average` over a whole scheme no longer join every object to every aggregated field, and whole-number fields are no longer converted to `numeric` row by row; an aggregate over several fields of a large scheme answers several times faster. Answers and their types do not change. Packages: `redb.Postgres.Pro`. - **A query with `WhereRedb` and an equality or a short `IN` on a text field no longer checks that field object by object.** PostgreSQL Pro now answers the text condition from the index of values and starts from whichever side is smaller, so a count, list or page over a wide `WhereRedb` window with a rare text value takes milliseconds instead of reading every object of the window. An id condition of `WhereRedb` (`==`, `>`, `>=`, `<`, `<=`, `IN`) also narrows that index range. Answers do not change. Packages: `redb.Postgres.Pro`. - **A page with no `Where`, sorted descending by a number or date field, now reads the first rows off the index of values of that field.** Objects without a value still come last. Before, every object of the scheme was joined to its value and sorted. On 100 000 objects, `OrderByDescending(x => x.Salary).Take(20)` went from 47-64 ms to 6-10 ms, and with `ThenBy` from 69-115 ms to 5-42 ms. This covers the first 1 000 rows of the order (`Skip` plus `Take`). Deeper pages, ascending pages and pages under any `Where` keep the plans they have. Answers do not change. Packages: `redb.Postgres.Pro`, `redb.MSSql.Pro`, `redb.SQLite.Pro`. - **PostgreSQL Pro: a page filtered by the value of a dictionary entry (`Dict[key] == x`) reads it off the index of values.** Such a condition used to read every entry of the key and sort them before the page was cut; now it starts from the value and stops at the page. A page of 100 by id, `PerformanceReviews[(2024, "Q1")] == "Excellent"` on a third of 100 309 objects: 81 ms -> 1.2 ms; the same at 1 and 20 %. Answers do not change. Packages: `redb.Postgres.Pro`. - **PostgreSQL Pro and SQL Server Pro: a page sorted by a number or date field and filtered by one equality that matches many objects walks the sort field's index.** The equality's matches are counted first, up to 3 000; above that the page is read in the order of the sort field and stops when full, below it the equality leads as before. A page of 100 by date descending, `City == x` on 20 / 33 % of 100 309 objects on PostgreSQL: 69 / 112 ms -> 7.0 / 7.2 ms; on 1 % 6.5 -> 7.6 ms. On SQL Server this applies to number and date equalities only. Ascending sorts over a field some objects lack keep their form. Answers do not change. Packages: `redb.Postgres.Pro`, `redb.MSSql.Pro`. - **SQLite Pro reads an `OR` of narrow conditions from the index of values first in groupings, aggregates and pages sorted by a field.** Before, these queries checked the `OR` against every object of the scheme. A grouping or sum over `A == x || B == y` across 100 000 objects: 250-400 -> 5-22 ms. A page of 20 sorted by `Salary`: 140-250 -> 8-16 ms. A wide `OR` keeps its plan after the probe reaches its cap. Counts and pages sorted by `Id` keep the row prefilter. Answers do not change. Packages: `redb.SQLite.Pro`. - **SQLite Pro: a page ordered by id and filtered by an equality, on a field or on a dictionary entry, no longer sorts every match.** The ids are read in order off the equality's index of values. `Dict[key] == x` on a third of 20 000 objects, a page of 100: 4.5 ms -> 1.6 ms. Answers do not change. Packages: `redb.SQLite.Pro`. ### Fixed - **Pro: a reference at the props depth boundary no longer reads the referenced object's values.** With `WithPropsDepth(1)`, `LoadAsync(id, depth: 1)` or any depth, the references at the boundary come back as stubs (base fields, no props) as before, but the values, list items and types of the referenced objects are no longer read and dropped: such a page now costs one statement for the stubs' base fields. Answers do not change. Packages: `redb.Core.Pro`. - **PostgreSQL: a property whose name differs from a C# keyword only by case (`Ref`, `Default`, `Event`, `String`, `Object`) is accepted.** Scheme sync refused such a property with "Field name is a C# reserved word", while SQL Server and SQLite accepted it. C# keywords are case-sensitive, and now only the exact keywords (`ref`, `default`, `string`) are refused. An existing database gets the corrected check with the module `0.7.23.2` at the next start; where start-up may not change the schema, `redb schema --upgrade` writes the script for the DBA. Packages: `redb.Postgres`, `redb.Postgres.Pro`. - **A page filtered on its sort field and ordered `.OrderBy(field).ThenByRedb(o => o.Id)` no longer fails on PostgreSQL Pro and SQLite Pro.** Such a query, for example `Where(e => e.Salary > 0).OrderBy(e => e.Salary).ThenByRedb(o => o.Id).Take(20)`, threw "column pvt._id does not exist". It now returns the page. Packages: `redb.Postgres.Pro`, `redb.SQLite.Pro`. - **PostgreSQL Pro: on a new database holding a few hundred objects, a grouping or a window over Props fields could run for many minutes.** This happened while PostgreSQL had no statistics for the tables yet: after the first load, a `pg_restore` or an import, and before autoanalyze ran. Pages and counts there were 10-50 times slower too. Such statements now run with nested loops off until the statistics exist. Start-up analyzes tables that hold rows without statistics, and `redb import` into PostgreSQL ends with `ANALYZE`. The start-up index script no longer analyzes the empty tables of a new database. Nothing is required of you. Packages: `redb.Postgres.Pro`, `redb.Export`, `redb.CLI`. ## [4.7.5] — 2026-11-24 ### Breaking - **`TimeSpan` and `TimeOnly` are stored as their ticks in a number column, so they compare, sort, group and take Min/Max correctly on every provider.** As text, values over a day and negative values compared wrong. Every node and image of a database must run 4.7.5, an older one writes text again; there is no way back except a backup. Convert the stored values before the first start with the statement UPGRADING.md gives; values left as text read as empty. Packages: `redb.Core`, `redb.Core.Pro`, `redb.Postgres`, `redb.MSSql`, `redb.SQLite`, `redb.Postgres.Pro`, `redb.MSSql.Pro`, `redb.SQLite.Pro`, `redb.Export`. Upgrade: [UPGRADING.md](../UPGRADING.md#timespan-and-timeonly-are-stored-as-ticks). ### Added - **`RedbSchemaNewerException`.** Thrown at start-up when the database carries a newer redb module that does not serve this package; it names the deployed and the own version and, when the module states it, the package version to upgrade to. Packages: `redb.Core`. - **Pro: `Where(p => p.Lines.Any(l => l.Kind == "a" && l.Active))` over an array or a list of classes.** All conditions read one element, on every provider. The free providers now refuse the form with a clear `NotSupportedException`; before, SQL Server Free returned no object and PostgreSQL and SQLite Free failed in the database. Packages: `redb.Core`, `redb.Core.Pro`, `redb.Postgres.Pro`, `redb.MSSql.Pro`, `redb.SQLite.Pro`. - **Tools can judge the schema version themselves and stop with the same exceptions as the start-up.** `redb.SQLite.RedbService.SchemaVersion` gives the file schema version this build writes into `PRAGMA user_version`, and `RedbSchemaOutdatedException` and `RedbSchemaNewerException` gain constructors that take the reason and the remedy text. They carry the fix of `redb import --parallel` into a database of an older schema. Packages: `redb.Core`, `redb.SQLite`. ### Changed - **A package no longer puts its database module over a newer one.** From 4.7.5 on, a node that finds a newer module starts with a warning when that module serves it, and stops with `RedbSchemaNewerException` without changing anything when it does not; the upgrade script run by hand refuses a newer module the same way. Packages published before 4.7.5 do not know this rule. The module goes to `0.7.23.1` (PostgreSQL) and `0.2.40.2` (SQL Server), a SQLite file to schema 13. Packages: `redb.Core`, `redb.Postgres`, `redb.Postgres.Pro`, `redb.MSSql`, `redb.MSSql.Pro`, `redb.SQLite`, `redb.SQLite.Pro`. Upgrade: [UPGRADING.md](../UPGRADING.md#a-newer-database-module-is-left-in-place). - **The start-up log no longer mentions buying anything.** The Pro welcome banner says that all Pro features are on, free of charge and with no key, without a link to go commercial. Packages: `redb.Core.Pro`. - **`redb export` refuses a database of a newer schema than its own, and the `redb.Export` package depends on `redb.Postgres`, `redb.MSSql` and `redb.SQLite`.** An export from a newer database left out what the tool did not know of it without a word; it now stops with `RedbSchemaNewerException`: export with the CLI of the version the database runs. An older source stops with `RedbSchemaOutdatedException`. An import into a newer database goes on when the database states that it serves this version, as a service start does. The schema numbers come from the provider packages, hence the new dependencies. Packages: `redb.Export`, `redb.CLI`. - **SQL Server: the count a delete returns no longer includes descendants.** `DeleteAsync` over ids or objects returns the requested objects it deleted, as on PostgreSQL and SQLite; it used to add every descendant removed with them. Packages: `redb.MSSql`, `redb.MSSql.Pro`. ### Fixed - **A comparison of a field with a computed value failed with "variable 'p' ... is not defined".** A value of your own built from parts (`p.Title == tag + "-x"`, `p.Age == limit + 1`, `x ?? "d"`, a ternary), a field against an expression over fields (`p.A == p.B + 1`, `p.Full == p.First + " " + p.Last`) and a field against a field (`p.A > p.B`) now filter as LINQ does, on every provider. Packages: `redb.Core`. - **SQLite Pro: a decimal read back from its REAL column lost digits or gained binary noise.** A value with more than 15 significant digits came back cut (12345678901234.567 as 12345678901234.6), and on some runtimes every decimal came back with the exact binary value of the stored double (123.45 as 123.45000000000000284217094304). A decimal now reads back as the shortest number that the stored double stands for, on every runtime, also in Min, Max and Sum. Packages: `redb.Core`, `redb.SQLite`, `redb.SQLite.Pro`. - **`DeleteSubtreeAsync` counts only the objects it deleted.** It answered the size of the subtree it had collected, so an object another session deleted in the meantime was counted too. Packages: `redb.Core`, `redb.Postgres`, `redb.MSSql`, `redb.SQLite`. - **A filter on a field named `Count` or `Length` reads the field.** Such a member was taken for the size of a collection or a string, and the query failed; the size of a real list or string is read as before. Packages: `redb.Core`. - **Free: a list read builds the JSON of each object once.** The statement that finds the objects read each one with `get_object_json`, and the lazy loader built it again; it now reads their rows only, so a list page (and a tree read on SQLite) is faster, and Props come from the Props cache where it holds them. Packages: `redb.Core`, `redb.Postgres`, `redb.MSSql`, `redb.SQLite`. Upgrade: [UPGRADING.md](../UPGRADING.md#custom-dialects-query_wrappvtwithobjectrows). - **Free: `Query().DeleteAsync()` works.** A query delete threw `NotSupportedException` on every Free provider; it now deletes the objects the filter selects, as a list read finds them, and returns how many it deleted, as on Pro. Packages: `redb.Core`, `redb.Postgres`, `redb.MSSql`, `redb.SQLite`. - **SQLite: a delete over a batch counts a parent and its child both.** The child, removed with its parent by the cascade before the statement reached it, was not counted. The same holds for a query delete and a tree delete by ids. Packages: `redb.Core`, `redb.SQLite`, `redb.SQLite.Pro`. - **Free: `ToAggregateSqlStringAsync` shows the aggregate statement that runs.** It threw `NotSupportedException` on every Free provider; it now returns the statement the database module compiles for the same aggregates and `Where`, ready to run as it is. Packages: `redb.Core`, `redb.Postgres`, `redb.MSSql`, `redb.SQLite`. - **Free: `WhereHasAncestor` / `WhereHasDescendant` over a type without a scheme name the type.** They failed with "Legacy ... SQL path is removed"; they now throw `InvalidOperationException` when the query is built, with the type in the message, as `Query()` does for such a type. The scheme is looked up as `Query()` looks it up: a scheme this process has not synced is read from the database. Packages: `redb.Core`, `redb.Postgres`, `redb.MSSql`, `redb.SQLite`. - **`SumAsync`, `AverageAsync`, `MinAsync`, `MaxAsync` and `GetStatisticsAsync` over `p.Items[0].Rank` or `p.ByKey["k"].Rank` returned the object's own `Rank`, and a window `PartitionBy`/`OrderBy` over such a path used it too.** They now read the element or the entry, or refuse the path with `NotSupportedException`, and `p.Score.Value` of a nullable field works. Recheck the results of such queries. Packages: `redb.Core`. - **SQL Server: concurrent saves of different objects deadlocked each other.** Up to 250 rows per table a save now inserts with statements and no longer deadlocks; a larger one keeps the bulk load and its retry. On every provider a save locks only the objects that existed before it, and a delete, soft-delete mark or purge batch outside a transaction is retried on a deadlock like a save; inside your transaction the deadlock reaches you (see "Deadlocks and retries" in the README). Packages: `redb.Core`, `redb.MSSql`. - **A filter on `.Value` or `.HasValue` of a dictionary entry (`p.Scores["a"].Value == 1`) failed in the database with an empty field name.** It now filters by the entry. A sort through a dictionary entry, an element by index or a method call (`OrderBy(p => p.Items[0].Name)`) is refused with the same message as such a filter; it used to sort by the field of that name of the object itself. Packages: `redb.Core`. - **`Where(p => list.Contains(p.F))` and its negation read every value of the list as the field stores it.** On Pro a null in the list was sent as 0, false or an empty text and could match objects holding that value, and a list of floats was cut to whole numbers; lists of chars, Guids, dates, times and enums failed. A null in the list is now ignored, and `!list.Contains(p.F)` over an empty list returns the objects that have a value, not those without one. Packages: `redb.Core`, `redb.Postgres`, `redb.MSSql`, `redb.SQLite`, `redb.Postgres.Pro`, `redb.MSSql.Pro`, `redb.SQLite.Pro`. - **`Where(p => p.Arr.Any())` over an array or a list of simple values gives the right answer on every provider.** On PostgreSQL it failed with `function length(text[]) does not exist`, on SQLite an empty or missing array counted as non-empty, and on SQL Server `!p.Arr.Any()` returned no object. Packages: `redb.Core`. - **`Where(p => p.Roles.Any(r => ...))` over list items answers only what it reads.** An operator other than `==` (`r.Value != x`, `r.Id > n`) was read as `==` and gave a wrong answer without a word; it is now refused with `NotSupportedException`. `!p.Roles.Any(r => r.Value == x)` also returns the objects with an empty or no list on PostgreSQL and in SQLite Pro, as it did on SQL Server and SQLite Free. Packages: `redb.Core`, `redb.Postgres`, `redb.Postgres.Pro`, `redb.SQLite.Pro`. - **A list no longer hands out an object with null `Props` when it is deleted during the query.** The objects and their values are read by two statements; an object deleted in between came back without `Props`. It now leaves the result, so a page may come back shorter in that race. Packages: `redb.Core.Pro`, `redb.Postgres`, `redb.MSSql`, `redb.SQLite`. - **Pro: an object with a dictionary of a nullable value type (`Dictionary`) could not be loaded.** Every read of it failed with "cannot be converted to Nullable`1" on every provider. Such dictionaries now read back as saved, and a null in an array or list of a nullable value type (`int?[]`, `List`) keeps its position instead of being left out. Packages: `redb.Core.Pro`. - **PostgreSQL: `redb import` refuses a file with references to rows it does not hold, as SQL Server does.** Such rows were loaded silently. The import now names each broken key, the number of rows and an example; a serial import changes nothing, a `--parallel` one has already written its rows. A file exported with `--schemes` whose objects point into a scheme left out is refused this way: export the schemes it references too. Packages: `redb.Export`, `redb.CLI`. - **SQLite: `redb import` refuses a file with references to rows it does not hold, as PostgreSQL and SQL Server do.** Such rows were loaded silently. The import now names each broken key, the number of rows and an example, and changes nothing. A file exported with `--schemes` whose objects point into a scheme left out is refused this way: export the schemes it references too. Packages: `redb.Export`, `redb.CLI`. - **`redb import --parallel` into a database of an older schema emptied the target and stopped; the import now refuses such a target before it touches anything.** Every import checks the target's schema first and stops with `RedbSchemaOutdatedException` naming the upgrade to run, or names `redb init` when the schema is missing. The check adds exception constructors and `redb.SQLite.RedbService.SchemaVersion`, and `redb init -p sqlite` now stamps the file. Packages: `redb.Export`, `redb.CLI`. - **`redb import --parallel` attempts every finishing step and reports their failures together.** When one step after the load failed (the id sequence of a database that had lost it), the steps after it never ran: the secondary indexes of the large tables stayed out and, on SQL Server, every constraint and trigger stayed off. The sequence, the index rebuild and the constraints now each run whatever the others do, and the error names every step that failed. Packages: `redb.Export`, `redb.CLI`. - **An import builds the scheme metadata cache of every imported scheme.** The first query of an application rebuilt it, which is slow on a large database and needs write rights. Packages: `redb.Export`, `redb.CLI`. - **An import of a file written before TimeSpan and TimeOnly were stored as ticks no longer puts their text type back.** The target keeps its own built-in `_types` rows whatever the file says, and the import's last lines name the imported values stored as text, which the upgrade notes convert. Packages: `redb.Export`, `redb.CLI`. - **A delete counts only what it deleted.** On SQL Server `DeleteAsync` answered true, and the batch overload counted, objects another session had already deleted; on SQL Server and PostgreSQL a soft delete moved an object already in the trash into a second trash and counted it. Packages: `redb.MSSql`, `redb.MSSql.Pro`, `redb.Postgres`, `redb.Postgres.Pro`. - **SQL Server (Free): `WhereLevel(n)` filters.** An exact level of a query over the whole scheme was dropped from the filter, and every node came back; `WhereLevel(l => l > n)` worked. The module goes to `0.2.40.2` at the next start. Packages: `redb.MSSql`. - **SQL Server (Free): a list read keeps the order of the query.** The database module dropped the ORDER BY of a query without paging, and the order of a page or of `OrderByDescending(key).DistinctBy(key)` was left to the plan. The module goes to `0.2.40.2`; it is applied on the next start, as every module update. Packages: `redb.MSSql`. - **SQL Server (Free): a tree query returns its page in the order asked for.** The page was joined to the objects without carrying the order, and kept it only while the plan happened to be a nested loop. Packages: `redb.MSSql`. - **PostgreSQL (Free): a list read keeps the order of the query in every plan.** The order was numbered above the inner query and held only while the plan read its rows in order. The module goes to `0.7.23.1`; it is applied on the next start, as every module update. Packages: `redb.Postgres`. - **An aggregate over a field of an element of an array of classes by index (`Agg.Sum(x.Props.Items[0].Rank)`) returned 0 or null.** It is now refused with `NotSupportedException`; redb Pro reads it. Recheck the results of such queries. Packages: `redb.Postgres`, `redb.MSSql`, `redb.SQLite`. - **PostgreSQL: the creation script (`GetSchemaScript`) run again on a deployed database stops at its first statement and changes nothing**, as the SQL Server script does since 4.7.3. Run it with `psql -v ON_ERROR_STOP=1`. On SQL Server a refused creation script no longer leaves a pooled session that runs no further command. Packages: `redb.Postgres`, `redb.Postgres.Pro`, `redb.MSSql`, `redb.MSSql.Pro`. - **Pro: a query delete counts a parent and its child both, and a filter on base fields only works.** On SQLite the child the cascade removed with its parent was not counted, and a delete filtered only on base fields (`WhereRedb`) failed with "no such column: o._id". On SQL Server a query delete that matched an object with children failed on the `_id_parent` foreign key; it now deletes the subtree, as `DeleteAsync` does. Packages: `redb.Postgres.Pro`, `redb.MSSql.Pro`, `redb.SQLite.Pro`. - **Pro: `TreeQuery()` without a root reads every node of the scheme.** It started at the roots of `T`'s scheme and missed every node in a tree whose root is of another scheme; `WhereLevel` now counts from the real root of the tree, as documented and as on Free, and `WhereHasAncestor` finds those nodes too. Packages: `redb.Postgres.Pro`, `redb.MSSql.Pro`, `redb.SQLite.Pro`. - **`WhereHasAncestor` and `WhereDescendantsOf` reach nodes below nodes of other schemes.** In a tree of several schemes Pro walked down only through nodes of one scheme (`WhereHasAncestor` on PostgreSQL and SQLite, `WhereDescendantsOf` on all three), so an ancestor or a descendant under a node of another scheme was missed and the list and its analytics came back short or empty. The tree below the start is now walked whole, through nodes of every scheme, as Free does. Packages: `redb.Postgres.Pro`, `redb.SQLite.Pro`, `redb.MSSql.Pro`. - **Pro: `ToAggregateSqlStringAsync` over a dictionary shows the aggregate that runs.** An aggregate of `Dictionary.Values` or of one key (`x.Props.BonusByYear[2023]`) previewed as `SELECT 1 AS "_empty"`; the preview now reads the selector as `AggregateAsync` does. Packages: `redb.Postgres.Pro`, `redb.MSSql.Pro`, `redb.SQLite.Pro`. - **Pro: `WhereHasAncestor` / `WhereHasDescendant` over a type without a scheme throw.** The filter was dropped and the query returned every node. It now throws `InvalidOperationException` naming the type when the query is built; make the type a `[RedbScheme]` class. A scheme this process has not synced is read from the database, as `Query()` reads it. Packages: `redb.Postgres.Pro`, `redb.MSSql.Pro`, `redb.SQLite.Pro`. - **Pro: `Agg.Sum(x.Props.Score.Value)` in `AggregateAsync` and `GetStatisticsAsync(p => p.Score.Value)` returned 0 on PostgreSQL and SQL Server Pro, and an aggregate over a dictionary entry or an element of an array of classes read none, or the largest of all entries.** They now read the field and the entry by its key. Recheck the results of such queries. Packages: `redb.Postgres.Pro`, `redb.MSSql.Pro`, `redb.SQLite.Pro`. - **Pro: a filter `p.Scores["n"] != null` (or `== null`, `.HasValue`) on a dictionary entry holding null answered whether the dictionary had any entry.** On SQLite Pro, and on PostgreSQL and SQL Server Pro with the query planner on, an entry stored with a null value counted as set. It now tests the entry's own value. Packages: `redb.Postgres.Pro`, `redb.MSSql.Pro`, `redb.SQLite.Pro`. - **PostgreSQL Pro: `DistinctBy` on a field some objects lack put the object without a value last when ascending.** It now comes first ascending and last descending, as in every other ordering and on the other providers. Packages: `redb.Postgres.Pro`. ## [4.7.4] — 2026-11-20 ### Changed - **redb.MSSql 4.7.4 and redb.CLI 4.7.4; the other redb packages stay 4.7.2.** redb.CLI carries the module of redb.MSSql 4.7.4, so `redb init` and `redb schema` install the fixed module; update both. The Tsak and Identity images and archives keep redb.MSSql 4.7.2 in `Libs/shared` until 4.8.0: on SQL Server Free put `redb.MSSql.dll` of the 4.7.4 package there, or every node of the database puts the old module back at start. Affected: SQL Server with the Free provider only; the Pro provider is not affected. ### Fixed - **SQL Server (Free): a filter on a base field with a long condition was dropped when the query also filtered on a props field or grouped, aggregated or used a window.** For example, `WhereRedb(o => ids.Contains(o.ParentId.Value))` with about 400 ids or more (the condition over 4,000 characters) returned objects outside the id list: every object the props filter let through. The module goes to `0.2.40.1` at the next start; run every node of a database on this release, since an older 4.7 package puts its own module back when it starts. Packages: `redb.MSSql`. ## [4.7.3] — 2026-11-19 ### Changed - **redb.CLI 4.7.3; the redb packages stay 4.7.2.** Only the redb.CLI tool and its standalone executables are released; they carry the SQL Server creation script with the guard below. redb.Core, the providers and redb.Export on nuget.org stay at 4.7.2 and are not republished. ### Fixed - **`redb init` no longer damages a SQL Server database that already holds the redb schema.** Run a second time, it dropped every foreign key and the id sequence before it failed, and a later import or application failed on the missing sequence. On PostgreSQL and SQL Server `redb init` now refuses a database that holds the schema before it runs anything, and the SQL Server script printed by `redb schema` stops on such a database before its first statement. A SQL Server database where `redb init` ran twice may have been hit: the upgrade notes say how to check it and how to repair it. Packages: `redb.CLI`. Upgrade: [UPGRADING.md](../UPGRADING.md#sql-server-a-database-hit-by-a-second-redb-init). ## [4.7.2] — 2026-11-13 ### Fixed - **SQLite: saving an object again after its transaction rolled back no longer overwrites another object.** Since 4.0.0, ids a save took inside a transaction that rolled back went to the next save too: saving the first object again silently replaced the second one's data, and later saves and deletes could fail with `UNIQUE constraint failed` on `_objects._id` or `_values._id`. SQLite now never hands out an id twice. On every provider the ids a save assigned inside a rolled-back transaction go back to 0 on the objects, and a scheme created there is created again. Packages: `redb.Core`, `redb.Core.Pro`, `redb.SQLite`, `redb.SQLite.Pro`. ## [4.7.1] — 2026-11-11 ### Fixed - **Constant and captured bool conditions in `Where`, `WhereRedb` and `AllAsync`.** A bool variable of the caller in a condition (`Where(x => includeAll || x.Age >= 32)`, `Where(x => !skip)`) failed with "Expression must be a property access"; it is now read as the value it holds. On the free providers `Where(x => true)`, `Where(x => false)` and `AllAsync` with such a predicate failed in the SQL module; they now keep every object or none. Packages: `redb.Core`. - **A filter by an array or list element taken by index, or through a method call in the path, read another field.** `Where(x => x.Items[0].Name == "a")` and `Where(x => x.Items.First().Name == "a")` compared the field `Name` of the object itself and returned its rows, or failed later with "field not found". Such a filter now fails at once with `NotSupportedException` naming the path; use `Contains(...)` for an array of simple values, `Any(...)` for an array of list items, or keep the data in a dictionary and read the entry by its key. Packages: `redb.Core`. - **Pro: a constant inside OR returned wrong rows.** `Where(x => x.Age >= 32 || true)` returned only the objects matching the comparison and `Where(x => x.Age >= 32 || false)` returned nothing; they now return every object and the matching ones, as LINQ does. The same holds for the `redbQuery` forms `x not in OR ...` and `x in OR ...`. On PostgreSQL Pro `AllAsync(x => true)` answered false for a set with objects; it answers true. A constant alone or inside AND answered right and is unchanged. Packages: `redb.Core`. - **SQL Server: the database module never reached the version the package asks for** (4.6.1 to 4.7.0). Every start applied the module again, and a start with `AutoApplyDatabaseUpgrades = false` or under a role without schema rights stopped with `RedbSchemaOutdatedException`, also right after the upgrade script was applied. Update the package: the module goes to `0.2.40` once and later starts leave the schema alone. Packages: `redb.MSSql`, `redb.MSSql.Pro`. ## [4.7.0] — 2026-11-06 ### Added - **`dotnet new redb-route-xmljson`: XML to JSON and back without a class.** A Tsak module whose XML routes turn an order into JSON by an XSD (arrays, numbers, booleans) and an HTTP API that turns it back into namespaced XML and checks it; the same round trip in C# with `MarshalXmlJson` / `UnmarshalXmlJson`. Packages: `redb.Templates`. ### Changed - **`redb-route-beans` shows the bean step and a bean call in a condition.** The order route prices a line with `` and marks bulk lines with ``; `PriceCalculator` has the synchronous `IsBulk(int)` the condition calls. Packages: `redb.Templates`. ### Deprecated - **.NET 8 and .NET 9 targets end with 4.7.** Microsoft's support for both ends on 10 November 2026, so 4.7.0 is the last release whose packages target them; from 4.8.0 the packages target .NET 10 and later. Fixes on the 4.7.x line are still built for .NET 8, 9 and 10 while those lines can be built without known vulnerabilities. Move your projects to .NET 10 before taking 4.8.