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

other.ts — drizzle-orm Source File

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

Entity Profile

Dependency Diagram

graph LR
  0de803b9_c75e_e94e_019a_0c694228f60e["other.ts"]
  9a56da77_7540_380c_f8b9_d8bde4914940["db.ts"]
  0de803b9_c75e_e94e_019a_0c694228f60e --> 9a56da77_7540_380c_f8b9_d8bde4914940
  87dcb46e_0d95_8341_e760_d59ef620c68d["tables.ts"]
  0de803b9_c75e_e94e_019a_0c694228f60e --> 87dcb46e_0d95_8341_e760_d59ef620c68d
  05a4464c_b137_3d56_0f64_434dce6f7bad["users"]
  0de803b9_c75e_e94e_019a_0c694228f60e --> 05a4464c_b137_3d56_0f64_434dce6f7bad
  ccd8f141_31dd_df9e_0535_43efaea4d6db["better-sqlite3"]
  0de803b9_c75e_e94e_019a_0c694228f60e --> ccd8f141_31dd_df9e_0535_43efaea4d6db
  5c46beaf_8b59_d2e3_def3_8af6daf1fccd["index.ts"]
  0de803b9_c75e_e94e_019a_0c694228f60e --> 5c46beaf_8b59_d2e3_def3_8af6daf1fccd
  be483a7f_d5d7_7a9b_9a13_44a4a6aafbbd["sql.ts"]
  0de803b9_c75e_e94e_019a_0c694228f60e --> be483a7f_d5d7_7a9b_9a13_44a4a6aafbbd
  25b05299_f48f_bceb_01ca_1343d330a8f7["utils.ts"]
  0de803b9_c75e_e94e_019a_0c694228f60e --> 25b05299_f48f_bceb_01ca_1343d330a8f7
  style 0de803b9_c75e_e94e_019a_0c694228f60e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import type { RunResult } from 'better-sqlite3';
import { eq, inArray } from '~/sql/expressions/index.ts';
import { sql } from '~/sql/sql.ts';

import type { Equal } from 'type-tests/utils.ts';
import { Expect } from 'type-tests/utils.ts';
import { db } from './db.ts';
import { users } from './tables.ts';

const query = sql`select ${users.id}, ${users.class} from ${users} where ${inArray(users.id, [1, 2, 3])} and ${
	eq(users.class, 'A')
}`;

const all = await db.all(query);
Expect<Equal<unknown[], typeof all>>;

const allValuesTyped = await db.values<[number, 'A' | 'B' | 'C']>(query);
Expect<Equal<[number, 'A' | 'B' | 'C'][], typeof allValuesTyped>>;

const allObjects = await db.all(query);
Expect<Equal<unknown[], typeof allObjects>>;

const allObjectsTyped = await db.all<{ id: number; class: 'A' | 'B' | 'C' }>(query);
Expect<Equal<{ id: number; class: 'A' | 'B' | 'C' }[], typeof allObjectsTyped>>;

const run = await db.run(query);
Expect<Equal<RunResult, typeof run>>;

Domain

Dependencies

Frequently Asked Questions

What does other.ts do?
other.ts is a source file in the drizzle-orm codebase, written in typescript. It belongs to the DrizzleORM domain.
What does other.ts depend on?
other.ts imports 7 module(s): better-sqlite3, db.ts, index.ts, sql.ts, tables.ts, users, utils.ts.
Where is other.ts in the architecture?
other.ts is located at drizzle-orm/type-tests/sqlite/other.ts (domain: DrizzleORM, directory: drizzle-orm/type-tests/sqlite).

Analyze Your Own Codebase

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

Try Supermodel Free