MCPcopy Create free account
hub / github.com/Effect-TS/effect / UuidV7WithGenerate

Function UuidV7WithGenerate

packages/effect/src/unstable/schema/Model.ts:841–848  ·  view source on GitHub ↗
(
  schema: Schema.brand<Schema.String, B>
)

Source from the content-addressed store, hash-verified

839 * @since 4.0.0
840 */
841export const UuidV7WithGenerate = <B extends string>(
842 schema: Schema.brand<Schema.String, B>
843): Schema.withConstructorDefault<Schema.brand<Schema.String, B>> =>
844 schema.pipe(
845 Schema.withConstructorDefault(
846 Effect.clockWith((clock) => Effect.succeed(Uuid.v7String(clock.currentTimeMillisUnsafe())))
847 )
848 )
849
850/**
851 * A field that represents a string UUID v7 that is generated on inserts.

Callers 1

UuidV7InsertFunction · 0.85

Calls 3

pipeMethod · 0.65
succeedMethod · 0.45

Tested by

no test coverage detected