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

Add convertJdbcToDsn utility function #619

Merged
merged 4 commits into from
Oct 5, 2023
Merged

Conversation

belgattitude
Copy link
Owner

@belgattitude belgattitude commented Oct 5, 2023

Helps to convert jdbc dsn.
Useful for prisma using sqlserver.

import { convertJdbcToDsn } from '@httpx/dsn-parser';

const jdbcDsn =
    'sqlserver://localhost:1433;database=my-db;authentication=default;user=sa;password=pass03$;encrypt=true;trustServerCertificate=true';

const dsn = convertJdbcToDsn(jdbc);

// -> 'sqlserver://localhost:1433?database=my-db&authentication=default&user=sa&password=pass03$&encrypt=true&trustServerCertificate=true'

@changeset-bot
Copy link

changeset-bot bot commented Oct 5, 2023

🦋 Changeset detected

Latest commit: 54316fc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@httpx/dsn-parser Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@belgattitude belgattitude changed the title Jdbc support dsn parser Add convertJdbcToDsn utility function Oct 5, 2023
@ghost
Copy link

ghost commented Oct 5, 2023

👇 Click on the image for a new way to code review

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map legend

@codecov
Copy link

codecov bot commented Oct 5, 2023

Codecov Report

Merging #619 (54316fc) into main (017071b) will increase coverage by 3.96%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #619      +/-   ##
==========================================
+ Coverage   88.11%   92.07%   +3.96%     
==========================================
  Files          11       72      +61     
  Lines         143      555     +412     
  Branches       57      117      +60     
==========================================
+ Hits          126      511     +385     
- Misses         14       38      +24     
- Partials        3        6       +3     
Flag Coverage Δ
httpx-dsn-parser-unit 100.00% <100.00%> (ø)
httpx-exception-unit 93.38% <ø> (?)
httpx-json-api-unit 66.00% <ø> (ø)
Files Coverage Δ
packages/dsn-parser/src/convert-jdbc-to-dsn.ts 100.00% <100.00%> (ø)

... and 60 files with indirect coverage changes

@belgattitude belgattitude merged commit b7587cd into main Oct 5, 2023
@belgattitude belgattitude deleted the jdbc-support-dsn-parser branch October 5, 2023 16:40
@belgattitude belgattitude mentioned this pull request Oct 5, 2023
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.

1 participant