0.0.0-alpha.vc40692f9cde47e9c3da64ae4be95804800973143 • Published 2 years ago

@xata.io/drizzle v0.0.0-alpha.vc40692f9cde47e9c3da64ae4be95804800973143

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
2 years 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.24

1 year ago

0.0.23

2 years ago

0.0.22

2 years ago

0.0.21

2 years ago

0.0.20

2 years ago

0.0.19

2 years ago

0.0.18

2 years ago

0.0.17

2 years ago

0.0.16

2 years ago

0.0.15

2 years ago

0.0.14

2 years ago

0.0.13

2 years ago

1.0.0-next.0

2 years ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago