storage icon indicating copy to clipboard operation
storage copied to clipboard

Add postgres fragment tagged literal

Open jonasb opened this issue 2 years ago • 5 comments
trafficstars

Add a fragment tagged literal in addition to the existing sql tagged literal. fragment creates a QueryFragment, that can be included in an sql tagged literal.

Example usage:

const sharedValues = fragment`${123}, ${'admin'}`;
await sql`INSERT INTO users (id, credits, role) VALUES (1, ${sharedValues}), (2, ${sharedValues})`;

jonasb avatar Sep 19 '23 21:09 jonasb

⚠️ No Changeset found

Latest commit: 79a201e7458e5fcbf49f9808f666401fc621bbc7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

changeset-bot[bot] avatar Sep 19 '23 21:09 changeset-bot[bot]

@jonasb is attempting to deploy a commit to the Curated Tests Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Sep 19 '23 21:09 vercel[bot]

This PR is addressing similar issues as https://github.com/vercel/storage/pull/126, but without allowing unsafe SQL.

jonasb avatar Sep 19 '23 21:09 jonasb

Missed that I forgot to run prettier

jonasb avatar Nov 06 '23 08:11 jonasb

@vvo Could you please take a look again?

jonasb avatar Nov 07 '23 09:11 jonasb