Home / File/ mysql-planetscale.test.ts — drizzle-orm Source File

mysql-planetscale.test.ts — drizzle-orm Source File

Architecture documentation for mysql-planetscale.test.ts, a typescript file in the drizzle-orm codebase. 10 imports, 0 dependents.

Entity Profile

Dependency Diagram

graph LR
  67de0eed_fd90_e4cb_d12b_d9c8ba324a0b["mysql-planetscale.test.ts"]
  bcd266b2_f6a8_0abb_2a24_40a68c6f8cc5["mysql-common.ts"]
  67de0eed_fd90_e4cb_d12b_d9c8ba324a0b --> bcd266b2_f6a8_0abb_2a24_40a68c6f8cc5
  e9ea1e58_4116_09ab_4725_c9e3a74adeb7["tests"]
  67de0eed_fd90_e4cb_d12b_d9c8ba324a0b --> e9ea1e58_4116_09ab_4725_c9e3a74adeb7
  cccbc47d_c2bb_d1ee_3a7e_546f7279bf7e["mysql-common-cache.ts"]
  67de0eed_fd90_e4cb_d12b_d9c8ba324a0b --> cccbc47d_c2bb_d1ee_3a7e_546f7279bf7e
  2d9bfa23_6afa_a8eb_f2fb_fdea4578c630["TestCache"]
  67de0eed_fd90_e4cb_d12b_d9c8ba324a0b --> 2d9bfa23_6afa_a8eb_f2fb_fdea4578c630
  208fff58_f804_2a07_330d_076472ff343f["TestGlobalCache"]
  67de0eed_fd90_e4cb_d12b_d9c8ba324a0b --> 208fff58_f804_2a07_330d_076472ff343f
  86aa434f_528e_fe0f_107e_2f26b378d3d2["tests"]
  67de0eed_fd90_e4cb_d12b_d9c8ba324a0b --> 86aa434f_528e_fe0f_107e_2f26b378d3d2
  42a10794_e73a_91c6_c755_ae09e500977e["database"]
  67de0eed_fd90_e4cb_d12b_d9c8ba324a0b --> 42a10794_e73a_91c6_c755_ae09e500977e
  370f5753_3b9a_0311_6478_c4cd9f360bc9["planetscale-serverless"]
  67de0eed_fd90_e4cb_d12b_d9c8ba324a0b --> 370f5753_3b9a_0311_6478_c4cd9f360bc9
  8d35eaf2_a542_cfd4_fa1a_fafca0f02686["vitest"]
  67de0eed_fd90_e4cb_d12b_d9c8ba324a0b --> 8d35eaf2_a542_cfd4_fa1a_fafca0f02686
  5536e6a8_02de_67a7_6eaf_0fd73c9c2d92["common"]
  67de0eed_fd90_e4cb_d12b_d9c8ba324a0b --> 5536e6a8_02de_67a7_6eaf_0fd73c9c2d92
  style 67de0eed_fd90_e4cb_d12b_d9c8ba324a0b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { Client } from '@planetscale/database';
import type { PlanetScaleDatabase } from 'drizzle-orm/planetscale-serverless';
import { drizzle } from 'drizzle-orm/planetscale-serverless';
import { beforeAll, beforeEach } from 'vitest';
import { skipTests } from '~/common';
import { tests } from './mysql-common';
import { TestCache, TestGlobalCache, tests as cacheTests } from './mysql-common-cache';

const ENABLE_LOGGING = false;

let db: PlanetScaleDatabase;
let dbGlobalCached: PlanetScaleDatabase;
let cachedDb: PlanetScaleDatabase;

beforeAll(async () => {
	const client = new Client({ url: process.env['PLANETSCALE_CONNECTION_STRING']! });
	db = drizzle(client, { logger: ENABLE_LOGGING });
	cachedDb = drizzle(client, { logger: ENABLE_LOGGING, cache: new TestCache() });
	dbGlobalCached = drizzle(client, { logger: ENABLE_LOGGING, cache: new TestGlobalCache() });
});

beforeEach((ctx) => {
	ctx.mysql = {
		db,
	};
	ctx.cachedMySQL = {
		db: cachedDb,
		dbGlobalCached,
	};
});

skipTests([
	'mySchema :: view',
	'mySchema :: select from tables with same name from different schema using alias',
	'mySchema :: prepared statement with placeholder in .where',
	'mySchema :: insert with spaces',
	'mySchema :: select with group by as column + sql',
	'mySchema :: select with group by as field',
	'mySchema :: insert many',
	'mySchema :: insert with overridden default values',
	'mySchema :: insert + select',
	'mySchema :: delete with returning all fields',
	'mySchema :: update with returning partial',
	'mySchema :: delete returning sql',
	'mySchema :: insert returning sql',
	'mySchema :: select typed sql',
	'mySchema :: select sql',
	'mySchema :: select all fields',
	'test $onUpdateFn and $onUpdate works updating',
	'test $onUpdateFn and $onUpdate works as $default',
	'set operations (mixed all) as function with subquery',
	'set operations (mixed) from query builder',
	'set operations (except all) as function',
	'set operations (except all) from query builder',
	'set operations (except) as function',
	'set operations (except) from query builder',
	'set operations (intersect all) as function',
	'set operations (intersect all) from query builder',
	'set operations (intersect) as function',
	'set operations (intersect) from query builder',
	'select iterator w/ prepared statement',
	'select iterator',
	'subquery with view',
	'join on aliased sql from with clause',
	'with ... delete',
	'with ... update',
	'with ... select',

	// to redefine in this file
	'utc config for datetime',
	'transaction',
	'transaction with options (set isolationLevel)',
	'having',
	'select count()',
	'insert via db.execute w/ query builder',
	'insert via db.execute + select via db.execute',
	'insert many with returning',
	'delete with returning partial',
	'delete with returning all fields',
	'update with returning partial',
	'update with returning all fields',
	'update returning sql',
	'delete returning sql',
	'insert returning sql',
]);

tests('planetscale');
cacheTests();

Domain

Dependencies

Frequently Asked Questions

What does mysql-planetscale.test.ts do?
mysql-planetscale.test.ts is a source file in the drizzle-orm codebase, written in typescript. It belongs to the DrizzleORM domain.
What does mysql-planetscale.test.ts depend on?
mysql-planetscale.test.ts imports 10 module(s): TestCache, TestGlobalCache, common, database, mysql-common-cache.ts, mysql-common.ts, planetscale-serverless, tests, and 2 more.
Where is mysql-planetscale.test.ts in the architecture?
mysql-planetscale.test.ts is located at integration-tests/tests/mysql/mysql-planetscale.test.ts (domain: DrizzleORM, directory: integration-tests/tests/mysql).

Analyze Your Own Codebase

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

Try Supermodel Free