Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Additional # in the sql string #320

@shernshiou

Description

@shernshiou

Expected Behavior

Before upgrading to Slonik 26.1.0, tagged template literal generates sql string correctly.

Current Behavior

Inserting a number in the tagged template literal will generate # in front and at the back of $ of sql placeholder.

Possible Solution

Steps to Reproduce

import { sql } from 'slonik';
const limit = 1;
const offset = 2;
const query = sql`SELECT 1 FROM "user" LIMIT ${limit} OFFSET ${offset}`;

The query.sql yields 'SELECT 1 FROM "user" LIMIT #$#1 OFFSET #$#2'

Logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions