
Product
Introducing .NET Support in Socket
Socket now supports .NET, bringing supply chain security and SBOM accuracy to NuGet and MSBuild-powered C# projects.
slonik-sql-tag-raw
Advanced tools
Slonik SQL tag for constructing dynamic queries.
There are no known use cases for generating queries using raw
that aren't covered by nesting bound sql
expressions or by one of the other existing query building methods. raw
exists only as a mechanism to execute externally stored static queries (e.g. queries stored in files).
import {
raw,
} from 'slonik-sql-tag-raw';
raw
(
sql: string,
values?: $ReadOnlyArray<PrimitiveValueExpressionType>
) => RawSqlTokenType;
Raw/ dynamic SQL can be inlined using raw
, e.g.
sql`
SELECT 1
FROM ${raw('"bar"')}
`;
Produces:
{
sql: 'SELECT 1 FROM "bar"',
values: []
}
The second parameter of the raw
can be used to bind positional parameter values, e.g.
sql`
SELECT ${raw('$1', [1])}
`;
Produces:
{
sql: 'SELECT $1',
values: [
1
]
}
raw
supports named parameters, e.g.
sql`
SELECT ${raw(':foo, :bar', {bar: 'BAR', foo: 'FOO'})}
`;
Produces:
{
sql: 'SELECT $1, $2',
values: [
'FOO',
'BAR'
]
}
Named parameters are matched using /[\s,(]:([a-z_]+)/g
regex.
FAQs
Logs Slonik queries.
The npm package slonik-sql-tag-raw receives a total of 4,297 weekly downloads. As such, slonik-sql-tag-raw popularity was classified as popular.
We found that slonik-sql-tag-raw demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports .NET, bringing supply chain security and SBOM accuracy to NuGet and MSBuild-powered C# projects.
Research
Malicious npm packages posing as Telegram bot libraries install SSH backdoors and exfiltrate data from Linux developer machines.
Security News
pip, PDM, pip-audit, and the packaging library are already adding support for Python’s new lock file format.