@xata.io/kysely
A Kysely dialect for Xata, using the Xata serverless driver for TypeScript.
Installation
You should install both kysely
and @xata.io/kysely
with @xata.io/client
. You can install them with your favorite package manager:
pnpm add kysely @xata.io/kysely @xata.io/client
yarn add kysely @xata.io/kysely @xata.io/client
npm install kysely @xata.io/kysely @xata.io/client
Usage
You can pass a new instance of XataDialect
as the dialect
option when creating a new Kysely
instance:
import { Kysely } from 'kysely';
import { XataDialect } from '@xata.io/kysely';
const db = new Kysely<Database>({
xata
});
XataDialect
accepts your Xata client instance as its only option. You can find more information about creating a Xata client instance in our getting started guide.