跳到正文

SuperDB 版本记录

一款命令行分析数据库,通过扩展 SQL 方言查询关系表和异构 JSON 数据。

Cask数据库 1,577
主页
安装命令
brew install --cask super
近 30 天安装
2
App榜第 2552
近一年安装
65
365 天累计
最新版本
0.5.0
下载大小
16MB
gz
更新节奏
每月
近 30 天 2 个版本
  1. 0.5.0

    最新

    GitHub Release Homebrew 收录

    Highlights

    • The algebraic data model and a blog: The docs now open with a chapter on the algebraic data model behind SuperDB, and a new blog starts with posts on the sum type hiding in GitHub Archive JSON and on JSON's map-or-record problem.
    • Faster aggregations: For faster performance, aggregations and distinct now use a vectorized hash table, and scans of BSUP files read less data for queries that use only a value's type, a type assertion, or some of a record's fields.
    • AI agents via MCP: super db mcp and super db serve -mcp let AI agents describe, query, and load a database through the Model Context Protocol.
    • Working with sum types: Type assertions (e.g., x.(int64) ?? 0), match expressions on a value's type, functions that construct types, and type narrowing in the type checker make values of union types easier to work with.
    • Consistent comparisons: Comparisons are now type-checked by the same rules at compile time and at run time, and values of every type have an order.

    BREAKING CHANGES

    Users of earlier releases should expect to regenerate any saved binary files and databases from their original sources, and to update some queries. If you have valuable saved data you can't easily regenerate, please speak up on community Slack or open an issue for assistance.

    • BSUP files and databases written by earlier releases, or by builds of main since v0.4.0, can't be read by this release and fail with a version mismatch error. The BSUP format has changed for faster type handling, and the database version has advanced with it (#7605, #7609, #7619, #7726, #7727).
    • Comparisons are no longer polymorphic. Comparing values of different types (e.g., 1 == "a", which was false) now converts the operands when possible and is otherwise an error, reported by the compiler when the types are known and as an error value at run time otherwise. The in operator now reports the same errors at run time as at compile time. compare() still compares values of any types (#7663, #7667).
    • Static type checking is stricter. These are now compile errors: arithmetic on a union with a non-numeric type (e.g., x+1 where x is int64|string; narrow it first with a type assertion like x.(int64) ?? 0 or a filter like where is(x, <int64>)), a reference inside ok() to a field that no input can have, and LIKE on a value that isn't a string (e.g., bytes, where it was silently false) (#7652, #7670, #7698).
    • After an outer join, the side that may be unmatched is now typed as possibly missing, so a bare reference such as right.color is a compile error where it was error("no such field right") at run time. Use ok() or ?., which now turns a missing field into none, e.g., this?.right?.color ?? "unpainted" (#7704).
    • unnest no longer treats a two-field record specially, so unnest {id,a} is now an error. Use unnest a with id, which puts the element first ({a:1,id:1}), or name the element with :=, as in unnest item:=a with id (#7600).
    • grep() now always treats its pattern as a regular expression, so a pattern without metacharacters is now case-sensitive, where it was a case-insensitive substring search (e.g., grep("BAR", "foobar") is now false). Start the pattern with (?i) to ignore case. Search expressions such as search BAR are unchanged (#7723).
    • The unnamed columns of SQL VALUES rows and tuples are now named column1, column2, and so on, as in PostgreSQL, where they were c0, c1 (e.g., values (1,2) is now {column1:1,column2:2}) (#7669).

    Added

    • Model Context Protocol (MCP) support for AI agents: super db mcp runs an MCP server over standard input and output, and super db serve -mcp adds an MCP endpoint to a running service (see also -mcp.readonly and -mcp.include). Its tools list and describe tables, run queries, and load data, including CSV with a delim argument (#7602, #7677).
    • Type assertions: e.(T) is e if it has type T and none otherwise, e.g., x.(int64) ?? 0, or x.(Push)?.ref to pick a member of a sum type (#7592).
    • match expressions select a result by the type of a value, e.g., match this when int64 "int" when string "str" else "other" (#7595, #7604).
    • New functions that construct types from other types: array_type(), enum_type(), error_type(), fusion_type(), map_type(), named_type(), option_type(), record_type(), set_type(), and union_type(), e.g., array_type(<int64>) is <[int64]> (#7579).
    • The type checker now narrows types after a filter, e.g., after where is(x, <int64>), x is treated as an int64 (#7629).
    • New supertypeof() function, which returns a value's type including any fusion types, which typeof() leaves out (#7577).
    • New has() function, which tests whether a record (or record type) has a field or a map has a key (#7635).
    • Records can now be cast to maps (e.g., map{string:any}) and maps to records (#7591).
    • Materialized subqueries: let q = materialized (...), with t as materialized (...), and values materialized (...) run their query once and reuse its output (#7640).
    • The output operator can now end a subquery (including the body of unnest ... into), sending its values to the query's output (#7639).
    • from with a computed (f-string) URL now accepts the method, headers, and body options, and when from has a parent, these options are evaluated for each input value (#7624).
    • New delim option on from for CSV sources, e.g., from data.csv (delim ';'), and on SQL FROM (#7675).
    • super -c <query> -- - and super db -c <query> - read the lines of standard input into the args constant (#7574).

    Changed

    • A none value (e.g., from ok() or ?.) is now dropped from query output, and a pipe subquery that produces no values is now none rather than null, so it disappears from a record, array, or map (e.g., {s:(unnest a | where this > 1)} is {} where it was {s:null}). SQL subqueries still give null (#7584, #7635).
    • optionize() now treats a field whose type includes null like a missing field (e.g., {y?:string} rather than {y?:string|null}), and casting null to an option type that doesn't admit null now gives none (#7590).
    • Accessing a field of a null record now gives null rather than an error, and the fields of a nullable record (e.g., null|{b:int32}) can now be accessed (#7613, #7617).
    • The comparison operators <, <=, >, and >= now order values of every type, including bool (false < true), net, arrays, sets, maps, records, enums, and type values, and NaN now sorts after all other numbers in comparisons, compare(), and sort (#7664, #7665, #7674, #7685, #7687, #7689, #7690, #7706, #7707, #7709, #7711).
    • under() of a value of a named union type now removes only the name, so the value keeps its union type (e.g., under(1::U) is 1::(int64|string) where it was 1) (#7620).
    • JSON input is now batched by size as well as by count, with a batch ending at 16 MB of input by default (set with the new -json.inputcapbytes flag), so inputs with large values use much less memory (#7701).

    Fixed

    • Fix distinct returning duplicate values when it ran in parallel (e.g., on BSUP files) (#7589).
    • Fix switch sending a value down a case whose result was null or not a Boolean, and a related panic (#7632).
    • Fix filters after an outer join returning extra rows, e.g., LEFT JOIN ... WHERE p.color='red' returned every left row. An outer join is now turned into an inner join when such a filter can't be true for unmatched values, so the filter is still pushed down (#7703, #7705).
    • Fix subtracting two timestamps, which gave a timestamp rather than a duration (#7593).
    • Fix bucket() returning constant values unchanged (e.g., timestamps in a BSUP frame that all have the same value, or SQL CAST(... AS DATE) of a constant), and rounding up rather than down before 1970 and for negative durations (#7713, #7716).
    • Fix position() counting bytes rather than characters (#7720).
    • Fix search expressions and grep() matching the wrong values inside arrays, sets, and maps after a filter, search panics on nulls and on unions inside errors, and has_error() panics and wrong results after a filter (#7644, #7645, #7646).
    • Fix the JSON reader splitting a number that straddled a 512 KiB buffer boundary, and typing an empty array as [missing] when the same field is a non-empty array elsewhere. Fix JSON output panicking on infinite and NaN floats, which are now written as the strings "+Inf", "-Inf", and "NaN" (#7578, #7724, #7725).
    • Fix reading BSUP frames larger than 100 MB, a race that could panic with type "foo" redefined or give wrong values when a query reads the same BSUP file more than once, and lost type names and panics when projecting fields from a union of named record types (#7598, #7642, #7651).
    • Fix super db panics loading values of a named record type into a sorted table and compacting a table of mixed types, a crash when filtering a table with more than one data object, and the service's /compile endpoint (#7661, #7686, #7699).
    • Fix unnest of an array expression whose elements all disappear (e.g., spreads of non-arrays), and panics after unnest or values over values of mixed types (#7612, #7672).
    • Fix casting none to a named type, which gave a wrong value (e.g., -128::named), and the field name derived from a ?. expression (e.g., put o?.y added a field named "o?.y") (#7601, #7676).
    • Fix SQL queries dropping columns when the input mixes a named record type with other record types (#7603).
    • Fix writing Parquet when a field from fuse is null wherever it's present, which failed with unsupported type: not implemented: support for DENSE_UNION (#7694).
    • Fix a leading UTF-8 byte order mark (as written by Excel and Windows Notepad) ending up in the first CSV or TSV column name, or making JSON, SUP, and Zeek input fail to parse or be auto-detected. It's now skipped (#7668).
    • Fix subqueries over a computed from (e.g., [from f"{this}"]) returning nothing or hanging after an earlier value hit an error (#7662).
    • Fix a record spread of a union value, which contributed no fields (#7719).
    • Fix panics: in substring(); when a user function calls an unknown function; when a recursive function is used as an operator (now an error asking for values or where); when indexing gives an error (e.g., [1][2]); in a conditional expression over database data; and in from with a computed path over mixed-type input (#7583, #7627, #7658, #7659, #7660, #7678).

    Performance

    • Faster aggregations and distinct, using a new vectorized hash table (#7607, #7631, #7643, #7648, #7650, #7654, #7655, #7656).
    • Scans of BSUP files read only types, not values, for queries that use only a value's type (e.g., typeof() or kind()), and read only the selected member of a union for a type assertion (#7653, #7657, #7683).
    • Fields of a values record that nothing downstream uses are no longer read from files (#7587, #7673).
    • Faster in with a constant list, and faster comparisons of dictionary-encoded columns with constants (#7679, #7680, #7696, #7721).
    • Faster field access through unions with missing, as in fused JSON data (#7708).
    • Faster queries over values of mixed types and unions (#7691, #7692, #7693, #7717).
    • Faster conditional (?:) expressions, notably in recursive functions, and less memory used by any() (#7586, #7596).
  2. 0.4.0

    OpenNavo 编辑 Homebrew 收录

    SuperDB 0.4.0 于 2026-10-31 发布,将所有查询迁移到向量运行时,并统一了二进制格式。

    SuperDB 0.4.0 于 2026-10-31 发布,将所有查询迁移到向量运行时,并统一了二进制格式。

    亮点

    • 所有查询现在都在向量运行时中运行,许多函数和运算符都有了原生向量实现。
    • 基于行和基于列的二进制格式合并为一种可同时容纳两者的 BSUP 格式;早期版本写入的文件和数据库无法被此版本读取。
    • 持久化数据库回归:可以使用 SQL CREATE TABLE 和 INSERT INTO 创建和加载表,包括会校验每个值的类型化表,而 CREATE SUPER TABLE 可以构建任意 SuperSQL 类型的表。
    • 选项类型和 none 值取代 error("missing"),新增 ?? 和 ?. 运算符以及 ok() 和 is_ok() 函数。
    • 在可能的情况下,输入默认会进行静态类型检查,联合类型会被严格检查。
    • 本地文件的格式现在跟随其扩展名,输出格式跟随传给 -o 的扩展名;-i auto 仍然请求自动检测。

    不兼容变更

    • 池(pool)现在称为表(table),super db auth 和 super db login 被 super db attach 和 super db detach 取代;SUPER_DB 环境变量已被移除。
    • time 类型重命名为 timestamp,JSUP 格式和 table 输出格式已被移除,非聚合的 max() 和 min() 重命名为 greatest() 和 least()。
    • 早期版本保存的二进制文件和数据库必须从原始来源重新生成,部分查询需要更新。
  3. 0.3.0

    OpenNavo 编辑 Homebrew 收录

    新增操作符、函数和命令;BSUP 更新至 v2,聚合与字符串行为发生变化,并修复两个错误。现不再支持读取 BSUP v1 输入。

    新增
    新增 debug 和 infer 操作符。新增 defuse 和 unblend 函数。新增 db vacate 命令。新增 Fusion types、upcast 中的命名类型及记录表达式可选字段。
    变更
    BSUP 升至 v2;不再支持读取 BSUP v1 输入。collect 和 union 会丢弃 error("quiet"),并保留 error("missing")。concat 和 f-strings 现在会忽略 null 值。许可证已变更;macOS 发布制品现已签名并公证。
    修复
    修复数组位于 union 中时的 unnest 问题。修复 float16 和 float32 转字符串时的精度问题。

    SuperDB 0.3.0 将 BSUP 格式升级至 v2。本版本不再读取 BSUP v1 输入,且不兼容此类输入。对于难以从原始来源重新生成、且有重要价值的 BSUP v1 文件,发布说明建议用户通过社区 Slack 或提交 issue 寻求帮助。

    新增功能包括 debug 和 infer 操作符、defuse 和 unblend 函数,以及 db vacate 命令。本版本还加入 Fusion types、upcast 中的命名类型,以及记录表达式中的可选字段。

    行为变更包括:collect 和 union 聚合函数会丢弃 error("quiet") 值,并保留 error("missing") 值;concat 函数和 f-strings 会忽略 null 值。许可证变更为 SuperDB Source Available License v1.0,macOS 发布制品现已签名并公证。修复内容包括数组位于 union 中时的 unnest 问题,以及 float16 或 float32 转换为字符串时的精度问题。

    来源:https://github.com/superdb/super/releases/tag/v0.3.0

  4. 0.2.0

    展开

    GitHub Release

    BREAKING CHANGE

    With the advance of the BSUP format to v1, super will no longer read BSUP v0 format as input. There is currently no backward compatibility in super for reading BSUP v0 inputs. If you have valuable saved BSUP v0 files that you cannot easily regenerate into v1 from their original sources, please speak up on community Slack or open an issue for assistance.

    Added

    • New upcast function (#6634)
    • Line numbers are now shown for SUP parsing errors (#6630)
    • Optional fields in records (#6669)

    Changed

    • Upgrade to github.com/apache/arrow-go/v18@v18.5.1 (#6625)
    • Type fusion now ensures any fused unions contain at most one instance of each kind of complex type (#6651)
    • Type decoration for self-describing error values in SUP are now omitted (#6656)
    • By default, super now reads the first 1000 values when reading from an input file to infer type information used to type check the query. This can cause type errors when data being referenced occurs later in the input. The -samplesize flag can be used to adjust this. (#6667)
    • The BSUP format has been advanced to version 1 (#6674)

    Removed

    • Typed nulls are no longer supported, with nullable values now represented with a union that includes type null (#6633)

    Fixed

    • vam: Casting an error value now propagates the error (#6602)
    • vam: Fix an issue where a mixed type error was not returned if the aggregation received a number first followed by a string (#6618)
    • vam: Fix a rename operator issue where nested records were not getting assigned updated types (#6623)
    • Fix a deadlock that could occur when running a group-by aggregation on BSUP input (#6624)
    • The BSUP union tag is now encoded as a uvarint, in line with the specification (#6660)