0.0.21 • Published 17 hours ago

@xata.io/drizzle v0.0.21

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
17 hours ago

@xata.io/drizzle

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.

Installation

You should install both drizzle-orm and @xata.io/drizzle with @xata.io/client. You can install them with your favorite package manager:

# 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

Usage

To work with drizzle you need to define your models and then create a drizzle instance with the models. In the future, we will offer a helper function to create the drizzle models from the Xata schema.

import { pgTable, text } from 'drizzle-orm/pg-core';
import { drizzle } from '@xata.io/drizzle';
import { getXataClient } from './xata';

const xata = getXataClient();
const db = drizzle(xata);

const drivers = pgTable('drivers', {
  id: text('id').primaryKey(),
  surname: text('surname'),
  forename: text('forename')
});

const drivers = await db.select().from(drivers).execute();

Limitations

  • Migrations from drizzle are not supported yet, we will add them once the SQL endpoint allows it.
  • Transactions are not supported yet, we will add them once the SQL endpoint allows it.
0.0.21

30 days ago

0.0.20

2 months ago

0.0.19

2 months ago

0.0.18

2 months ago

0.0.17

3 months ago

0.0.16

3 months ago

0.0.15

3 months ago

0.0.14

5 months ago

0.0.13

5 months ago

1.0.0-next.0

5 months ago

0.0.12

5 months ago

0.0.11

5 months ago

0.0.10

6 months ago

0.0.9

7 months ago

0.0.8

7 months ago

0.0.7

7 months ago

0.0.6

8 months ago

0.0.5

8 months ago

0.0.4

8 months ago

0.0.3

8 months ago

0.0.2

8 months ago

0.0.1

8 months ago