Home / Type/ SQLiteTableFn Type — drizzle-orm Architecture

SQLiteTableFn Type — drizzle-orm Architecture

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

Entity Profile

Dependency Diagram

graph TD
  ee9c2794_8654_c858_f42b_1ab6e7fcb0ce["SQLiteTableFn"]
  64ae061d_ed9a_c5f9_235a_3f31995a8d54["table.ts"]
  ee9c2794_8654_c858_f42b_1ab6e7fcb0ce -->|defined in| 64ae061d_ed9a_c5f9_235a_3f31995a8d54
  style ee9c2794_8654_c858_f42b_1ab6e7fcb0ce fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

drizzle-orm/src/sqlite-core/table.ts lines 59–160

export interface SQLiteTableFn<TSchema extends string | undefined = undefined> {
	<
		TTableName extends string,
		TColumnsMap extends Record<string, SQLiteColumnBuilderBase>,
	>(
		name: TTableName,
		columns: TColumnsMap,
		extraConfig?: (
			self: BuildColumns<TTableName, TColumnsMap, 'sqlite'>,
		) => SQLiteTableExtraConfigValue[],
	): SQLiteTableWithColumns<{
		name: TTableName;
		schema: TSchema;
		columns: BuildColumns<TTableName, TColumnsMap, 'sqlite'>;
		dialect: 'sqlite';
	}>;

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

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

Frequently Asked Questions

What is the SQLiteTableFn type?
SQLiteTableFn is a type/interface in the drizzle-orm codebase, defined in drizzle-orm/src/sqlite-core/table.ts.
Where is SQLiteTableFn defined?
SQLiteTableFn is defined in drizzle-orm/src/sqlite-core/table.ts at line 59.

Analyze Your Own Codebase

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

Try Supermodel Free