Home / File/ gel.ts — drizzle-orm Source File

gel.ts — drizzle-orm Source File

Architecture documentation for gel.ts, a typescript file in the drizzle-orm codebase. 4 imports, 0 dependents.

File typescript 4 imports

Entity Profile

Dependency Diagram

graph LR
  333d1fdc_edfb_fe7f_792e_55a2d7877ae0["gel.ts"]
  690f7dfc_0aea_9ee8_d6e7_26bbb3689031["drizzle-orm"]
  333d1fdc_edfb_fe7f_792e_55a2d7877ae0 --> 690f7dfc_0aea_9ee8_d6e7_26bbb3689031
  b606db35_e26f_50ff_fb34_bd0a1e80bd47["gel"]
  333d1fdc_edfb_fe7f_792e_55a2d7877ae0 --> b606db35_e26f_50ff_fb34_bd0a1e80bd47
  a141d2d3_896c_404c_4eeb_43205225eb94["gel-core"]
  333d1fdc_edfb_fe7f_792e_55a2d7877ae0 --> a141d2d3_896c_404c_4eeb_43205225eb94
  8d35eaf2_a542_cfd4_fa1a_fafca0f02686["vitest"]
  333d1fdc_edfb_fe7f_792e_55a2d7877ae0 --> 8d35eaf2_a542_cfd4_fa1a_fafca0f02686
  style 333d1fdc_edfb_fe7f_792e_55a2d7877ae0 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { eq } from 'drizzle-orm';
import { drizzle } from 'drizzle-orm/gel';
import { gelTable, text, uuid } from 'drizzle-orm/gel-core';
import { expectTypeOf } from 'vitest';

const account = gelTable('accounts', {
	id: uuid('id').primaryKey().notNull(),
	userId: uuid('user_id')
		.notNull()
		.references(() => users.id),
	meta: text().notNull(),
});

const users = gelTable('users', {
	id: uuid('id').primaryKey(),
	name: text('name').notNull(),
	username: text('username').notNull().unique(),
});

const db = drizzle.mock();

(async () => {
	const res = await db.select()
		.from(users)
		.innerJoin(account, eq(users.id, account.id));

	expectTypeOf(res).toEqualTypeOf<{
		accounts: {
			id: string;
			userId: string;
			meta: string;
		};
		users: {
			id: string;
			name: string;
			username: string;
		};
	}[]>();
});

Dependencies

  • drizzle-orm
  • gel
  • gel-core
  • vitest

Frequently Asked Questions

What does gel.ts do?
gel.ts is a source file in the drizzle-orm codebase, written in typescript.
What does gel.ts depend on?
gel.ts imports 4 module(s): drizzle-orm, gel, gel-core, vitest.
Where is gel.ts in the architecture?
gel.ts is located at integration-tests/type-tests/join-nodenext/gel.ts (directory: integration-tests/type-tests/join-nodenext).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free