Gathering detailed insights and metrics for @n1ru4l/slonik-utilities
Gathering detailed insights and metrics for @n1ru4l/slonik-utilities
Gathering detailed insights and metrics for @n1ru4l/slonik-utilities
Gathering detailed insights and metrics for @n1ru4l/slonik-utilities
Utilities for the PostgreSQL Client Slonik
npm install @n1ru4l/slonik-utilities
Typescript
Module System
TypeScript (87.73%)
JavaScript (12.27%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
3 Stars
13 Commits
2 Watchers
15 Branches
1 Contributors
Updated on Mar 04, 2023
Latest Version
0.0.1-alpha.4
Package Id
@n1ru4l/slonik-utilities@0.0.1-alpha.4
Unpacked Size
11.43 kB
Size
3.77 kB
File Count
27
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
Utilities for the PostgreSQL Client Slonik.
Slonik removed some convenient methods in version 19.x.x. The new approach is a bit "too" verbose for my taste. This is why I wrote these helper methods to do common stuff more easily and quicker.
valuesSingle
- Insert a single record1import { sql } from "slonik"; 2import { valuesSingle } from "@n1ru4l/slonik-utilities"; 3 4const user = { 5 id: 1, 6 login: "peter", 7 email: "peter@localhost" 8}; 9 10const query = sql` 11 INSERT INTO "users" ( 12 "id", 13 "login", 14 "email" 15 ) VALUES (${valuesSingle([user.id, user.login, user.email])}); 16`;
valuesList
- Insert multiple records1import { sql } from "slonik"; 2import { valuesList } from "@n1ru4l/slonik-utilities"; 3 4const users = [ 5 { 6 id: 1, 7 login: "peter", 8 email: "peter@localhost" 9 }, 10 { 11 id: 2, 12 login: "lukas", 13 email: "lukas@localhost" 14 } 15]; 16 17const query = sql` 18 INSERT INTO "users" ( 19 "id", 20 "login", 21 "email" 22 ) VALUES (${valuesList(users, user => [user.id, user.login, user.email])}); 23`;
assignmentList
- Update multiple columns1import { sql } from "slonik"; 2import { assignmentList } from "@n1ru4l/slonik-utilities"; 3 4const query = sql` 5 UPDATE "users" 6 SET ${assignmentList({ 7 email: "newemail@localhost", 8 otherValue: 10 9 })} 10 WHERE "id" = 1; 11`;
identifierList
- Generate a list of identifiers1import { sql } from "slonik"; 2import { identifierList } from "@n1ru4l/slonik-utilities"; 3 4const query = sql` 5 SELECT ${identifierList([ 6 ["users", "id"], 7 ["users", "someOtheColumn"] 8 ])} 9 FROM "users"; 10`;
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 0/12 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
48 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More