MCPcopy Create free account
hub / github.com/mikro-orm/mikro-orm / unique

Method unique

packages/core/src/entity/defineEntity.ts:171–171  ·  view source on GitHub ↗

Set column as unique. When a string name is passed, it enables type-safe `using` in `FindOptions`. (SQL only)

(name: N)

Source from the content-addressed store, hash-verified

169 index(index?: boolean): PropertyChain<Value, Options>;
170 /** Set column as unique. When a string name is passed, it enables type-safe `using` in `FindOptions`. (SQL only) */
171 unique<N extends string>(name: N): PropertyChain<Value, Omit<Options, 'unique'> & { unique: N }>;
172 unique(unique?: boolean): PropertyChain<Value, Options>;
173 comment(comment: string): PropertyChain<Value, Options>;
174 collation(collation: string): PropertyChain<Value, Options>;

Callers 15

nativeInsertManyFunction · 0.65
buildFieldsFunction · 0.65
getNativeQueryMethod · 0.65
mapResultsMethod · 0.65
prepareFieldsMethod · 0.65
preparePartitionLimitMethod · 0.65
addIndexMethod · 0.65
mapForeignKeysMethod · 0.65
findMethod · 0.65
pruneToOneRelationsMethod · 0.65
reloadVersionValuesMethod · 0.65

Calls

no outgoing calls

Tested by

no test coverage detected