import type { GenericId } from "convex/values"; import { type Option, Schema, SchemaAST } from "effect"; const ConvexId = Symbol.for("ConvexId"); export const Id = ( tableName: TableName, ): Schema.Schema> => Schema.String.pipe( Schema.annotations({ [ConvexId]: tableName }), ) as unknown as Schema.Schema>; export const tableName = ( ast: SchemaAST.AST, ): Option.Option => SchemaAST.getAnnotation(ConvexId)(ast);