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

pgSchema.ts — drizzle-orm Source File

Architecture documentation for pgSchema.ts, a typescript file in the drizzle-orm codebase. 1 imports, 1 dependents.

File typescript DrizzleORM 1 imports 1 dependents

Entity Profile

Dependency Diagram

graph LR
  bd80ac25_152c_0d5e_87e3_edd908889e27["pgSchema.ts"]
  53497908_16e7_977d_e97d_7414884a88a6["pg-core"]
  bd80ac25_152c_0d5e_87e3_edd908889e27 --> 53497908_16e7_977d_e97d_7414884a88a6
  79038297_4a30_bd2b_326b_bc745e4faeaf["pg_all_data_types.test.ts"]
  79038297_4a30_bd2b_326b_bc745e4faeaf --> bd80ac25_152c_0d5e_87e3_edd908889e27
  style bd80ac25_152c_0d5e_87e3_edd908889e27 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import {
	bigint,
	bigserial,
	boolean,
	char,
	date,
	decimal,
	doublePrecision,
	integer,
	interval,
	json,
	jsonb,
	line,
	numeric,
	pgEnum,
	pgSchema,
	point,
	real,
	serial,
	smallint,
	smallserial,
	text,
	time,
	timestamp,
	uuid,
	varchar,
} from 'drizzle-orm/pg-core';

export const schema = pgSchema('seeder_lib_pg');

export const moodEnum = pgEnum('mood_enum', ['sad', 'ok', 'happy']);

export const allDataTypes = schema.table('all_data_types', {
	integer: integer('integer'),
	smallint: smallint('smallint'),
	biginteger: bigint('bigint', { mode: 'bigint' }),
	bigintNumber: bigint('bigint_number', { mode: 'number' }),
	serial: serial('serial'),
	smallserial: smallserial('smallserial'),
	bigserial: bigserial('bigserial', { mode: 'bigint' }),
	bigserialNumber: bigserial('bigserial_number', { mode: 'number' }),
	boolean: boolean('boolean'),
	text: text('text'),
	varchar: varchar('varchar', { length: 256 }),
	char: char('char', { length: 256 }),
	numeric: numeric('numeric'),
	decimal: decimal('decimal'),
	real: real('real'),
	doublePrecision: doublePrecision('double_precision'),
	json: json('json'),
	jsonb: jsonb('jsonb'),
	time: time('time'),
	timestampDate: timestamp('timestamp_date', { mode: 'date' }),
	timestampString: timestamp('timestamp_string', { mode: 'string' }),
	dateString: date('date_string', { mode: 'string' }),
	date: date('date', { mode: 'date' }),
	interval: interval('interval'),
	point: point('point', { mode: 'xy' }),
	pointTuple: point('point_tuple', { mode: 'tuple' }),
	line: line('line', { mode: 'abc' }),
	lineTuple: line('line_tuple', { mode: 'tuple' }),
	moodEnum: moodEnum('mood_enum'),
	uuid: uuid('uuid'),
});

export const allArrayDataTypes = schema.table('all_array_data_types', {
	integerArray: integer('integer_array').array(),
	smallintArray: smallint('smallint_array').array(),
	bigintegerArray: bigint('bigint_array', { mode: 'bigint' }).array(),
	bigintNumberArray: bigint('bigint_number_array', { mode: 'number' }).array(),
	booleanArray: boolean('boolean_array').array(),
	textArray: text('text_array').array(),
	varcharArray: varchar('varchar_array', { length: 256 }).array(),
	charArray: char('char_array', { length: 256 }).array(),
	numericArray: numeric('numeric_array').array(),
	decimalArray: decimal('decimal_array').array(),
	realArray: real('real_array').array(),
	doublePrecisionArray: doublePrecision('double_precision_array').array(),
	jsonArray: json('json_array').array(),
	jsonbArray: jsonb('jsonb_array').array(),
	timeArray: time('time_array').array(),
	timestampDateArray: timestamp('timestamp_date_array', { mode: 'date' }).array(),
	timestampStringArray: timestamp('timestamp_string_array', { mode: 'string' }).array(),
	dateStringArray: date('date_string_array', { mode: 'string' }).array(),
	dateArray: date('date_array', { mode: 'date' }).array(),
	intervalArray: interval('interval_array').array(),
	pointArray: point('point_array', { mode: 'xy' }).array(),
	pointTupleArray: point('point_tuple_array', { mode: 'tuple' }).array(),
	lineArray: line('line_array', { mode: 'abc' }).array(),
	lineTupleArray: line('line_tuple_array', { mode: 'tuple' }).array(),
	moodEnumArray: moodEnum('mood_enum_array').array(),
});

export const ndArrays = schema.table('nd_arrays', {
	integer1DArray: integer('integer_1d_array').array(3),
	integer2DArray: integer('integer_2d_array').array(3).array(4),
	integer3DArray: integer('integer_3d_array').array(3).array(4).array(5),
	integer4DArray: integer('integer_4d_array').array(3).array(4).array(5).array(6),
});

export const intervals = schema.table('intervals', {
	intervalYear: interval({ fields: 'year' }),
	intervalYearToMonth: interval({ fields: 'year to month' }),
	intervalMonth: interval({ fields: 'month' }),
	intervalDay: interval({ fields: 'day' }),
	intervalDayToHour: interval({ fields: 'day to hour' }),
	intervalDayToMinute: interval({ fields: 'day to minute' }),
	intervalDayToSecond: interval({ fields: 'day to second' }),
	intervalHour: interval({ fields: 'hour' }),
	intervalHourToMinute: interval({ fields: 'hour to minute' }),
	intervalHourToSecond: interval({ fields: 'hour to second' }),
	intervalMinute: interval({ fields: 'minute' }),
	intervalMinuteToSecond: interval({ fields: 'minute to second' }),
	intervalSecond: interval({ fields: 'second' }),
});

Domain

Dependencies

  • pg-core

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.
What does pgSchema.ts depend on?
pgSchema.ts imports 1 module(s): pg-core.
What files import pgSchema.ts?
pgSchema.ts is imported by 1 file(s): pg_all_data_types.test.ts.
Where is pgSchema.ts in the architecture?
pgSchema.ts is located at drizzle-seed/tests/pg/allDataTypesTest/pgSchema.ts (domain: DrizzleORM, directory: drizzle-seed/tests/pg/allDataTypesTest).

Analyze Your Own Codebase

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

Try Supermodel Free