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

feat(sanitization): support bigint params by not wrapping them in quotes #159

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
test(sanitization): add test showcasing current string quotes around …
…bigint params
  • Loading branch information
jkomyno committed Jan 18, 2024
commit 5b91c6216f8ef6b8ce7c73b3cc610804833cead1
6 changes: 6 additions & 0 deletions __tests__/sanitization.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ describe('sanitization', () => {
expect(format(query, [12, 42])).toEqual(expected)
})

test('formats bigint values', () => {
const query = 'select 1 from user where id=? and id2=? and id3=?'
const expected = 'select 1 from user where id=12 and id2=42 and id3=9223372036854775807'
expect(format(query, [12n, 42n, 9223372036854775807n])).toEqual(expected)
})

test('formats string values', () => {
const query = 'select 1 from user where state=?'
const expected = "select 1 from user where state='active'"
Expand Down