Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
prisma-query-log
Advanced tools
Log prisma query event. Currently works only for SQLite, MySQL.
Features:
npm install --save-dev prisma-query-log
import { createPrismaQueryEventHandler } from 'prisma-query-log';
import { PrismaClient } from '@prisma/client';
const prisma = new PrismaClient({
log: [
{
level: 'query',
emit: 'event',
},
],
});
const log = createPrismaQueryEventHandler();
prisma.$on('query', log);
function createPrismaQueryEventHandler(
options?: CreatePrismaQueryEventHandlerArgs,
): (event: PrismaQueryEvent) => void;
const defaultOptions = {
/**
* Boolean of custom log function,
* if true `console.log` will be used,
* if false noop - logs nothing.
*/
logger: true as boolean | ((query: string) => unknown),
/**
* Remove backticks.
*/
unescape: true,
/**
* Color of query (ANSI escape code)
*/
colorQuery: undefined as undefined | string,
/**
* Color of parameters (ANSI escape code)
*/
colorParameter: undefined as undefined | string,
/**
* Format SQL query,
* colorQuery/colorParameter will be ignored.
*/
format: false,
/**
* Formatter options
* https://github.com/mtxr/vscode-sqltools/tree/master/packages/formatter#options
*/
/**
* Show Query Duration, default is false
*/
queryDuration: false as boolean,
/**
* Query language, default is Standard SQL
*/
language: undefined as 'sql' | 'n1ql' | 'db2' | 'pl/sql' | undefined,
/**
* Characters used for indentation
*/
indent: ' ',
/**
* How to change the case of reserved words
*/
// eslint-disable-next-line unicorn/no-null
reservedWordCase: null as 'upper' | 'lower' | null,
/**
* How many line breaks between queries
*/
linesBetweenQueries: 1 as number | 'preserve',
};
https://github.com/unlight/nestolog - Logger for NestJS, implements LoggerService
docker run -it -p 5432:5432 -e POSTGRES_PASSWORD=postgres -e POSTGRES_USER=user postgres
docker run -it -p 3306:3306 -e MYSQL_ROOT_PASSWORD=password -e MYSQL_DATABASE=query_log_example_db mysql
FAQs
Log prisma query event
The npm package prisma-query-log receives a total of 617 weekly downloads. As such, prisma-query-log popularity was classified as not popular.
We found that prisma-query-log 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.