Repository navigation
v1.14.1
#66
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
NeoSQLite v1.14.1 Release Notes
TL;DR
NeoSQLite v1.14.1 is a correctness and compatibility release that eliminates major limitations in the SQL evaluation tier. It introduces Static Type Inference to perfectly match MongoDB BSON type semantics even for computed expressions and provides full SQL-tier support for the
$typeoperator.Critical Fix: This release resolves a functional issue where
$exprqueries returning strings (like$typeor$concat) would return zero results infind()filters. They now correctly follow MongoDB truthiness rules.$isNumber,$toBool,$type, or string-based expressions within$expr.Overview
This release focuses on "Tier-1 SQL" correctness, ensuring that database-native evaluation perfectly matches MongoDB's BSON semantics:
$addreturns a number,$eqreturns a boolean) during SQL generation.$isNumberto correctly identify that booleans are NOT numbers, even when computed or passed as literals.$typeSupport — Full database-level support for the$typeoperator, including detection of NeoSQLite-encodedBinaryandObjectId.$exprresults in an optimizedCOALESCElogic to ensure that strings and objects are correctly treated as truthy in filter predicates.High Severity Fixes
Corrected $expr Truthiness in Filters
Problem: In MongoDB, strings (including empty ones) and objects are truthy. In SQLite
WHEREclauses, strings are falsy. This caused$exprfilters returning strings to match zero documents.Solution: Wrapped top-level SQL expressions in
COALESCE(({expr}), 0) != 0. This efficiently maps MongoDB truthiness to SQLite boolean logic while evaluating the expression only once and avoiding parameter duplication.Perfect Type Detection for $isNumber
Problem: SQLite's
typeof()cannot distinguish between booleans and integers (both are0/1). This caused{"$isNumber": True}to incorrectly returnTrue.Solution: Combined
json_type()for field references with Static Type Inference for expressions and literal checking for constants. The system now knowsTrueis a boolean before it generates the SQL.Medium Severity Enhancements
Full SQL-Tier $type Implementation
Optimization: The
$typeoperator now runs entirely in SQL. It maps SQLite types to BSON type strings ('int','double','bool', etc.) and usesjson_extractto detect encodedbinDataandobjectIdshapes within JSON strings.Optimized Parameter Binding
Bug Fix: Fixed a regression where operands optimized to constants (e.g.,
isNumber(True) -> 0) would leave behind unused SQL parameters, causingProgrammingErrorduring execution.Test Statistics
Unit Tests
API Comparison Tests
NeoSQLite vs MongoDB
Installation
pip install neosqlite # or poetry installMigration Guide
Upgrading from v1.14.0
This is a non-breaking patch release. Users are encouraged to upgrade immediately to fix potential silent filter failures in
$exprqueries.Credits
Type system enhancements and compatibility fixes developed as part of the NeoSQLite project.
NeoSQLite v1.14.1 — Static Type Inference, $type SQL Optimization, and Truthiness Correctness.
This discussion was created from the release v1.14.1.
All reactions