Repository navigation
fix(postgres): return BIGINT columns as numbers - #39
Merged
Musiker15 merged 2 commits intoOct 23, 2026
Merged
Conversation
Member
|
Thanks, this one is clean too. The type parser only applies to our pool, and the counter-check works: the test fails without the fix. #32 is merged now, so there's a conflict with main. I wanted to resolve that for you, but your fork belongs to an organization and GitHub doesn't let maintainers push to those. Could you rebase onto main? Two spots:
pool = new Pool({ connectionTimeoutMillis: 10_000, ...descriptor.options, max: 10, types: typeParsers });Keep the |
shane615
force-pushed
the
fix/postgres-bigint
branch
from
October 23, 2026 21:08
ccdda45 to
b392478
Compare
Contributor
Author
Member
12 of 15 tasks
pg returns int8 as a string, SQLite and mysql2 return a number. The
timestamps (created_at, closed_at, ...) therefore reached the transcript
as strings, new Date('1792781224429') is an Invalid Date, and every
transcript failed with 'RangeError: Invalid time value': nothing in the
log channel, nothing stored for /history. The pool now parses int8 as a
number; all BIGINT columns are ms timestamps or row ids, Discord ids are
VARCHAR. Found in the live test.
Claude-Session: https://claude.ai/code/session_01HZPZxD3edzJNFFsiWsHYY1
Contributor
Author
|
Rebased again; the entry now follows the #38 one at the end of |
shane615
force-pushed
the
fix/postgres-bigint
branch
from
October 23, 2026 21:29
b392478 to
2d7c4b8
Compare
12 of 15 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
pgreturnsBIGINT(int8) as a string; SQLite and mysql2 return a number. All timestamps (created_at,closed_at,last_activity, …) areBIGINT, so on PostgreSQL they reach the code as text.generateTranscript()doesnew Date(ticketInfo.created_at), which gives an Invalid Date for a numeric string, so every close fails to build a transcript:Nothing goes to the log channel and nothing is stored. The fix gives the PostgreSQL pool a type parser that returns int8 as a number (that pool only,
pgdefaults untouched). EveryBIGINTcolumn is a millisecond timestamp or a row id, far belowNumber.MAX_SAFE_INTEGER; Discord ids areVARCHAR, so there's no precision risk.NUMERICresults (AVG) keep the existingnum()coercion.Related Issue
None; found while testing #32–#34 live on PostgreSQL 16.
Type of Change
How Was This Tested?
npm test: all pass, plustests/postgres-int8.test.js(fails without the fix, needs no database server).COUNT(*)come back as numbers.Checklist
MSK_API_KEYCHANGELOG.mdentry under[Unreleased]https://claude.ai/code/session_01HZPZxD3edzJNFFsiWsHYY1