uuids (uuid/index.ts)

better-drizzle · src/plugins/uuid/index.ts · typescript · Apache-2.0
database

Module exposing: uuids

// Source: https://github.com/almeidazs/better-drizzle | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
import {
	definePlugin,
	type PluginGeneratedColumns,
	type PluginModelInfo,
} from 'better-drizzle';
import type { AnyColumn } from 'drizzle-orm';

import { isBinaryUuid } from './shared/binary';
import { uuidv4, uuidv7 } from './shared/generate';
import type { UuidsOptions } from './types';
import { version } from './version';

type MutableRecord = Record<string, unknown>;

const DEFAULT_COLUMN = 'id';

const isRecord = (value: unknown): value is MutableRecord =>
	typeof value === 'object' && value !== null && !Array.isArray(value);

// Plain text (`text`, `varchar`, `char`) or

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key