Home / File/ singlestore-proxy.test.ts — drizzle-orm Source File

singlestore-proxy.test.ts — drizzle-orm Source File

Architecture documentation for singlestore-proxy.test.ts, a typescript file in the drizzle-orm codebase. 8 imports, 0 dependents.

Entity Profile

Dependency Diagram

graph LR
  9145a9bc_26e0_3033_d0e2_0ad7e0dcc906["singlestore-proxy.test.ts"]
  f934c582_f266_1cbe_5ff9_08bc5f148179["singlestore-common.ts"]
  9145a9bc_26e0_3033_d0e2_0ad7e0dcc906 --> f934c582_f266_1cbe_5ff9_08bc5f148179
  e6761147_9bb8_212e_229c_68c58cc58851["createDockerDB"]
  9145a9bc_26e0_3033_d0e2_0ad7e0dcc906 --> e6761147_9bb8_212e_229c_68c58cc58851
  850f4c00_692c_1d88_ade9_69e3d5af9d75["tests"]
  9145a9bc_26e0_3033_d0e2_0ad7e0dcc906 --> 850f4c00_692c_1d88_ade9_69e3d5af9d75
  cad5819d_2851_9c06_9778_62eb6e1b2dab["async-retry"]
  9145a9bc_26e0_3033_d0e2_0ad7e0dcc906 --> cad5819d_2851_9c06_9778_62eb6e1b2dab
  30d0cc1f_95f9_3154_9395_6a265979b0a7["singlestore-proxy"]
  9145a9bc_26e0_3033_d0e2_0ad7e0dcc906 --> 30d0cc1f_95f9_3154_9395_6a265979b0a7
  a340f455_7575_91f4_791a_10cd9b9dba1a["promise"]
  9145a9bc_26e0_3033_d0e2_0ad7e0dcc906 --> a340f455_7575_91f4_791a_10cd9b9dba1a
  8d35eaf2_a542_cfd4_fa1a_fafca0f02686["vitest"]
  9145a9bc_26e0_3033_d0e2_0ad7e0dcc906 --> 8d35eaf2_a542_cfd4_fa1a_fafca0f02686
  5536e6a8_02de_67a7_6eaf_0fd73c9c2d92["common"]
  9145a9bc_26e0_3033_d0e2_0ad7e0dcc906 --> 5536e6a8_02de_67a7_6eaf_0fd73c9c2d92
  style 9145a9bc_26e0_3033_d0e2_0ad7e0dcc906 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import retry from 'async-retry';
import type { SingleStoreRemoteDatabase } from 'drizzle-orm/singlestore-proxy';
import { drizzle as proxyDrizzle } from 'drizzle-orm/singlestore-proxy';
import * as mysql2 from 'mysql2/promise';
import { afterAll, beforeAll, beforeEach } from 'vitest';
import { skipTests } from '~/common';
import { createDockerDB, tests } from './singlestore-common';

const ENABLE_LOGGING = false;

// eslint-disable-next-line drizzle-internal/require-entity-kind
class ServerSimulator {
	constructor(private db: mysql2.Connection) {}

	async query(sql: string, params: any[], method: 'all' | 'execute') {
		if (method === 'all') {
			try {
				const result = await this.db.query({
					sql,
					values: params,
					rowsAsArray: true,
					typeCast: function(field: any, next: any) {
						if (field.type === 'TIMESTAMP' || field.type === 'DATETIME' || field.type === 'DATE') {
							return field.string();
						}
						return next();
					},
				});

				return { data: result[0] as any };
			} catch (e: any) {
				return { error: e };
			}
		} else if (method === 'execute') {
			try {
				const result = await this.db.query({
					sql,
					values: params,
					typeCast: function(field: any, next: any) {
						if (field.type === 'TIMESTAMP' || field.type === 'DATETIME' || field.type === 'DATE') {
							return field.string();
						}
						return next();
					},
				});

				return { data: result as any };
			} catch (e: any) {
				return { error: e };
			}
		} else {
			return { error: 'Unknown method value' };
		}
	}

	async migrations(queries: string[]) {
		await this.db.query('START TRANSACTION');
		try {
			for (const query of queries) {
				await this.db.query(query);
// ... (81 more lines)

Domain

Subdomains

Classes

Dependencies

Frequently Asked Questions

What does singlestore-proxy.test.ts do?
singlestore-proxy.test.ts is a source file in the drizzle-orm codebase, written in typescript. It belongs to the DrizzleORM domain, RelationalQuery subdomain.
What does singlestore-proxy.test.ts depend on?
singlestore-proxy.test.ts imports 8 module(s): async-retry, common, createDockerDB, promise, singlestore-common.ts, singlestore-proxy, tests, vitest.
Where is singlestore-proxy.test.ts in the architecture?
singlestore-proxy.test.ts is located at integration-tests/tests/singlestore/singlestore-proxy.test.ts (domain: DrizzleORM, subdomain: RelationalQuery, directory: integration-tests/tests/singlestore).

Analyze Your Own Codebase

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

Try Supermodel Free