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.
@xata.io/drizzle
Advanced tools
A [Drizzle](https://github.com/drizzle-team/drizzle-orm) driver for [Xata](https://xata.io), using the [Xata serverless driver for TypeScript](https://github.com/xataio/client-ts).
A Drizzle driver for Xata, using the Xata serverless driver for TypeScript.
The goal of this package is polish the implementation and contribute it back to the official Drizzle repository.
You should install both drizzle-orm
and @xata.io/drizzle
with @xata.io/client
. You can install them with your favorite package manager:
# with bun
bun install drizzle-orm @xata.io/drizzle @xata.io/client
# with pnpm
pnpm add drizzle-orm @xata.io/drizzle @xata.io/client
# with yarn
yarn add drizzle-orm @xata.io/drizzle @xata.io/client
# with npm
npm install drizzle-orm @xata.io/drizzle @xata.io/client
To work with drizzle you need to define your models and then create a drizzle instance with the models.
import { drizzle } from '@xata.io/drizzle';
import { sql } from 'drizzle-orm';
import { pgTable, text } from 'drizzle-orm/pg-core';
import { getXataClient } from './xata';
const xata = getXataClient();
const drivers = pgTable('drivers', {
id: text('id').primaryKey(),
surname: text('surname'),
forename: text('forename'),
nationality: text('nationality')
});
const schema = {
drivers
};
const db = drizzle(xata, { schema });
const result = await db.execute(sql`select * from ${drivers} where ${drivers.nationality} = 'Spanish'`);
We offer an experimental model generation helper that will generate the models for you from your tables
array in your xata.ts
file. Since it's a work in progress, we don't recommend using it in your applications yet, please build your models manually. However, we would love to hear your feedback on it.
import { drizzle, buildModels } from '@xata.io/drizzle';
import { sql } from 'drizzle-orm';
import { pgTable, text } from 'drizzle-orm/pg-core';
import { getXataClient, tables } from './xata';
const xata = getXataClient();
const schema = buildModels(tables);
const { drivers } = schema;
const db = drizzle(xata, { schema });
const result = await db.execute(sql`select * from ${drivers} where ${drivers.nationality} = 'Spanish'`);
FAQs
A [Drizzle](https://github.com/drizzle-team/drizzle-orm) driver for [Xata](https://xata.io), using the [Xata serverless driver for TypeScript](https://github.com/xataio/client-ts).
The npm package @xata.io/drizzle receives a total of 280 weekly downloads. As such, @xata.io/drizzle popularity was classified as not popular.
We found that @xata.io/drizzle 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.