© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•2y ago
Amos

Using ATTACH with Drizzle

I want to use ATTACH with Drizzle so I can join between 2 dbs, is this currently possible? Something like this:

import { createClient } from "@libsql/client";

async function example() {
    const db = createClient({
        url: process.env.LIBSQL_URL,
        authToken: process.env.LIBSQL_AUTH_TOKEN,
    });
    const txn = await db.transaction("read");
    await txn.execute("ATTACH \"bc307076-d9fc-11ee-b5d4-f69bd26a54ba\" AS attached");
    const rs = await txn.execute("SELECT * FROM attached.t");
    console.log(rs);
    txn.close();
}

await example();
import { createClient } from "@libsql/client";

async function example() {
    const db = createClient({
        url: process.env.LIBSQL_URL,
        authToken: process.env.LIBSQL_AUTH_TOKEN,
    });
    const txn = await db.transaction("read");
    await txn.execute("ATTACH \"bc307076-d9fc-11ee-b5d4-f69bd26a54ba\" AS attached");
    const rs = await txn.execute("SELECT * FROM attached.t");
    console.log(rs);
    txn.close();
}

await example();
Drizzle TeamJoin
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Using Drizzle with Capacitor?
Drizzle TeamDTDrizzle Team / help
3y ago
Using drizzle-zod with superforms
Drizzle TeamDTDrizzle Team / help
7mo ago
Using UUID v7 with Drizzle?
Drizzle TeamDTDrizzle Team / help
16mo ago
Using drizzle with dynamic drivers
Drizzle TeamDTDrizzle Team / help
2y ago