docs.rs failed to build alopex-sql-0.6.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build:
alopex-sql-0.5.0
alopex-sql
alopex-sql は Alopex の SQL レイヤーを提供します。v0.5.0 では GROUP BY/HAVING と集約関数をサポートします。
Quick Start
use ;
use MemoryKV;
use MemoryCatalog;
use AlopexDialect;
use ;
use Parser;
use Planner;
let sql = r#"
CREATE TABLE sales (region TEXT, amount INT);
INSERT INTO sales (region, amount) VALUES ('us', 10), ('us', 20), ('eu', 7);
SELECT region, SUM(amount) FROM sales GROUP BY region;
"#;
let dialect = AlopexDialect;
let statements = parse_sql.unwrap;
let catalog = new;
let store = new;
let mut executor = new;
for stmt in statements
GROUP BY / HAVING
SELECT category, COUNT(*) FROM products GROUP BY category;
SELECT category, COUNT(*) FROM products GROUP BY category HAVING COUNT(*) > 10;
SELECT category, COUNT(*) FROM products GROUP BY category ORDER BY COUNT(*) DESC;
Supported Aggregate Functions
COUNT(*)COUNT(column)COUNT(DISTINCT column)SUM(column)(numeric)TOTAL(column)(numeric, returns 0.0 for all-NULL)AVG(column)(numeric)MIN(column)/MAX(column)(comparable types)GROUP_CONCAT(column)/GROUP_CONCAT(column, separator)STRING_AGG(column, separator)
Limitations
- JOIN/Subquery/Window 関数は未対応。
SUM/AVG/MIN/MAXのDISTINCTは未対応。GROUP BYの式は現状カラム参照のみを想定。
Error Scenarios
ColumnNotFound: 存在しないカラムをGROUP BYで参照した場合。TypeMismatch:SUM/AVGに非数値型、GROUP_CONCATに非 TEXT を指定した場合。InvalidExpression:HAVINGやSELECTで GROUP BY に含まれない非集約列を参照した場合。ResourceExhausted: グループ数が上限を超えた場合(デフォルト 1,000,000)。