pgSchema.ts — drizzle-orm Source File
Architecture documentation for pgSchema.ts, a typescript file in the drizzle-orm codebase. 2 imports, 1 dependents.
Entity Profile
Dependency Diagram
graph LR ca5e9b86_72e6_b85f_28ad_b401964a2399["pgSchema.ts"] 690f7dfc_0aea_9ee8_d6e7_26bbb3689031["drizzle-orm"] ca5e9b86_72e6_b85f_28ad_b401964a2399 --> 690f7dfc_0aea_9ee8_d6e7_26bbb3689031 53497908_16e7_977d_e97d_7414884a88a6["pg-core"] ca5e9b86_72e6_b85f_28ad_b401964a2399 --> 53497908_16e7_977d_e97d_7414884a88a6 2aaeacf2_fda7_2e7f_695d_dd6c7bb82df9["softRelations.test.ts"] 2aaeacf2_fda7_2e7f_695d_dd6c7bb82df9 --> ca5e9b86_72e6_b85f_28ad_b401964a2399 style ca5e9b86_72e6_b85f_28ad_b401964a2399 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import { relations } from 'drizzle-orm';
import { integer, numeric, pgSchema, text, timestamp, varchar } from 'drizzle-orm/pg-core';
export const schema = pgSchema('seeder_lib_pg');
export const customers = schema.table('customer', {
id: varchar('id', { length: 256 }).primaryKey(),
companyName: text('company_name').notNull(),
contactName: text('contact_name').notNull(),
contactTitle: text('contact_title').notNull(),
address: text('address').notNull(),
city: text('city').notNull(),
postalCode: text('postal_code'),
region: text('region'),
country: text('country').notNull(),
phone: text('phone').notNull(),
fax: text('fax'),
});
export const employees = schema.table(
'employee',
{
id: integer('id').primaryKey(),
lastName: text('last_name').notNull(),
firstName: text('first_name'),
title: text('title').notNull(),
titleOfCourtesy: text('title_of_courtesy').notNull(),
birthDate: timestamp('birth_date').notNull(),
hireDate: timestamp('hire_date').notNull(),
address: text('address').notNull(),
city: text('city').notNull(),
postalCode: text('postal_code').notNull(),
country: text('country').notNull(),
homePhone: text('home_phone').notNull(),
extension: integer('extension').notNull(),
notes: text('notes').notNull(),
reportsTo: integer('reports_to'),
photoPath: text('photo_path'),
},
);
export const employeesRelations = relations(employees, ({ one }) => ({
employee: one(employees, {
fields: [employees.reportsTo],
references: [employees.id],
}),
}));
export const orders = schema.table('order', {
id: integer('id').primaryKey(),
orderDate: timestamp('order_date').notNull(),
requiredDate: timestamp('required_date').notNull(),
shippedDate: timestamp('shipped_date'),
shipVia: integer('ship_via').notNull(),
freight: numeric('freight').notNull(),
shipName: text('ship_name').notNull(),
shipCity: text('ship_city').notNull(),
shipRegion: text('ship_region'),
shipPostalCode: text('ship_postal_code'),
shipCountry: text('ship_country').notNull(),
// ... (71 more lines)
Domain
Subdomains
Dependencies
- drizzle-orm
- pg-core
Source
Frequently Asked Questions
What does pgSchema.ts do?
pgSchema.ts is a source file in the drizzle-orm codebase, written in typescript. It belongs to the DrizzleORM domain, DatabaseDrivers subdomain.
What functions are defined in pgSchema.ts?
pgSchema.ts defines 4 function(s): detailsRelations, employeesRelations, ordersRelations, productsRelations.
What does pgSchema.ts depend on?
pgSchema.ts imports 2 module(s): drizzle-orm, pg-core.
What files import pgSchema.ts?
pgSchema.ts is imported by 1 file(s): softRelations.test.ts.
Where is pgSchema.ts in the architecture?
pgSchema.ts is located at drizzle-seed/tests/pg/softRelationsTest/pgSchema.ts (domain: DrizzleORM, subdomain: DatabaseDrivers, directory: drizzle-seed/tests/pg/softRelationsTest).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free