src/content/docs/get-started-gel.mdx
import Tab from '@mdx/Tab.astro'; import Tabs from '@mdx/Tabs.astro'; import Npm from "@mdx/Npm.astro"; import Callout from '@mdx/Callout.astro'; import Steps from '@mdx/Steps.astro'; import AnchorCards from '@mdx/AnchorCards.astro'; import Prerequisites from "@mdx/Prerequisites.astro"; import CodeTabs from "@mdx/CodeTabs.astro"; import WhatsNextPostgres from "@mdx/WhatsNextPostgres.astro";
Drizzle has native support for Gel connections with the gel-js client.
<CodeTabs items={["gel", "gel with config"]}>
// Make sure to install the 'gel' package
import { drizzle } from 'drizzle-orm/gel';
const db = drizzle(process.env.DATABASE_URL);
const result = await db.execute('select 1');
// Make sure to install the 'gel' package
import { drizzle } from "drizzle-orm/gel";
// You can specify any property from the gel connection options
const db = drizzle({
connection: {
dsn: process.env.DATABASE_URL,
tlsSecurity: "default",
},
});
const result = await db.execute("select 1");
If you need to provide your existing driver:
// Make sure to install the 'gel' package
import { drizzle } from "drizzle-orm/gel";
import { createClient } from "gel";
const gelClient = createClient();
const db = drizzle({ client: gelClient });
const result = await db.execute('select 1');