Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Unexpected end of input" when inserting a numeric literal into an interval column #427

Open
firelizzard18 opened this issue Nov 8, 2024 · 0 comments

Comments

@firelizzard18
Copy link

Describe the bug

Using a parameterized query to insert a numeric value into a column of type interval throws "Unexpected end of input" when it should either succeed or throw an actually useful error.

Error: Unexpected end of input

💥 This is a nasty error, which was unexpected by pg-mem. Also known "a bug" 😁 Please file an issue !

*️⃣ Failed SQL statement: 
    INSERT INTO test (value) VALUES ('1')

To Reproduce

import { newDb } from "pg-mem";

const db = newDb();
const pg = db.adapters.createPg();
const pool = new pg.Pool();

console.log(await pool.query(`
    CREATE TABLE test (
        value interval NOT NULL
    );

    INSERT INTO test (value) VALUES ('1');

    SELECT * FROM test;
`, [1]));

pg-mem version

pg-mem@^3.0.3:
  version "3.0.3"
  resolved "https://registry.yarnpkg.com/pg-mem/-/pg-mem-3.0.3.tgz#0c8862f9bd096a3dcd2addf97e96675fd687a7ad"
  integrity sha512-Bwg8T46AEMjAmqFT5KIuR2ukRE4GzkVSic7U8CAXqlzFr631N9fTGo4JqNgBHrRCT1qR4Nt2bjZA1AL9JhP4uw==
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant
  NODES
COMMUNITY 2
Project 3
USERS 1