Drizzle <> SQLite Cloud

This guide assumes familiarity with:

According to the official website, SQLite Clouds is a managed, distributed relational database system built on top of the SQLite database engine.

Step 1 - Install packages

npm
yarn
pnpm
bun
npm i drizzle-orm@beta @sqlitecloud/drivers
npm i -D drizzle-kit@beta

Step 2 - Initialize the driver and make a query

import { drizzle } from 'drizzle-orm/sqlite-cloud';

const db = drizzle(process.env.SQLITE_CLOUD_CONNECTION_STRING);

const result = await db.execute('select 1');

If you need to provide your existing drivers:

import { Database } from '@sqlitecloud/drivers';
import { drizzle } from 'drizzle-orm/sqlite-cloud';

const client = new Database(process.env.SQLITE_CLOUD_CONNECTION_STRING!);
const db = drizzle({ client });

const result = await db.execute('select 1');

What’s next?