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

support raw based holder #61

Merged
merged 11 commits into from
Nov 21, 2024
Merged

support raw based holder #61

merged 11 commits into from
Nov 21, 2024

Conversation

invisal
Copy link
Collaborator

@invisal invisal commented Nov 21, 2024

Add the support for positional placeholder and named placeholder. You can now use

connection.raw("SELECT * FROM tbl WHERE id = ?", [1]);

Or

connection.raw("SELECT * FROM tbl WHERE id = :id", { id: 1 });

Test Case

  √ Positional placeholder (6 ms)
  √ Positional placeholder inside the string should be ignored
  √ Named placeholder to number placeholder
  √ Named placeholder to number placeholder with string (1 ms) 
  √ Named placeholder with missing value should throw an error (11 ms)
  √ Number of positional placeholder should match with the number of values (1 ms)      
  √ Mixing named and positional placeholder should throw error (1 ms)
  √ Convert positional placeholder to numbered placeholder (1 ms) 

Connection Test Case

  √ Support named parameters
  √ Support positional placeholder

@invisal invisal requested a review from Brayden November 21, 2024 13:46
@Brayden Brayden merged commit 2d40411 into main Nov 21, 2024
11 checks passed
@Brayden Brayden deleted the invisal/support-raw-placeholders branch November 21, 2024 15: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.

2 participants