Skip to content

fix: correct SQLite column metadata types - #313

Merged
chrispader merged 2 commits into
margelo:mainfrom
huytdps13400:fix/305-column-metadata-types
Sep 29, 2026
Merged

chrispader merged 2 commits into
margelo:mainfrom
huytdps13400:fix/305-column-metadata-types

Conversation

@huytdps13400

@huytdps13400 huytdps13400 commented Aug 22, 2026 •

Copy link
Copy Markdown
Contributor

SQLite query metadata assigns the wrong types to declared columns because the native mapper treats unequal type names as matches. This makes most declarations appear as BOOLEAN and makes BOOLEAN appear as NUMBER, which can mislead consumers that use metadata. This change compares declaration names for equality and adds database-backed regression tests for execute() and executeAsync().

The mapping still recognizes only exact BOOLEAN, FLOAT, INTEGER, TEXT, and BLOB declarations. Other declarations, including REAL, DOUBLE, VARCHAR(...), and INT, continue to return NULL_VALUE.

Reproduction

Create a table with columns declared as BOOLEAN, FLOAT, INTEGER, TEXT, and BLOB. Select those columns plus NULL AS null_value, then inspect result.metadata. Before the fix, the boolean column reports NUMBER and the other declared columns report BOOLEAN. After the fix, the six metadata types are BOOLEAN, NUMBER, INT64, TEXT, ARRAY_BUFFER, and NULL_VALUE, respectively.

Closes #305.

Compare declared SQLite types for equality and cover sync and async metadata mapping. Closes margelo#305.
@chrispader chrispader added bug Incorrect behavior or a change that fixes it. area:api Public JavaScript or TypeScript API and types. labels Sep 29, 2026
@vercel

vercel Bot commented Sep 29, 2026

Copy link
Copy Markdown

@chrispader is attempting to deploy a commit to the Margelo Team on Vercel.

A member of the Team first needs to authorize it.

@chrispader
chrispader merged commit 35185bc into margelo:main Sep 29, 2026
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:api Public JavaScript or TypeScript API and types. bug Incorrect behavior or a change that fixes it.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect column metadata types because strcmp comparisons are inverted

2 participants