
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
@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 0 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.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.