Home / Type/ SingleStoreTableFn Type — drizzle-orm Architecture

SingleStoreTableFn Type — drizzle-orm Architecture

Architecture documentation for the SingleStoreTableFn type/interface in table.ts from the drizzle-orm codebase.

Entity Profile

Dependency Diagram

graph TD
  2c6d4dbc_6fa0_4ab8_08a3_cb03cb016a4a["SingleStoreTableFn"]
  6ef75418_34dd_144f_22fc_b3be7afcdae3["table.ts"]
  2c6d4dbc_6fa0_4ab8_08a3_cb03cb016a4a -->|defined in| 6ef75418_34dd_144f_22fc_b3be7afcdae3
  style 2c6d4dbc_6fa0_4ab8_08a3_cb03cb016a4a fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

drizzle-orm/src/singlestore-core/table.ts lines 105–206

export interface SingleStoreTableFn<TSchemaName extends string | undefined = undefined> {
	<
		TTableName extends string,
		TColumnsMap extends Record<string, SingleStoreColumnBuilderBase>,
	>(
		name: TTableName,
		columns: TColumnsMap,
		extraConfig?: (
			self: BuildColumns<TTableName, TColumnsMap, 'singlestore'>,
		) => SingleStoreTableExtraConfigValue[],
	): SingleStoreTableWithColumns<{
		name: TTableName;
		schema: TSchemaName;
		columns: BuildColumns<TTableName, TColumnsMap, 'singlestore'>;
		dialect: 'singlestore';
	}>;

	<
		TTableName extends string,
		TColumnsMap extends Record<string, SingleStoreColumnBuilderBase>,
	>(
		name: TTableName,
		columns: (columnTypes: SingleStoreColumnBuilders) => TColumnsMap,
		extraConfig?: (self: BuildColumns<TTableName, TColumnsMap, 'singlestore'>) => SingleStoreTableExtraConfigValue[],
	): SingleStoreTableWithColumns<{
		name: TTableName;
		schema: TSchemaName;
		columns: BuildColumns<TTableName, TColumnsMap, 'singlestore'>;
		dialect: 'singlestore';
	}>;
	/**
	 * @deprecated The third parameter of singlestoreTable is changing and will only accept an array instead of an object
	 *
	 * @example
	 * Deprecated version:
	 * ```ts
	 * export const users = singlestoreTable("users", {
	 * 	id: int(),
	 * }, (t) => ({
	 * 	idx: index('custom_name').on(t.id)
	 * }));
	 * ```
	 *
	 * New API:
	 * ```ts
	 * export const users = singlestoreTable("users", {
	 * 	id: int(),
	 * }, (t) => [
	 * 	index('custom_name').on(t.id)
	 * ]);
	 * ```
	 */
	<
		TTableName extends string,
		TColumnsMap extends Record<string, SingleStoreColumnBuilderBase>,
	>(
		name: TTableName,
		columns: TColumnsMap,
		extraConfig?: (self: BuildColumns<TTableName, TColumnsMap, 'singlestore'>) => SingleStoreTableExtraConfig,
	): SingleStoreTableWithColumns<{
		name: TTableName;
		schema: TSchemaName;
		columns: BuildColumns<TTableName, TColumnsMap, 'singlestore'>;
		dialect: 'singlestore';
	}>;

	/**
	 * @deprecated The third parameter of singlestoreTable is changing and will only accept an array instead of an object
	 *
	 * @example
	 * Deprecated version:
	 * ```ts
	 * export const users = singlestoreTable("users", {
	 * 	id: int(),
	 * }, (t) => ({
	 * 	idx: index('custom_name').on(t.id)
	 * }));
	 * ```
	 *
	 * New API:
	 * ```ts

Frequently Asked Questions

What is the SingleStoreTableFn type?
SingleStoreTableFn is a type/interface in the drizzle-orm codebase, defined in drizzle-orm/src/singlestore-core/table.ts.
Where is SingleStoreTableFn defined?
SingleStoreTableFn is defined in drizzle-orm/src/singlestore-core/table.ts at line 105.

Analyze Your Own Codebase

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

Try Supermodel Free