makePgArray.test.ts — drizzle-orm Source File
Architecture documentation for makePgArray.test.ts, a typescript file in the drizzle-orm codebase. 2 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 90e75d1f_a8d2_2fef_22a8_48ef9b9a32b6["makePgArray.test.ts"] 8d35eaf2_a542_cfd4_fa1a_fafca0f02686["vitest"] 90e75d1f_a8d2_2fef_22a8_48ef9b9a32b6 --> 8d35eaf2_a542_cfd4_fa1a_fafca0f02686 fa14e9c0_b73d_4bcb_463b_adf18df8a285["index.ts"] 90e75d1f_a8d2_2fef_22a8_48ef9b9a32b6 --> fa14e9c0_b73d_4bcb_463b_adf18df8a285 style 90e75d1f_a8d2_2fef_22a8_48ef9b9a32b6 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import { describe, it } from 'vitest';
import { customType, pgTable } from '~/pg-core/index.ts';
const anyColumn = customType<{ data: any }>({
dataType() {
return 'any';
},
});
const table = pgTable('test', {
a: anyColumn('a').array(),
b: anyColumn('a').array().array(),
});
describe.concurrent('makePgArray', () => {
it('parses simple 1D array', ({ expect }) => {
const input = ['1', '2', '3'];
const output = table.a.mapToDriverValue(input);
expect(output).toEqual('{"1","2","3"}');
});
it('parses simple 2D array', ({ expect }) => {
const input = [
['1', '2', '3'],
['4', '5', '6'],
['7', '8', '9'],
];
const output = table.b.mapToDriverValue(input);
expect(output).toEqual('{{"1","2","3"},{"4","5","6"},{"7","8","9"}}');
});
it('parses array with quoted values', ({ expect }) => {
const input = ['1', '2,3', '4'];
const output = table.a.mapToDriverValue(input);
expect(output).toEqual('{"1","2,3","4"}');
});
it('parses array with nested quoted values', ({ expect }) => {
const input = [
['1', '2,3', '4'],
['5', '6,7', '8'],
];
const output = table.b.mapToDriverValue(input);
expect(output).toEqual('{{"1","2,3","4"},{"5","6,7","8"}}');
});
it('parses array with empty values', ({ expect }) => {
const input = ['1', '', '3'];
const output = table.a.mapToDriverValue(input);
expect(output).toEqual('{"1","","3"}');
});
it('parses array with empty nested values', ({ expect }) => {
const input = [
['1', '2', '3'],
['', '5', '6'],
['7', '8', '9'],
];
const output = table.b.mapToDriverValue(input);
expect(output).toEqual('{{"1","2","3"},{"","5","6"},{"7","8","9"}}');
// ... (89 more lines)
Domain
Subdomains
Functions
Dependencies
- index.ts
- vitest
Source
Frequently Asked Questions
What does makePgArray.test.ts do?
makePgArray.test.ts is a source file in the drizzle-orm codebase, written in typescript. It belongs to the DrizzleORM domain, RelationalQuery subdomain.
What functions are defined in makePgArray.test.ts?
makePgArray.test.ts defines 1 function(s): anyColumn.dataType.
What does makePgArray.test.ts depend on?
makePgArray.test.ts imports 2 module(s): index.ts, vitest.
Where is makePgArray.test.ts in the architecture?
makePgArray.test.ts is located at drizzle-orm/tests/makePgArray.test.ts (domain: DrizzleORM, subdomain: RelationalQuery, directory: drizzle-orm/tests).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free