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

SQL documentation #16557

Merged
merged 22 commits into from
Jan 21, 2025
Merged

SQL documentation #16557

merged 22 commits into from
Jan 21, 2025

Conversation

cirospaciari
Copy link
Member

@cirospaciari cirospaciari commented Jan 21, 2025

What does this PR do?

  • Documentation or TypeScript types (it's okay to leave the rest blank in this case)
  • Code changes

How did you verify your code works?

@robobun
Copy link

robobun commented Jan 21, 2025

Updated 5:07 AM PT - Jan 21st, 2025

@Jarred-Sumner, your commit 20a0bc0 has 1 failures in #10282:


🧪   try this PR locally:

bunx bun-pr 16557

@cirospaciari cirospaciari changed the title WIP SQL documentation SQL documentation Jan 21, 2025
@cirospaciari cirospaciari marked this pull request as ready for review January 21, 2025 04:27
@nektro
Copy link
Member

nektro commented Jan 21, 2025

would also be nice if there was a ## Reference section that enumerated the methods on SQL


## Numbers and BigInt

Bun's SQL client includes special handling for large numbers that exceed the range of a 53-bit integer. Here’s how it works:
Copy link
Member Author

@cirospaciari cirospaciari Jan 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The range is signed 32-bit like in postgres not the JS safe integer.

Suggested change
Bun's SQL client includes special handling for large numbers that exceed the range of a 53-bit integer. Here’s how it works:
Bun's SQL client includes special handling for large numbers that exceed the range of a 32-bit integer. Here’s how it works:

https://github.com/oven-sh/bun/blob/main/test/js/sql/sql.test.ts#L353-L355

docs/api/sql.md Outdated

| | |
|-|-|
|✅|Tagged template literals to protect againt SQL injection|
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
||Tagged template literals to protect againt SQL injection|
||Tagged template literals to protect against SQL injection|

@Jarred-Sumner Jarred-Sumner merged commit 16054fa into main Jan 21, 2025
5 of 8 checks passed
@Jarred-Sumner Jarred-Sumner deleted the ciro/postgres-docs branch January 21, 2025 12:08
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

Successfully merging this pull request may close these issues.

4 participants