Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@exlabs/clickhouse-prisma-adapter
Advanced tools
Install the adapter using npm:
npm install @exlabs/clickhouse-prisma-adapter
Make sure that you have the following dependencies installed:
Add the adapter to your Prisma schema file:
generator client {
provider = "prisma-client-js"
previewFeatures = ["driverAdapters"]
}
datasource db {
provider = "mysql"
url = env("DATABASE_URL")
}
Make sure that prisma schema reflects the schema of the Clickhouse database.
Note that the driverAdapters
preview feature is required to use the adapter.
Datasource provider should be set to mysql
. This is a workaround to make Prisma CLI generate the client.
After updating the schema, run the following command to generate the Prisma client:
npx prisma generate
Create new file, for example clickhouse-adapter.ts
and add the following code:
import { createClient } from "@clickhouse/client";
import { PrismaClient } from "@prisma/client";
import ClickhousePrismaAdapter from "@exlabs/clickhouse-prisma-adapter";
export const client = createClient({
url: "http://localhost:8123",
password: "",
username: "default",
database: "default",
});
const adapter = new ClickhousePrismaAdapter({ client, schemaName: "default" });
export const prisma = new PrismaClient({ adapter });
Now you can use the adapter in your application:
import { prisma } from "./clickhouse-adapter";
async function main() {
const users = await prisma.user.findMany();
console.log(users);
}
FAQs
Clickhouse adapter for Prisma
The npm package @exlabs/clickhouse-prisma-adapter receives a total of 1 weekly downloads. As such, @exlabs/clickhouse-prisma-adapter popularity was classified as not popular.
We found that @exlabs/clickhouse-prisma-adapter 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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.