insert.ts — drizzle-orm Source File
Architecture documentation for insert.ts, a typescript file in the drizzle-orm codebase. 7 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR efec4ff9_ee06_0af2_67ca_4d6bba73f3a5["insert.ts"] 0e3c50de_fbb6_eb17_22a4_8121934f6fdf["db.ts"] efec4ff9_ee06_0af2_67ca_4d6bba73f3a5 --> 0e3c50de_fbb6_eb17_22a4_8121934f6fdf 19c69e5c_3d0f_1262_b345_f1446e5c039c["tables.ts"] efec4ff9_ee06_0af2_67ca_4d6bba73f3a5 --> 19c69e5c_3d0f_1262_b345_f1446e5c039c caa52a1a_16f9_3a9a_258d_b90f0234f2fd["users"] efec4ff9_ee06_0af2_67ca_4d6bba73f3a5 --> caa52a1a_16f9_3a9a_258d_b90f0234f2fd 25b05299_f48f_bceb_01ca_1343d330a8f7["utils.ts"] efec4ff9_ee06_0af2_67ca_4d6bba73f3a5 --> 25b05299_f48f_bceb_01ca_1343d330a8f7 1da0a48e_f7fe_5ea4_cee2_3ed7d3f39f31["index.ts"] efec4ff9_ee06_0af2_67ca_4d6bba73f3a5 --> 1da0a48e_f7fe_5ea4_cee2_3ed7d3f39f31 8309b973_c3d5_dc4e_7a67_08a63c7dd692["index.ts"] efec4ff9_ee06_0af2_67ca_4d6bba73f3a5 --> 8309b973_c3d5_dc4e_7a67_08a63c7dd692 be483a7f_d5d7_7a9b_9a13_44a4a6aafbbd["sql.ts"] efec4ff9_ee06_0af2_67ca_4d6bba73f3a5 --> be483a7f_d5d7_7a9b_9a13_44a4a6aafbbd style efec4ff9_ee06_0af2_67ca_4d6bba73f3a5 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import type { Equal } from 'type-tests/utils.ts';
import { Expect } from 'type-tests/utils.ts';
import { boolean, int, mysqlTable, QueryBuilder, serial, text } from '~/mysql-core/index.ts';
import type { MySqlInsert } from '~/mysql-core/index.ts';
import type { MySqlRawQueryResult } from '~/mysql2/index.ts';
import { sql } from '~/sql/sql.ts';
import { db } from './db.ts';
import { users } from './tables.ts';
const mysqlInsertReturning = await db.insert(users).values({
// ^?
homeCity: 1,
class: 'A',
age1: 1,
enumCol: 'a',
}).$returningId();
Expect<Equal<{ id: number; serialNullable: number; serialNotNull: number }[], typeof mysqlInsertReturning>>;
const insert = await db.insert(users).values({
homeCity: 1,
class: 'A',
age1: 1,
enumCol: 'a',
});
Expect<Equal<MySqlRawQueryResult, typeof insert>>;
const insertStmt = db.insert(users).values({
homeCity: 1,
class: 'A',
age1: 1,
enumCol: 'a',
}).prepare();
const insertPrepared = await insertStmt.execute();
Expect<Equal<MySqlRawQueryResult, typeof insertPrepared>>;
const insertSql = await db.insert(users).values({
homeCity: sql`123`,
class: 'A',
age1: 1,
enumCol: sql`foobar`,
});
Expect<Equal<MySqlRawQueryResult, typeof insertSql>>;
const insertSqlStmt = db.insert(users).values({
homeCity: sql`123`,
class: 'A',
age1: 1,
enumCol: sql`foobar`,
}).prepare();
const insertSqlPrepared = await insertSqlStmt.execute();
Expect<Equal<MySqlRawQueryResult, typeof insertSqlPrepared>>;
const insertReturning = await db.insert(users).values({
homeCity: 1,
class: 'A',
age1: 1,
enumCol: 'a',
});
Expect<Equal<MySqlRawQueryResult, typeof insertReturning>>;
// ... (148 more lines)
Domain
Subdomains
Functions
Source
Frequently Asked Questions
What does insert.ts do?
insert.ts is a source file in the drizzle-orm codebase, written in typescript. It belongs to the DrizzleORM domain, SQLDialects subdomain.
What functions are defined in insert.ts?
insert.ts defines 1 function(s): dynamic.
What does insert.ts depend on?
insert.ts imports 7 module(s): db.ts, index.ts, index.ts, sql.ts, tables.ts, users, utils.ts.
Where is insert.ts in the architecture?
insert.ts is located at drizzle-orm/type-tests/mysql/insert.ts (domain: DrizzleORM, subdomain: SQLDialects, directory: drizzle-orm/type-tests/mysql).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free