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();
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server